What im trying to do is to set up smail mail server with lamson (lamsonproject.org). Its working very well, but i have problem with setting return path and for that reason, bounces are going to 'From' address and therefore not reaching my mail server.

Lamson uses pythons smtplib to send mails out.

The "talk" between my project and my smtp server goes like that:

```
send: 'ehlo xxx.mydomiain.com\r\n'
reply: '250-smtp.smtpserver.com\r\n'
reply: '250-PIPELINING\r\n'
reply: '250-SIZE 20000000\r\n'
reply: '250-VRFY\r\n'
reply: '250-ETRN\r\n'
reply: '250-STARTTLS\r\n'
reply: '250-XVERP\r\n'
reply: '250 8BITMIME\r\n'
reply: retcode (250); Msg: smtp.smtpserver.com
PIPELINING
SIZE 20000000
VRFY
ETRN
STARTTLS
XVERP
8BITMIME
send: u'mail FROM:<me@myotherdomain.com> size=352\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: u'rcpt TO:<pleasebouncethis@myotherdomain.com>\r\n'
reply: '250 Ok\r\n'
reply: retcode (250); Msg: Ok
send: 'data\r\n'
reply: '354 End data with <CR><LF>.<CR><LF>\r\n'
reply: retcode (354); Msg: End data with <CR><LF>.<CR><LF>
data: (354, 'End data with <CR><LF>.<CR><LF>')
send: 'MIME-Version: 1.0\r\nTo: pleasebouncethis@myotherdomain.com\r\nSubject: Testing bounces\r\nSender: MAILER-DAEMON@mydomiain.com\r\nReturn-Path: MAILER-DAEMON@mydomain.com\r\nReply-To: MAILER-DAEMON@mydomain.com\r\nMessage-Id: 377b8dcdf661810d3dc73a4a01fe23b3\r\nFrom: me@myotherdomain.com\r\nContent-Type: text/plain; charset="utf-8"\r\nContent-Transfer-Encoding: base64\r\n\r\nc2RmZ2TDpGfDpGRsZsOkZ2xkZmc=\r\n.\r\n'
reply: '250 Ok: queued as E635D157D3\r\n'
reply: retcode (250); Msg: Ok: queued as E635D157D3
data: (250, 'Ok: queued as E635D157D3')
send: 'quit\r\n'
reply: '221 Bye\r\n'
reply: retcode (221); Msg: Bye
Done

```

so i can see, that the Return-Path is indeed in headers. 

While looking for an answer i found this :
[Setting Return-Path with Python sendmail for a MIME message](https://stackoverflow.com/questions/3337055/setting-return-path-with-python-sendmail-for-a-mime-message)

Last comment in the answer is:
Errors/bounces/etc. should go to the Envelope sender, not the address in From:.

When looking up Envelope sender and how to specify, i came across this wiki article:
<http://en.wikipedia.org/wiki/Bounce_address>

This lists another possible header parameters like:
return path, reverse path, envelope from, envelope sender, MAIL FROM, 2821-FROM, return address, From\_, Errors-to.

I put all those into mail headers and - Voila - It worked.

My question is now - Do i really have to ALWAYS list so many possible options for return path in mail headers? Have the mail servers been configured to accept one or two of those parameters now? Are there better ways to make sure, that mail is returned to my mail server, when it bounces?

Alan.