diff --git a/emails/mesh-invite.html b/emails/mesh-invite.html index ada5bf0a..7bc98ce0 100644 --- a/emails/mesh-invite.html +++ b/emails/mesh-invite.html @@ -12,7 +12,7 @@ Hello [[[NAME]]],
-User [[[USERNAME]]] on server [[[SERVERNAME]]] is requesting you to install software to start a remote control session.
+User [[[USERNAME]]] on server [[[SERVERNAME]]] is requesting you to install software to start a remote control session.
Message: [[[MSG]]]
@@ -34,7 +34,7 @@
- To install the software, click here and follow the instructions.
+ To install the software, click here and follow the instructions.
If you did not initiate this request, please ignore this mail.
diff --git a/emails/translations/mesh-invite_cs.html b/emails/translations/mesh-invite_cs.html index e2ae4064..837058d5 100644 --- a/emails/translations/mesh-invite_cs.html +++ b/emails/translations/mesh-invite_cs.html @@ -12,7 +12,7 @@ Dobrý den, [[[NAME]]], -Uživatel [[[USERNAME]]] na serveru [[[SERVERNAME]]] vás žádá o instalaci softwaru pro spuštění relace dálkového ovládání.
+Uživatel [[[USERNAME]]] na serveru [[[SERVERNAME]]] vás žádá o instalaci softwaru pro spuštění relace dálkového ovládání.
Zpráva: [[[MSG]]]
@@ -34,7 +34,7 @@
- Chcete-li nainstalovat software, klikněte zde a postupujte podle pokynů.
+ Chcete-li nainstalovat software, klikněte zde a postupujte podle pokynů.
Pokud jste tento požadavek nezačali, ignorujte tento e-mail.
diff --git a/emails/translations/mesh-invite_de.html b/emails/translations/mesh-invite_de.html index 86e89dac..65597cce 100644 --- a/emails/translations/mesh-invite_de.html +++ b/emails/translations/mesh-invite_de.html @@ -12,7 +12,7 @@ Hallo [[[NAME]]], -Benutzer [[[USERNAME]]] auf dem Server [[[SERVERNAME]]] fordert Sie auf, Software zu installieren, um eine Fernsteuerungssitzung zu starten.
+Benutzer [[[USERNAME]]] auf dem Server [[[SERVERNAME]]] fordert Sie auf, Software zu installieren, um eine Fernsteuerungssitzung zu starten.
Botschaft: [[[MSG]]]
@@ -34,7 +34,7 @@
- Um die Software zu installieren, hier klicken und folgen Sie den Anweisungen.
+ Um die Software zu installieren, hier klicken und folgen Sie den Anweisungen.
Wenn Sie diese Anfrage nicht initiiert haben, ignorieren Sie diese Mail bitte.
diff --git a/emails/translations/mesh-invite_es.html b/emails/translations/mesh-invite_es.html index 646f9109..cbf8ec6c 100644 --- a/emails/translations/mesh-invite_es.html +++ b/emails/translations/mesh-invite_es.html @@ -12,7 +12,7 @@ Hola [[[NAME]]], -Usuario [[[USERNAME]]] en servidor [[[SERVERNAME]]] le solicita que instale software para iniciar una sesión de control remoto.
+Usuario [[[USERNAME]]] en servidor [[[SERVERNAME]]] le solicita que instale software para iniciar una sesión de control remoto.
Mensaje: [[[MSG]]]
@@ -34,7 +34,7 @@
- Para instalar el software, haga clic aquí y siga las instrucciones.
+ Para instalar el software, haga clic aquí y siga las instrucciones.
Si Ud. no inicio este requerimiento, por favor ignore este correo.
diff --git a/emails/translations/mesh-invite_fi.html b/emails/translations/mesh-invite_fi.html index d25a873b..03cdc8c9 100644 --- a/emails/translations/mesh-invite_fi.html +++ b/emails/translations/mesh-invite_fi.html @@ -12,7 +12,7 @@ Hei [[[NAME]]], -Käyttäjä [[[USERNAME]]] palvelimella [[[SERVERNAME]]] pyytää sinua asentamaan ohjelmiston etäohjausistunnon aloittamiseksi.
+Käyttäjä [[[USERNAME]]] palvelimella [[[SERVERNAME]]] pyytää sinua asentamaan ohjelmiston etäohjausistunnon aloittamiseksi.
Viesti: [[[MSG]]]
@@ -34,7 +34,7 @@
- Asentaaksesi ohjelman, klikkaa tästä ja seuraa ohjeita.
+ Asentaaksesi ohjelman, klikkaa tästä ja seuraa ohjeita.
Jos et suorittanut tätä pyyntöä, voit ohitaa tämän sähköpostin.
diff --git a/emails/translations/mesh-invite_fr.html b/emails/translations/mesh-invite_fr.html index bfb41628..192bf393 100644 --- a/emails/translations/mesh-invite_fr.html +++ b/emails/translations/mesh-invite_fr.html @@ -12,7 +12,7 @@ Bonjour [[[NAME]]], -Utilisateur [[[USERNAME]]] sur le serveur [[[SERVERNAME]]] vous demande d'installer un logiciel pour démarrer une session de contrôle à distance.
+Utilisateur [[[USERNAME]]] sur le serveur [[[SERVERNAME]]] vous demande d'installer un logiciel pour démarrer une session de contrôle à distance.
Message: [[[MSG]]]
@@ -34,7 +34,7 @@
- Pour installer le logiciel, cliquez ici et suivez les instructions.
+ Pour installer le logiciel, cliquez ici et suivez les instructions.
Si vous n'avez pas initié cette demande, veuillez ignorer ce courrier.
diff --git a/emails/translations/mesh-invite_hi.html b/emails/translations/mesh-invite_hi.html index f1c9ce1c..165f6651 100644 --- a/emails/translations/mesh-invite_hi.html +++ b/emails/translations/mesh-invite_hi.html @@ -12,7 +12,7 @@ नमस्कार [[[NAME]]], -उपयोगकर्ता [[[USERNAME]]] सर्वर पर [[[SERVERNAME]]] रिमोट कंट्रोल सेशन शुरू करने के लिए आपको सॉफ्टवेयर इंस्टॉल करने का अनुरोध कर रहा है।
+उपयोगकर्ता [[[USERNAME]]] सर्वर पर [[[SERVERNAME]]] रिमोट कंट्रोल सेशन शुरू करने के लिए आपको सॉफ्टवेयर इंस्टॉल करने का अनुरोध कर रहा है।
संदेश: [[[MSG]]]
@@ -34,7 +34,7 @@
- सॉफ़्टवेयर स्थापित करने के लिए, यहाँ क्लिक करें और निर्देशों का पालन करें।
+ सॉफ़्टवेयर स्थापित करने के लिए, यहाँ क्लिक करें और निर्देशों का पालन करें।
यदि आपने यह अनुरोध आरंभ नहीं किया है, तो कृपया इस मेल को अनदेखा करें।
diff --git a/emails/translations/mesh-invite_ja.html b/emails/translations/mesh-invite_ja.html index 8a4e5f51..252bbb34 100644 --- a/emails/translations/mesh-invite_ja.html +++ b/emails/translations/mesh-invite_ja.html @@ -12,7 +12,7 @@ [[[NAME]]]様 -サーバー上のユーザー[[[USERNAME]]] [[[SERVERNAME]]] リモートコントロールセッションを開始するソフトウェアをインストールするように要求しています。
+サーバー上のユーザー[[[USERNAME]]] [[[SERVERNAME]]] リモートコントロールセッションを開始するソフトウェアをインストールするように要求しています。
メッセージ: [[[MSG]]]
@@ -34,7 +34,7 @@
- ソフトウェアをインストールするには、 ここをクリック 指示に従ってください。
+ ソフトウェアをインストールするには、 ここをクリック 指示に従ってください。
このリクエストを開始していない場合は、このメールを無視してください。
diff --git a/emails/translations/mesh-invite_ko.html b/emails/translations/mesh-invite_ko.html index 889fac4d..4a3989e3 100644 --- a/emails/translations/mesh-invite_ko.html +++ b/emails/translations/mesh-invite_ko.html @@ -12,7 +12,7 @@ 안녕하세요, [[[NAME]]]님. -서버의 [[[USERNAME]]] 사용자 [[[SERVERNAME]]] 원격 제어 세션을 시작하기 위해 소프트웨어 설치를 요청하고 있습니다.
+서버의 [[[USERNAME]]] 사용자 [[[SERVERNAME]]] 원격 제어 세션을 시작하기 위해 소프트웨어 설치를 요청하고 있습니다.
메시지: [[[MSG]]]
@@ -35,7 +35,7 @@
- 소프트웨어를 설치하려면, 여기를 클릭하십시오. 그리고 다음 지시들을 따르십시오.
+ 소프트웨어를 설치하려면, 여기를 클릭하십시오. 그리고 다음 지시들을 따르십시오.
이 요청을 시작하지 않은 경우, 이 메일을 무시하십시오.
diff --git a/emails/translations/mesh-invite_nl.html b/emails/translations/mesh-invite_nl.html index 1d360217..d8a445db 100644 --- a/emails/translations/mesh-invite_nl.html +++ b/emails/translations/mesh-invite_nl.html @@ -12,7 +12,7 @@ Hallo [[[NAME]]], -Gebruiker [[[USERNAME]]] op server [[[SERVERNAME]]] vraagt u om de software te installeren om een ondersteunings sessie te starten.
+Gebruiker [[[USERNAME]]] op server [[[SERVERNAME]]] vraagt u om de software te installeren om een ondersteunings sessie te starten.
Bericht: [[[MSG]]]
@@ -34,7 +34,7 @@
- Om de software te installeren, Klik hier en volg de instructies.
+ Om de software te installeren, Klik hier en volg de instructies.
Als u dit verzoek niet heeft ingediend, dan kunt u deze e-mail negeren.
diff --git a/emails/translations/mesh-invite_pt.html b/emails/translations/mesh-invite_pt.html index 41ba5b66..60d94a86 100644 --- a/emails/translations/mesh-invite_pt.html +++ b/emails/translations/mesh-invite_pt.html @@ -12,7 +12,7 @@ Olá [[[NAME]]], -Usuário [[[USERNAME]]] no servidor [[[SERVERNAME]]] está solicitando a instalação de um software para iniciar uma sessão de controle remoto.
+Usuário [[[USERNAME]]] no servidor [[[SERVERNAME]]] está solicitando a instalação de um software para iniciar uma sessão de controle remoto.
Mensagem: [[[MSG]]]
@@ -34,7 +34,7 @@
- Para instalar o software, Clique aqui e siga as instruções.
+ Para instalar o software, Clique aqui e siga as instruções.
Se você não iniciou esta solicitação, ignore este e-mail.
diff --git a/emails/translations/mesh-invite_ru.html b/emails/translations/mesh-invite_ru.html index e390715b..7d80f578 100644 --- a/emails/translations/mesh-invite_ru.html +++ b/emails/translations/mesh-invite_ru.html @@ -12,7 +12,7 @@ Здравствуйте, [[[NAME]]], -Пользователь [[[USERNAME]]] на сервере [[[SERVERNAME]]] просит вас установить программное обеспечение, чтобы начать сеанс удаленного управления.
+Пользователь [[[USERNAME]]] на сервере [[[SERVERNAME]]] просит вас установить программное обеспечение, чтобы начать сеанс удаленного управления.
Сообщение: [[[MSG]]]
@@ -34,7 +34,7 @@
- Чтобы установить программное обеспечение, кликните сюда и следуйте инструкциям.
+ Чтобы установить программное обеспечение, кликните сюда и следуйте инструкциям.
Если вы не инициировали этот запрос, игнорируйте это письмо.
diff --git a/emails/translations/mesh-invite_tr.html b/emails/translations/mesh-invite_tr.html index 0583b633..0728d711 100644 --- a/emails/translations/mesh-invite_tr.html +++ b/emails/translations/mesh-invite_tr.html @@ -12,7 +12,7 @@ Merhaba [[[NAME]]], -Sunucudaki kullanıcı [[[USERNAME]]] [[[SERVERNAME]]] bir uzaktan kontrol oturumu başlatmak için yazılım yüklemenizi istiyor.
+Sunucudaki kullanıcı [[[USERNAME]]] [[[SERVERNAME]]] bir uzaktan kontrol oturumu başlatmak için yazılım yüklemenizi istiyor.
İleti: [[[MSG]]]
@@ -34,7 +34,7 @@
- Yazılımı kurmak için, buraya Tıkla ve talimatları izleyin.
+ Yazılımı kurmak için, buraya Tıkla ve talimatları izleyin.
Bu isteği siz başlatmadıysanız, lütfen bu postayı dikkate almayın.
diff --git a/emails/translations/mesh-invite_zh-chs.html b/emails/translations/mesh-invite_zh-chs.html index d14ba71f..d131ee59 100644 --- a/emails/translations/mesh-invite_zh-chs.html +++ b/emails/translations/mesh-invite_zh-chs.html @@ -12,7 +12,7 @@ 您好[[[NAME]]], -服务器上的使用者[[[USERNAME]]] [[[SERVERNAME]]] 正在要求您安装软件以启动远程控制会话。
+服务器上的使用者[[[USERNAME]]] [[[SERVERNAME]]] 正在要求您安装软件以启动远程控制会话。
消息: [[[MSG]]]
@@ -34,7 +34,7 @@
如果您没有发起此请求,请不理此邮件。
diff --git a/emails/translations/mesh-invite_zh-cht.html b/emails/translations/mesh-invite_zh-cht.html index d2add51c..a843f3e5 100644 --- a/emails/translations/mesh-invite_zh-cht.html +++ b/emails/translations/mesh-invite_zh-cht.html @@ -12,7 +12,7 @@ 你好[[[NAME]]], -伺服器上的使用者[[[USERNAME]]] [[[SERVERNAME]] 正在要求你安裝軟體以啟動遠程控制會話。
+伺服器上的使用者[[[USERNAME]]] [[[SERVERNAME]] 正在要求你安裝軟體以啟動遠程控制會話。
訊息: [[[MSG]]]
@@ -34,7 +34,7 @@
如果你沒有發起此請求,請不理此電郵。
diff --git a/meshcentral-config-schema.json b/meshcentral-config-schema.json index 2810a78c..d7bca2c6 100644 --- a/meshcentral-config-schema.json +++ b/meshcentral-config-schema.json @@ -551,7 +551,8 @@ "type": "object", "properties": { "from": { "type": "string", "format": "email", "description": "Email address used in the messages from field." }, - "apikey": { "type": "string", "description": "The SendGrid API key." } + "apikey": { "type": "string", "description": "The SendGrid API key." }, + "verifyemail": { "type": "boolean", "default": true, "description": "When set to false, the email format and DNS MX record are not checked." } }, "required": [ "from", "apikey" ] }, diff --git a/meshmail.js b/meshmail.js index fe5433c6..597e5513 100644 --- a/meshmail.js +++ b/meshmail.js @@ -178,8 +178,13 @@ module.exports.CreateMeshMail = function (parent) { var options = { email: email, servername: domain.title ? domain.title : 'MeshCentral', token: token }; if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; } + // Get from field + var from = null; + if (parent.config.sendgrid && (typeof parent.config.sendgrid.from == 'string')) { from = parent.config.sendgrid.from; } + else if (parent.config.smtp && (typeof parent.config.smtp.from == 'string')) { from = parent.config.smtp.from; } + // Send the email - obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); + obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); sendNextMail(); } }); @@ -206,8 +211,13 @@ module.exports.CreateMeshMail = function (parent) { var options = { username: username, accountname: accountname, email: email, servername: domain.title ? domain.title : 'MeshCentral', password: password }; if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; } + // Get from field + var from = null; + if (parent.config.sendgrid && (typeof parent.config.sendgrid.from == 'string')) { from = parent.config.sendgrid.from; } + else if (parent.config.smtp && (typeof parent.config.smtp.from == 'string')) { from = parent.config.smtp.from; } + // Send the email - obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); + obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); sendNextMail(); } }); @@ -235,8 +245,13 @@ module.exports.CreateMeshMail = function (parent) { if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; } options.cookie = obj.parent.encodeCookie({ u: userid, e: email, a: 1 }, obj.mailCookieEncryptionKey); + // Get from field + var from = null; + if (parent.config.sendgrid && (typeof parent.config.sendgrid.from == 'string')) { from = parent.config.sendgrid.from; } + else if (parent.config.smtp && (typeof parent.config.smtp.from == 'string')) { from = parent.config.smtp.from; } + // Send the email - obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); + obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); sendNextMail(); } }); @@ -264,8 +279,13 @@ module.exports.CreateMeshMail = function (parent) { if (loginkey != null) { options.urlargs1 = '?key=' + loginkey; options.urlargs2 = '&key=' + loginkey; } else { options.urlargs1 = ''; options.urlargs2 = ''; } options.cookie = obj.parent.encodeCookie({ u: userid, e: email, a: 2 }, obj.mailCookieEncryptionKey); + // Get from field + var from = null; + if (parent.config.sendgrid && (typeof parent.config.sendgrid.from == 'string')) { from = parent.config.sendgrid.from; } + else if (parent.config.smtp && (typeof parent.config.smtp.from == 'string')) { from = parent.config.smtp.from; } + // Send the email - obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); + obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); sendNextMail(); } }); @@ -297,8 +317,13 @@ module.exports.CreateMeshMail = function (parent) { options.link = (os == 4) ? 1 : 0; options.linkurl = createInviteLink(domain, meshid, flags, expirehours); + // Get from field + var from = null; + if (parent.config.sendgrid && (typeof parent.config.sendgrid.from == 'string')) { from = parent.config.sendgrid.from; } + else if (parent.config.smtp && (typeof parent.config.smtp.from == 'string')) { from = parent.config.smtp.from; } + // Send the email - obj.pendingMails.push({ to: email, from: parent.config.smtp.from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); + obj.pendingMails.push({ to: email, from: from, subject: mailReplacements(template.htmlSubject, domain, options), text: mailReplacements(template.txt, domain, options), html: mailReplacements(template.html, domain, options) }); sendNextMail(); } }); @@ -388,7 +413,8 @@ module.exports.CreateMeshMail = function (parent) { // Check the email domain DNS MX record. obj.approvedEmailDomains = {}; obj.checkEmail = function (email, func) { - if (parent.config.smtp.verifyemail === false) { func(true); return; } + if ((parent.config.smtp) && (parent.config.smtp.verifyemail === false)) { func(true); return; } + if ((parent.config.sendgrid) && (parent.config.sendgrid.verifyemail === false)) { func(true); return; } var emailSplit = email.split('@'); if (emailSplit.length != 2) { func(false); return; } if (obj.approvedEmailDomains[emailSplit[1]] === true) { func(true); return; } diff --git a/meshuser.js b/meshuser.js index 235c6ab9..d704f6e2 100644 --- a/meshuser.js +++ b/meshuser.js @@ -4065,7 +4065,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use } // Perform email invitation - parent.parent.mailserver.sendAgentInviteMail(domain, (user.realname ? user.realname : user.name), command.email.toLowerCase(), command.meshid, command.name, command.os, command.msg, command.flags, command.expire, parent.getLanguageCodes(req)); + parent.parent.mailserver.sendAgentInviteMail(domain, (user.realname ? user.realname : user.name), command.email.toLowerCase(), command.meshid, command.name, command.os, command.msg, command.flags, command.expire, parent.getLanguageCodes(req), req.query.key); // Send a response if needed if (command.responseid != null) { try { ws.send(JSON.stringify({ action: 'inviteAgent', responseid: command.responseid, result: 'ok' })); } catch (ex) { } }