Hello,

Is there currently any way to set the mail headers?

One specific application is to handle bounces.

Currently, the FROM field in the newsletter sent will receive all the bounces from the subscribers' list, which can be a lot. A solution could have been to set the FROM address to a blackhole email that moves all bounces and other incoming messages > /dev/null. But then subscribees cannot reply to the author of the newsletter.

I we can set the mail headers, the FROM can be a real address, that of the newsletter's author/admin, but an additional field in the mail headers would redirect all bounces to another email:

Return-Path: <bounces@example.com>

Once the above is possible, the next (big) step would be a proper handling of bounces: check whatever arrives at the return address, and use cron to automatically (??) unsubscribe all hard bounces.

thank you.
B.

Comments

sstrudeau’s picture

Short answer: no.

See this node for a quick hack to address this particular issue (return-path header): http://drupal.org/node/36102

I suspect this won't be a feature until Simplenews gets ported to the new mail API for Drupal 5.0, assuming DriesK ever finishes his PhD thesis. :)

I'm particularly interested in this since I'd like to use this module, however I really need bounce management. Right now I'm planning to build a very simple adjunct module to handle bounce management (basically, minimally hack Simplenews to add a return-path and the newsletter ID, and possibly use mimemail to send, and then have a module fetch and record the bounces similar to the enewsletter bounce handler).

markhope’s picture

Can the returnpath module help with this, or be adapted?
http://drupal.org/project/returnpath

Mark

voidberg’s picture

See here for a patch for 4.7: http://drupal.org/node/101428

sutharsan’s picture

Status: Active » Closed (won't fix)
broon’s picture

Version: 7.x-1.x-dev » 7.x-2.x-dev

After switching servers and switching from MIME Mail to HTML Mail I ran into a similar problem. The return-path was now always set to the main website address (webmaster@domain.com) instead of the newsletter address (newsletter@domain.com).

One single line changed that (includes/simplenews.source.inc, SimplenewsSourceInterfae::getHeaders(), line 504ff.):

// Add user specific header data.
    $headers['From'] = $this->getFromFormatted();
    $headers['Return-path'] = $this->getFromAddress(); // this is the new line
shortspoken’s picture

Issue summary: View changes

Thanks @Paul Broon. This helped a lot. Although I had to spell the Return-Path with a capital letter. And you can do the same with the "Sender" header, which was also the site default. So my code looks like this:

// Add user specific header data.
    $headers['From'] = $this->getFromFormatted();
    $headers['Return-Path'] = $this->getFromAddress();
    $headers['Sender'] = $this->getFromAddress();
    $headers['List-Unsubscribe'] = '<' . token_replace('[simplenews-subscriber:unsubscribe-url]', $this->getTokenContext(), array('sanitize' => FALSE)) . '>';
Patricia_W’s picture

We had a similar problem after upgrading to Drupal 7.50. Eventually we managed to fix it by switching from Mime Mail to HTML Mail.