nodemailer / smtp-server

Create custom SMTP servers on the fly
Other
846 stars 146 forks source link

Just a question #64

Closed igordeoliveirasa closed 7 years ago

igordeoliveirasa commented 7 years ago

Why am I connecting successfully and asking smtp-server to send an e-mail successfully but the e-mail is never dispatched? It says that it is queued, however never sends. Look at my log:

o:99garcons-api igor$ node qdt-mailer.js

[2016-08-30 18:21:37] INFO: [/Zy42mtho4y/] Connection from [::ffff:127.0.0.1] [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 220 Igors-MacBook-Pro.local ESMTP [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] C: EHLO Igors-MacBook-Pro.local [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 250-Igors-MacBook-Pro.local Nice to meet you, [::ffff:127.0.0.1] 250-PIPELINING 250-8BITMIME 250 SMTPUTF8 [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] C: MAIL FROM:igordeoliveirasa@gmail.com [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 250 Accepted [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] C: RCPT TO:igor.sa@mobilevale.com [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 250 Accepted [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] C: DATA [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 354 End data with . [2016-08-30 18:21:37] INFO: <received 824 bytes> [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] C: <824 bytes of DATA> [2016-08-30 18:21:37] DEBUG: [/Zy42mtho4y/] S: 250 OK: message queued SEND EMAIL SUCCESS { accepted: [ 'igor.sa@mobilevale.com' ], rejected: [], response: '250 OK: message queued', envelope: { from: 'igordeoliveirasa@gmail.com', to: [ 'igor.sa@mobilevale.com' ] }, messageId: 'a0b066b2-aa20-ae7c-203e-cfd577fd4d3c@gmail.com' } [2016-08-30 18:21:37] INFO: [/Zy42mtho4y/] Connection closed to [::ffff:127.0.0.1]

andris9 commented 7 years ago

This is because the smtp-server module is not an MTA application. You can use it in your own application as a SMTP front-end, so SMTP clients could send messages to your app using the SMTP protocol. What you actually do with that message (store it to disk, send it to another SMTP server etc.) is up to your own application logic. If you have not implemented relaying then your app acts as a black hole, it accepts the message but nothing is ever done with it.