diff --git a/src/mailer.js b/src/mailer.js index bde504eb5..e4a0ea5b2 100644 --- a/src/mailer.js +++ b/src/mailer.js @@ -84,16 +84,8 @@ function uninitialize(callback) { } function mailConfig() { - if (process.env.BOX_ENV === 'test' && !process.env.TEST_CREATE_INFRA) { - return { username: 'no-reply', from: 'no-reply@' + config.fqdn(), password: 'doesnotwork' }; - } - - var mail = ini.parse(fs.readFileSync(paths.DATA_DIR + '/addons/mail_vars.sh', 'utf8')); - return { - username: mail.MAIL_ROOT_USERNAME, - from: '"Cloudron" <' + mail.MAIL_ROOT_USERNAME + '@' + config.fqdn() + '>', - password: mail.MAIL_ROOT_PASSWORD + from: '"Cloudron" ' }; } @@ -176,11 +168,7 @@ function sendMails(queue) { var transport = nodemailer.createTransport(smtpTransport({ host: mailServerIp, - port: config.get('smtpPort'), - auth: { - user: mailConfig().username, - pass: mailConfig().password - } + port: config.get('smtpPort') })); debug('Processing mail queue of size %d (through %s:2525)', queue.length, mailServerIp); diff --git a/src/platform.js b/src/platform.js index 9d4474989..a67b2acfb 100644 --- a/src/platform.js +++ b/src/platform.js @@ -223,15 +223,9 @@ function startMail(callback) { const tag = infra.images.mail.tag; const dataDir = paths.DATA_DIR; - const rootPassword = hat(8 * 128); const fqdn = config.fqdn(); const mailFqdn = config.adminFqdn(); - if (!safe.fs.writeFileSync(paths.DATA_DIR + '/addons/mail_vars.sh', - 'MAIL_ROOT_USERNAME=no-reply\nMAIL_ROOT_PASSWORD=' + rootPassword, 'utf8')) { - return callback(new Error('Could not create mail var file:' + safe.error.message)); - } - // TODO: watch for a signal here should the certificate path change. Note that haraka reloads // config automatically if the contents of the certificate changes (eg, renawal). certificates.getAdminCertificatePath(function (error, certFilePath, keyFilePath) { @@ -253,7 +247,6 @@ function startMail(callback) { -e "MAIL_SERVER_NAME=${mailFqdn}" \ -v "${dataDir}/box/mail:/app/data" \ -v "${dataDir}/mail:/run" \ - -v "${dataDir}/addons/mail_vars.sh:/etc/mail/mail_vars.sh:ro" \ -v "${certFilePath}:/etc/tls_cert.pem:ro" \ -v "${keyFilePath}:/etc/tls_key.pem:ro" \ ${ports} \