0

i'm sending mail from my mail server using python sendmail along with NOTIFY,RET,ENVID options. When i send a mail in above said procedure to an outlook mail id i'm receiving dsn. But when i send a mail to either gmail or yahoo im not receiving dsn.

SMTP log when sent to outlook

send: 'ehlo ip-172-31-89-244.ec2.internal\r\n'
reply: '250-VE1EUR03FT018.mail.protection.outlook.com Hello [101.102.103.104]\r\n'
reply: '250-SIZE 49283072\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-DSN\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-STARTTLS\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-BINARYMIME\r\n'
reply: '250-CHUNKING\r\n'
reply: '250 SMTPUTF8\r\n'
reply: retcode (250); Msg: VE1EUR03FT018.mail.protection.outlook.com Hello [101.102.103.104]
SIZE 49283072
PIPELINING
DSN
ENHANCEDSTATUSCODES
STARTTLS
8BITMIME
BINARYMIME
CHUNKING
SMTPUTF8
send: 'mail FROM:<dsn-76@example.com> size=1392 RET=HDRS ENVID=76\r\n'
reply: '250 2.1.0 Sender OK\r\n'
reply: retcode (250); Msg: 2.1.0 Sender OK
send: u'rcpt TO:<abc@outlook.com> NOTIFY=SUCCESS,FAILURE,DELAY\r\n'
reply: '250 2.1.5 Recipient OK\r\n'
reply: retcode (250); Msg: 2.1.5 Recipient OK
send: 'data\r\n'
reply: '354 Start mail input; end with <CRLF>.<CRLF>\r\n'
reply: retcode (354); Msg: Start mail input; end with <CRLF>.<CRLF>
data: (354, 'Start mail input; end with <CRLF>.<CRLF>')
send: 'Content-Type: multipart/alternative;\r\n boundary="===============4828387674099477551=="\r\nMIME-Version: 1.0\r\nDate: Thu, 17 Jan 2019 12:21:49 +0530\r\nFrom: abc@example.com\r\nMessage-Id: <CAEFoQ7qve5kck0xaMnQwi-QNiTJqVSCN1qVDu_9F1kCy0kUpGA@mail.gmail.com>\r\nOriginal-Envelope-Id: 76\r\nResent-Date: Thu, 17 Jan 2019 12:21:49 +0530\r\nResent-From: srikanth vr1 <srikanthvr2@gmail.com>\r\nResent-Message-Id: <CAEFoQ7qve5kck0xaMnQwi-QNiTJqVSCN1qVDu_9F1kCy0kUpGA@mail.gmail.com>\r\nSubject: REGISTERED: test\r\nTo: abc@outlook.com\r\nDKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; \r\n d=example.com; i=@example.com; \r\n q=dns/txt; s=dkim; t=1547707909; h=content-type : \r\n mime-version : date : from : message-id : resent-date : \r\n resent-from : resent-message-id : subject : to : date : \r\n from : subject; \r\n bh=4u6uddMjage5G2IhNFHSL+jOjAVzjaLpUnrgPqdbTdU=; \r\n b=q0n8iNOyPgkVYKuuGDcIRsobyr6ySnjIvApWqr30i6u/zLQGBu9KMEwZ\r\n deOyZlfWIo7tYoGUJYy5McqqevpwfCqVTeE1ButctqE9k6d+ggQZf6Zjqq\r\n PL2Rt4TJNmUY3hrpWvMYi353FnZ0N44tBLeRFDzJT1UV2/LIQRD/kwbmE=\r\n\r\n--===============4828387674099477551==\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset="us-ascii"\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntest\r\n\r\n--===============4828387674099477551==\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset="us-ascii"\r\nContent-Transfer-Encoding: 7bit\r\n\r\n<div dir="ltr">test</div>\r\n\r\n--===============4828387674099477551==--\r\n.\r\n'
reply: '250 2.6.0 <CAEFoQ7qve5kck0xaMnQwi-QNiTJqVSCN1qVDu_9F1kCy0kUpGA@mail.gmail.com> [InternalId=36941013765396, Hostname=VE1EUR03HT108.eop-EUR03.prod.protection.outlook.com] 8366 bytes in 0.875, 9.337 KB/sec Queued mail for delivery -> 250 2.1.5\r\n'
reply: retcode (250); Msg: 2.6.0 <CAEFoQ7qve5kck0xaMnQwi-QNiTJqVSCN1qVDu_9F1kCy0kUpGA@mail.gmail.com> [InternalId=36941013765396, Hostname=VE1EUR03HT108.eop-EUR03.prod.protection.outlook.com] 8366 bytes in 0.875, 9.337 KB/sec Queued mail for delivery -> 250 2.1.5
data: (250, '2.6.0 <CAEFoQ7qve5kck0xaMnQwi-QNiTJqVSCN1qVDu_9F1kCy0kUpGA@mail.gmail.com> [InternalId=36941013765396, Hostname=VE1EUR03HT108.eop-EUR03.prod.protection.outlook.com] 8366 bytes in 0.875, 9.337 KB/sec Queued mail for delivery -> 250 2.1.5')
send: 'quit\r\n'
reply: '221 2.0.0 Service closing transmission channel\r\n'
reply: retcode (221); Msg: 2.0.0 Service closing transmission channel

SMTP log when sent to gmail

send: 'ehlo ip-172-31-89-244.ec2.internal\r\n'
reply: '250-mx.google.com at your service, [101.102.103.104]\r\n'
reply: '250-SIZE 157286400\r\n'
reply: '250-8BITMIME\r\n'
reply: '250-STARTTLS\r\n'
reply: '250-ENHANCEDSTATUSCODES\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-CHUNKING\r\n'
reply: '250 SMTPUTF8\r\n'
reply: retcode (250); Msg: mx.google.com at your service, [101.102.103.104]
SIZE 157286400
8BITMIME
STARTTLS
ENHANCEDSTATUSCODES
PIPELINING
CHUNKING
SMTPUTF8
send: 'mail FROM:<dsn-77@example.com> size=1394 RET=HDRS ENVID=77\r\n'
reply: '250 2.1.0 OK p19-v6si3114094ejj.94 - gsmtp\r\n'
reply: retcode (250); Msg: 2.1.0 OK p19-v6si3114094ejj.94 - gsmtp
send: u'rcpt TO:<abc@gmail.com> NOTIFY=SUCCESS,FAILURE,DELAY\r\n'
reply: '250 2.1.5 OK p19-v6si3114094ejj.94 - gsmtp\r\n'
reply: retcode (250); Msg: 2.1.5 OK p19-v6si3114094ejj.94 - gsmtp
send: 'data\r\n'
reply: '354  Go ahead p19-v6si3114094ejj.94 - gsmtp\r\n'
reply: retcode (354); Msg: Go ahead p19-v6si3114094ejj.94 - gsmtp
data: (354, 'Go ahead p19-v6si3114094ejj.94 - gsmtp')
send: 'Content-Type: multipart/alternative;\r\n boundary="===============2153953495280056619=="\r\nMIME-Version: 1.0\r\nDate: Thu, 17 Jan 2019 12:28:54 +0530\r\nFrom: abc@example.com\r\nMessage-Id: <CAEFoQ7p5QHdEEjDHLaMh-GnSjcwqFKG7ASdFqaVoUZz6-3DVcw@mail.gmail.com>\r\nOriginal-Envelope-Id: 77\r\nResent-Date: Thu, 17 Jan 2019 12:28:54 +0530\r\nResent-From: srikanth vr1 <abc@gmail.com>\r\nResent-Message-Id: <CAEFoQ7p5QHdEEjDHLaMh-GnSjcwqFKG7ASdFqaVoUZz6-3DVcw@mail.gmail.com>\r\nSubject: REGISTERED: test\r\nTo: abc@gmail.com\r\nDKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; \r\n d=example.com; i=@example.com; \r\n q=dns/txt; s=dkim; t=1547708334; h=content-type : \r\n mime-version : date : from : message-id : resent-date : \r\n resent-from : resent-message-id : subject : to : date : \r\n from : subject; \r\n bh=4r/lVPfZ7dZjsNwHEGhBbR/HBl5Nd6TIhMAgBJYGzsI=; \r\n b=hNRVKYa7d2DK7MD6nEPKEZrG3oR7ZTZkCLly9FfQWC+kHJzA91q72nXG\r\n eVxupk1VBcATvceewzW06VUXhKBMdciKPfqzJoATm90oQEYxiDLEp8dWeM\r\n TjWKPM7//yNimuoyMzFdnFumk6tIlf+MOiDZ8CZi28p3ulUcDOV2qm0EM=\r\n\r\n--===============2153953495280056619==\r\nMIME-Version: 1.0\r\nContent-Type: text/plain; charset="us-ascii"\r\nContent-Transfer-Encoding: 7bit\r\n\r\ntest\r\n\r\n--===============2153953495280056619==\r\nMIME-Version: 1.0\r\nContent-Type: text/html; charset="us-ascii"\r\nContent-Transfer-Encoding: 7bit\r\n\r\n<div dir="ltr">test</div>\r\n\r\n--===============2153953495280056619==--\r\n.\r\n'
reply: '250 2.0.0 OK 1547708335 p19-v6si3114094ejj.94 - gsmtp\r\n'
reply: retcode (250); Msg: 2.0.0 OK 1547708335 p19-v6si3114094ejj.94 - gsmtp
data: (250, '2.0.0 OK 1547708335 p19-v6si3114094ejj.94 - gsmtp')
send: 'quit\r\n'
reply: '221 2.0.0 closing connection p19-v6si3114094ejj.94 - gsmtp\r\n'
reply: retcode (221); Msg: 2.0.0 closing connection p19-v6si3114094ejj.94 - gsmtp

You can see in gmail log DSN in not coming in list of options being used. same thing happening with yahoo too.

Thanks in advance

1 Answers1

0

You do not receive delivery status notifications from Google because Google does not send them. Indeed, their SMTP server did not advertise support for DSN, so you should not expect to receive them.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940