Add ability to specify ESMTP options and envelope FROM address #48

Merged
merged 2 commits into from Oct 3, 2013

Projects

None yet

2 participants

@aromanovich

No description provided.

@mattupstate
Owner

I'm failing to see where the mail_options and rcpt_options properties are being used. The only change I really see is that you've added a new parameter to the send method.

@mattupstate
Owner

Ah, I missed that. Sorry! However, I'm not sure I understand the reason for an API change on the send method.

@aromanovich

I'm using VERP technique to be able to handle bounces.
Specifying Return-Path in extra_headers dictionary is not the solution, because the MTAs just replace it with the envelope from address. And it turns out that the only way to have a custom Return-Path address is to use it in the MAIL FROM SMTP command — that's why I needed envelope_from argument.

Yeah, it's quite not obvious and I should have described it earlier :)

@mattupstate
Owner

I am still failing to see why an extra parameter is needed on the send method. Why not just set message.sender with your desired value or pass it to the Message constructor?

@aromanovich

Setting message.sender would change not only the envelope from address (and therefore Return-Path), but the From: header too.
The point is to keep something human-readable in the From: header (say, no-reply@example.com) that is being shown to the recipient and change the envelope from address to something like bounces-<some-base-64-encoded-data>@example.com.

@mattupstate
Owner

Thanks for helping me understand.

@mattupstate mattupstate merged commit a02b7af into mattupstate:master Oct 3, 2013

1 check passed

Details default The Travis CI build passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment