0 votes

Im having trouble sending emails with VERP from an smtp-server that I have logged on to:

Smtp smtp = new Smtp();
smtp.ConnectSSL("myserver.com");
smtp.UseBestLogin("myuser@domain.se", "mypass");

IMail email = Limilabs.Mail.Fluent.Mail.Html(mailbody)
    .Subject(subject)
    .From("myuser@domain.se")
    .To("recipient@another_domain.se")
    .Create();

SmtpMail smtpMail = SmtpMail.CreateUsingVERP(email);
ISendMessageResult result = smtp.SendMessage(smtpMail);

But the result comes out as failed: "recipient address rejected Username 'recipient@another_domain.se' and sender ('total VERP adress') does not match."

If I omit

SmtpMail smtpMail = SmtpMail.CreateUsingVERP(email);

and use :

result = smtp.SendMessage(email); 

everything works fine.

Could you please help me out? Am I missing something here? What am I doing wrong?

Thanks in advance

by
Can you attach the logs, with real eamil address or same email addresses you use in the code? Where is this "total VERP adress" string getting from?
Sorry! The Error message was : "recipient address rejected Username myuser@domain.se and sender myuser+recipient=another_domain.se@domain.se does not match."

In the above example,I have not configured my email-account on the server as an Electronic mail list.
Is that required to get VERP to work?


/regards

1 Answer

0 votes

I'm afraid this may be your server problem. It seems it doesn't understand plus addressing and is very strict on matching 'MAIL FROM' SMTP's command and From: header values.

Proper VERP message should meet the following requirements:

  • From email header set to original sender:
    wikipedians-owner@example.net.
  • To email header set to original recipient:
    bob@example.org.
  • It uses special, unique MAIL FROM address during SMTP conversation:
    wikipedians-owner+bob=example.org@example.net.
  • Return-path email header set to this unique address (wikipedians-owner+bob=example.org@example.net), usually as a result of setting this header with MAIL FROM value by the SMTP server.

What you can do is to use same address for SMTP sender and From: email header.
You'll have to do that manually - use VerpAddress class for that:

string fromAddress = new VERPAddress("bob@example.org", 
    "wikipedians-owner@example.net").Join();

And use this address when creating an email message.

https://www.limilabs.com/blog/verp-variable-envelope-return-path-net

by (297k points)
...