Mailtrain-org / mailtrain

Self hosted newsletter app
GNU General Public License v3.0
5.53k stars 692 forks source link

Unable to send emails #396

Closed jblake1991 closed 6 years ago

jblake1991 commented 6 years ago

Hello, new user of mailtrain here. I have a virtual server (Ubuntu 16.04) in our environment. I used the 'easy' setup, and it's been working fine up until now. The only change since between it not working and working is the IP address.

Basically the error I see in the syslog is -

Mar 13 14:59:22 mailtrain node[1096]: info Mail User "mailtrain" authenticated Mar 13 14:59:22 mailtrain node[1096]: info Mail Sending message 54df7ae8-d874-06a8-978a-abe2610e21fa@[REDACTED] using #6 to <[REDACTED]> Mar 13 14:59:22 mailtrain zone-mta[1570]: (Plugins) "HTTP Sender Config" for "smtp:mail_from" failed with: connect ECONNREFUSED 127.0.0.1:80 Mar 13 14:59:22 mailtrain node[1096]: info Mail Connection #6 was closed Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail Pool Error for #6: Mail command failed: 442 connect ECONNREFUSED 127.0.0.1:80 Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail Send Error: Mail command failed: 442 connect ECONNREFUSED 127.0.0.1:80 Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail Error: Mail command failed: 442 connect ECONNREFUSED 127.0.0.1:80 Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at SMTPConnection._formatError (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:606:19) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at SMTPConnection._actionMAIL (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:1365:34) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at SMTPConnection._responseActions.push.str (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:855:18) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at SMTPConnection._processResponse (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:762:20) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at SMTPConnection._onData (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:558:14) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at Socket._socket.on.chunk (/opt/mailtrain/node_modules/nodemailer/lib/smtp-connection/index.js:510:47) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at emitOne (events.js:96:13) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at Socket.emit (events.js:191:7) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at readableAddChunk (_stream_readable.js:178:18) Mar 13 14:59:22 mailtrain node[1096]: ERR! Mail at Socket.Readable.push (_stream_readable.js:136:10) Mar 13 14:59:22 mailtrain node[1096]: info Mail Connection closed

Any ideas? Any help appreciated.

jblake1991 commented 6 years ago

I thought I would just update you all. I'm now using our Office 365 SMTP server, and this is working fine. I'm guessing the issue is probably down to open ports, however, I have all outgoing ports set to ALLOW in ufw. Ports 25 and 80 are also set to ALLOW in incoming.

bures commented 6 years ago

My 2 cents - the port 80 in the mail command connect seems strange. I would expect port 25 or similar. Anyway, good that it works now.