Buenas noches, a cerca de su respuesta les comento que es básicamente lo que explico en el mensaje de las pruebas que hemos realizado,
no veo ninguna respuesta nueva ya que lo que me relacionan en el link es la documentación que se ha consultado.
Con respecto de que si existe alguna forma de cambiar el puerto no me dan ninguna respuesta . Texto citado " Nos Gustaría saber si es posible cambiar los puertos de envío del correo y utilizar el puerto 1025 o 587, o cual seria la solución recomendada a este problema y que sea diferente a la contenida en el manual de wailon que es con la que se han realizado las diferentes pruebas hasta el momento y que no han funcionado."
Ahora me permito hacerles otra consulta con relacion al modulo module.js
Con Relacion al directori root@wialon-local:/home/wialon/wlocal/modules/mail# acerca del funcionamiento del módulo mail y la función del archivo
"module.js"
En Mi apreciación desde acá se envían correos (solo del sistema ?) , por ejemplo el correo que llega diciendo :
Estimado cliente de Wialon Local,
El sistema de correo funciona correctamente.
Atentamente,
Gurtam.
Al Revisar el contenido del Script "module.js" se visualiza la siguiente Información:
De este extraigo lo Siguiente:
1. var port = (arr.length > 1) ? parseInt(arr[1], 10) : 25; //get("wialon_env", "ADF_SMTP_SERVER_PORT", 25);
Definición del puerto 25 para envio ?.
2. // send email
var smtpParams = {host: server, port: port, secure: (protocol == "smtps"), ignoreTLS: true};
if (smtpLogin != "") {
smtpParams.auth = {};
smtpParams.auth.user = smtpLogin;
smtpParams.auth.pass = smtpPwd;
}
Acaso aca ignoreTLS: true}, omite envío por medio de TLS, puerto 587 del Correo ?.
3. var smtpParams = {host: "localhost", port: 25, secure: false, ignoreTLS: true};
Puerto de envío 25 , ignora el Tls. ??
Contenido del Archivo:
root@wialon-local:~# cd /home/wialon/wlocal/modules/mail
root@wialon-local:/home/wialon/wlocal/modules/mail# ls -la
total 16
drwxr-xr-x 2 wialon wialon 102 Aug 26 15:02 .
drwxr-xr-x 51 wialon wialon 4096 Oct 16 06:34 ..
-rw-r--r-- 1 wialon wialon 0 Aug 26 15:02 descr_en.txt
-rw-r--r-- 1 wialon wialon 0 Aug 26 15:02 descr_ru.txt
-rw-r--r-- 1 wialon wialon 7883 Aug 26 15:02 module.js
-rw-r--r-- 1 wialon wialon 32 Aug 26 15:02 version.txt
root@wialon-local:/home/wialon/wlocal/modules/mail#
root@wialon-local:/home/wialon/wlocal/modules/mail#
root@wialon-local:/home/wialon/wlocal/modules/mail#
root@wialon-local:/home/wialon/wlocal/modules/mail# more module.js
var mailer = require("nodemailer");
/*
Translate
*/
const i18n = require('i18n-2');
var i18n2 = new i18n({
extension: ".json",
locales: ['ru', 'en', 'es']
});
function translate(text) {
var utility = require("../utility/module.js");
const locale = utility.get("local","adminEmailLang","en");
i18n2.setLocale(locale);
return i18n2.__(text);
}
/*
Mail helper
*/
var baseTitle = "Wialon Local (%s) – %s";
var baseBody = "Dear Wialon Local Customer, \n\n" +
"%s\n\n" +
"Best Regards,\n" +
"Gurtam";
var techSupportText = "Please, contact Gurtam Technical Support (support@gurtam.com) to check the situation and take appropriate measures to fix it."; //$t in template
var mailTemplates = {
"newUpdates": {"t": "New updates available", "b": "Note! You have %s updates available.", "h": "<br>Note! You have %s updates available.<br>"},
"diskFull": {"t": "Disk full", "b": "There is not enough space available on the disk.\nDisk usage of %s% matches resource limit [disk usage>90.0%]"},
"diskPanic": {"t": "Not enough free disk space", "b": "There is not enough space available on the disk.\nThe service has been stopped in order to avoid the dama
ge of the database."},
"coreDump": {"t": "Emergency restart", "b": "There are %s crash dumps. \n$t"},
"crashLog": {"t": "Emergency restart", "b": "The following callstack cause Wialon reboot:\n%s \n$t"},
"workErrors": {"t": "Operating errors", "b": "The following errors have been detected:\n%s"},
"startError": {"t": "Start error", "b": "Wialon stopped due to exceeding number of start attempts. \n%s \n$t"},
"testMail": {"t": "Test admin e-mail", "b": "Mail system is working properly."},
"masterError": {"t": "Running issue", "b": "Wialon stopped because of the failure to switch to the master mode. \n$t"},
"envError": {"t": "Running issue", "b": "Failed to prepare Wialon environment. Trying to start with previous configuration. \n$t"},
"panicErrors": {"t": "Running issue", "b": "Runtime errors detected. Wialon will be rebooted now. \n$t"},
"nodeVersion": {"t": "Nodejs version issue", "b": "This is an automatic notification generated by the Wialon Local System. Your server uses an old version of no
dejs which is not going to be supported starting with the release of a new version of Wialon Local in 2018.\nPlease, contact the technical support (support@gurtam.com)
for assistance or instructions for performing necessary procedures."},
"updateFailed": {"t": "Your Wialon Local update stopped", "b": "During the update installation process we found following issues:\n%s\nPlease note, modules were
rolled back to their previous state to ensure your system works. In several minutes Wialon will be restarted again." /*Currently your admin website requested full sync
of stable modules version from the license server.*/},
"upgradeFailed": {"t": "Wialon Local upgrade failed. NodeJS outdated.", "b": "We are sorry to inform you that further upgrade of your Wialon Local is impossible
till you upgrade current NodeJS version on your server.\nLogin to server console under \"root\" user.\nThen perform the following list of commands:\n\ncd /home/wialon/
wlocal/\nservice wlocal stop\n./adf_script stop\napt-get install -y curl\ncurl -sL https://deb.nodesource.com/setup_6.x | sudo bash -\napt-get install -y nodejs\nnpm -g
install forever\nnpm install\nchown -R wialon:wialon /home/wialon/\nservice wlocal restart\n\nCheck the availability of your websites after the restart.\n\nYou can fin
d instructions on this page (https://docs.wialon.com/en/local/1904/admin/req/req).\nAlso for NodeJS uprgade you can refer to technical support (support@gurtam.com) - pl
ease, include remote access details (SSH IP, login and password) into your e-mail.\n"},
"threadsBusy": {"t": "Heavy load", "b": "Wialon is under heavy load or some other problems occurred. All threads are occupied for more than 3 minutes. It is rec
ommended to reboot Wialon. \n$t"},
"cpuBusy": {"t": "Heavy load", "b": "Wialon is under heavy load. CPU usage > 85% for more than 3 minutes. \n$t"},
"unitsLimit": {"t": "Empty unit slots warning", "b": "Empty unit slots are about to run out. You have %s units created out of %s available for your license.\n T
o order more unit slots, you can use the License tab in the Administration panel, do it in your personal account (https://my.gurtam.com), or contact your personal manag
er."}
};
exports.sendTestEmail = function() {
//sendAdminEmail("testMail", "Wialon Local test admin email", "Mail system is working properly", true);
sendAdminEmail("testMail", "", "", null, true);
};
/// Send email
function sendAdminEmail (template, subject, text, params, skipCC2gurtam, attachments) {
var utility = require("../utility/module.js");
var serverPort = utility.get("wialon_env", "ADF_SMTP_SERVER", "localhost");
var arr = serverPort.split(":\/\/");
var protocol = (arr.length > 1 ? arr[0] : "");
arr = arr[arr.length - 1].split(":");
var server = arr[0];
var port = (arr.length > 1) ? parseInt(arr[1], 10) : 25; //get("wialon_env", "ADF_SMTP_SERVER_PORT", 25);
if (server == "")
server = "localhost";
var smtpLogin = utility.get("wialon_env", "ADF_SMTP_AUTH_LOGIN", "");
var smtpPwd = utility.get("wialon_env", "ADF_SMTP_AUTH_PWD", "");
var userName = utility.get("local", "userName", "");
//var errorsLog = "";
//try {
// errorsLog = exec("tail -n1000 logs/trace.log");
//} catch (e) {}
var localAdminEmail = utility.get("local", "localAdminEmail", "");
if (server == "")
return;
var html = "";
if (template && typeof mailTemplates[template] != "undefined") {
subject = translate(mailTemplates[template].t);
if (text)
text = translate(mailTemplates[template].b).replace("$t",translate(techSupportText)) + "\n" + text;
else
text = translate(mailTemplates[template].b).replace("$t",translate(techSupportText));
if (mailTemplates[template].h)
html = translate(mailTemplates[template].h);
}
var title = baseTitle.replace("%s", userName);
title = title.replace("%s", subject);
if (params && params.length) {
for (var i = 0; i < params.length; i++) {
text = text.replace("%s", params);
if (html)
html = html.replace("%s", params);
}
var body = translate(baseBody).replace("%s", text);
if (html)
html = translate(baseBody).replace("%s", html);
// send email
var smtpParams = {host: server, port: port, secure: (protocol == "smtps"), ignoreTLS: true};
if (smtpLogin != "") {
smtpParams.auth = {};
smtpParams.auth.user = smtpLogin;
smtpParams.auth.pass = smtpPwd;
}
var smtpTransport = mailer.createTransport(smtpParams);
// prepare mail
var mail = {
from: "Wialon Local '" + userName +"' " + (smtpLogin || "<noreply@gurtam.com>"),
to: localAdminEmail,
subject: title,
text: body
}
if (html)
mail.html = html;
if (attachments)
mail.attachments = attachments;
var sendEmailError = "Cannot send email. Check SMTP settings.";
var sendEmailSuccess = "Email was successfully sent.";
//if (!skipCC2gurtam)
// mail.cc = "support@gurtam.com,wdc@gurtam.com";
smtpTransport.sendMail(mail, function(error, response){
var log = require("../log/module.js");
log.trace(error ? sendEmailError : sendEmailSuccess);
console.log(arguments);
// try to resend email using internal postfix in case of error while sending email using custom smtp server
var sendWithPostfix = function() {
log.trace("Trying to resend email using localhost");
// send via postfix (set default parameters)
var smtpParams = {host: "localhost", port: 25, secure: false, ignoreTLS: true};
var smtpTransport = mailer.createTransport(smtpParams);
smtpTransport.sendMail(mail, function(error, response){
log.trace(error ? sendEmailError : sendEmailSuccess);
console.log(arguments);
});
};
if (error && server != "localhost")
sendWithPostfix();
});
}
exports.sendAdminEmail = sendAdminEmail;
root@wialon-local:/home/wialon/wlocal/modules/mail#
Nota: es una consulta sobre el modulo, por parte de nosotros no hemos modificado el archivo en ningún sentido.
Gracias