0 votes
by (150 points)
edited

Hello,

I'm evaluating secure-mail.net and I'm trying to implement the delivery status notifications and it seams that delivery notification command is not send to server completely. This is what i try to do:

... .etc
    Smtp smtp = new Smtp();
    smtp.DeliveryStatusNotificationConditions =DeliveryStatusNotificationConditions.Success;// oe all;
    smtp.DeliveryStatusNotificationOriginalMessageMethod = DeliveryStatusNotificationOriginalMessageMethod.FullMessage;

                smtp.CommandSent += new SmtpCommandSentEventHandler(smtp_CommandSent);
                smtp.ResponseRead += new SmtpResponseReadEventHandler(smtp_ResponseRead);
                try
                {
                    smtp.Connect(smtpForm.txtSmtp.Text, Int32.Parse(smtpForm.txtPort.Text), null, SmtpSecurity.Implicit);
                    smtp.Login(smtpForm.txtUser.Text, smtpForm.txtPass.Text);
                     smtp.Send(message);
                }
... .etc

this is what is send/received to server:

   Response: 250 2.0.0 OK 1295950626 l3sm1153293fan.2
    Response: 354  Go ahead l3sm1153293fan.2
    Sending: DATA
    Response: 250 2.1.5 OK l3sm1153293fan.2
    Sending: RCPT TO:<******@gmail.com>
    Response: 250 2.1.0 OK l3sm1153293fan.2
    Sending: MAIL FROM:<******@gmail.com> SIZE=840
    Response: 235 2.7.0 Accepted
    Sending: AUTH PLAIN ****************************************************
    Response: 250 ENHANCEDSTATUSCODES
    Response: 250-AUTH LOGIN PLAIN XOAUTH
    Response: 250-8BITMIME
    Response: 250-SIZE 35651584
    Response: 250-mx.google.com at your service, [79.115.34.63]
    Sending: EHLO username
    Response: 220 mx.google.com ESMTP l3sm1153293fan.2
    Response: 250 2.0.0 OK 1295949901 n15sm4950989fam.12

I was expecting after the "RCPT TO" command to see the "NOTIFY=SUCCESS" command, isn't this the right way to do it to get delivery status notifications?

Thank you very much.

by (150 points)
Hi again, I was wandering if there is any way to catch and modify the commands send through smtp, I just need to modify the "RCPT TO:<******@gmail.com>" and add to the "RCPT TO" the "NOTIFY=SUCCESS,FAILURE" oprional param to obtain de Smtp DSN (Delivery Status Notification) because i was expecting to obtain this by setting smtp.DeliveryStatusNotificationConditions (I'm using c#), but it doesn't work or I'm not sure how to do it. Anyone can help me please, i just to be able to do this before purchasing your great product. Thanks again.

1 Answer

0 votes
by (147k points)
edited
 
Best answer

Smtp object's DeliveryStatusNotificationConditions and DeliveryStatusNotificationOriginalMessageMethod properties are only effective if the SMTP server supports the DSN extension. Unfortunately, Gmail's SMTP server does not support it. It only supports the following extensions:

250-SIZE 35651584
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH
250 ENHANCEDSTATUSCODES

With SMTP servers that do support DSN extension, your code would produce the following behavior:

Sending: MAIL FROM:<lukas@example.org> RET=FULL SIZE=247
Response: 250 2.1.0 OK n2sm5499212fam.28
Sending: RCPT TO:<support@rebex.net> NOTIFY=SUCCESS
Response: 250 2.1.5 OK n2sm5499212fam.28
...

Manually modifying the commands to include these additional parameters is not possible easily, but it wouldn't help - Gmail really doesn't support DSN extension and ignores any DSN parameters sent to it (I actually tried it).

To determine whether the server supports DSN extension, call the following code once connected:

bool supportsDSN = ((smtp.SupportedExtensions & SmtpExtensions.DeliveryStatusNotifications) != 0);
...