wpsharks / mail-remix

0 stars 0 forks source link

SMTP "From:" and "Return-Path:" Headers #4

Open jaswrks opened 9 years ago

jaswrks commented 9 years ago

Most SMTP servers require email to be sent by a specific address, or from a specific domain. It would be great if I could configure this address whenever I setup my SMTP server.

2014-11-03_14-19-20

brucewrks commented 9 years ago

I'll work on this

jaswrks commented 9 years ago

Great!

brucewrks commented 9 years ago

This was added in the latest commit.

jaswrks commented 9 years ago

Great!

I noticed you used the word in uppercase "FROM". I'd suggest changing that to From: so that it's clear that it is setting the From: header in email message headers; like you did for the Return-Path:.

You might also want to consider that many SMTP servers are going to rewrite the Return-Path: whenever mail is actually sent. Depending on the SMTP server they integrate with, the Return-Path: could actually end up being the Sender:, not the actual Return-Path:, since that is often dealt with dynamically by a robot — no matter what you configure. It's still import to set the Return-Path: header, but it doesn't always end up in the final message like this.

brucewrks commented 9 years ago

You might also want to consider that many SMTP servers are going to rewrite the Return-Path: whenever mail is actually sent.

What would you recommend putting in the information there then?

jaswrks commented 9 years ago

I think you could actually do with less information here, and simply state that it's the Return-Path: header. What you have now could be seen as a problem w/ your plugin in cases where the actual Return-Path: in emails is not ending up with what they defined.

"The Return-Path defines the return address used by the SMTP server in the case of a "bounce".".

This could even leave some people wondering if they need to do something special with bounces or not; or if your plugin handles this. In short, I think stating it in the simplest terms possible and perhaps a link to the Wikipedia article on mail headers; that would be enough. http://en.wikipedia.org/wiki/Email#Message_header

This is something I just worked on myself when setting up Comment Mail, so just sharing my thoughts. What you have is fine, just letting you know how it feels from my perspective.

In CM I don't even provide separate options for this. I only ask for a single address that will be used for both the From: and Return-Path: headers. I think that's probably simpler. I can't imagine anyone wanting to route mail back to a separate address these days; that should be automated by the SMTP server itself and rewritten dynamically.