in reply to Re: MIME::Lite + bouce email address
in thread MIME::Lite + bounce email address

Thanks,
your solution works (the 'Errors-To' header is added) but still I don't get any bounces.

Maybe someone knows other solution (except using 'Errors-To' header) to redirect the bounced emails ...

Thanks!
  • Comment on Re: Re: MIME::Lite + bounce email address

Replies are listed 'Best First'.
Re: Re: Re: MIME::Lite + bounce email address
by iburrell (Chaplain) on Apr 15, 2004 at 20:30 UTC
    The Errors-To header is for Usenet messages. It does not do anything for email.

    The only way to control where bounce messages go is by changing the envelope sender in SMTP. This will be placed in the Return-Path header by the receiving SMTP server. The envelope sender can be different than From: header but this requires more control of the sending process. Most mechanisms will use the From: header by default.

    How are you sending the mail? The sendmail program has a command-line option (-r) to set the envelope sender. The SMTP modules I know, Net::SMTP and Mail::Sender, have ways to specify the envelope sender.

      I can not modify the 'Return-Path' header because is used for authentication. (The emails have attached some PDFs I want to fax so I use a paid fax web service and the 'Return-Path' header is used as account authentication)

      To send the emails I use MIME-Lite (I send html email/with PDF attached) and sendmail:

      MIME::Lite->send('sendmail', '/usr/lib/sendmail -t '); $rez = $msg->send();

      About (-r) option: it's a good sugesstion. I already tried with (-f) option (in man pages seems the same with -r). The problem was I didn't used right. I tried

      $rez = $msg->send_by_sendmail('/usr/lib/sendmail -t -oem -r email. +where.to.bounce@somewhere.com');
      but I should used
      $rez = $msg->send_by_sendmail('/usr/lib/sendmail -t -oem -r \'emai +l.where.to.bounce@somewhere.com\'');
      This is working: The bounced emails are redirected ! but the 'Return-Path' is changed to 'email.where.to.bounce@somewhere.com' and I don't want this !!

      Thanks!

        You don't want to change the Return-Path but when a message gets returned it will go to *suprise* the Return-Path?

        Why not just parse the bounces out using procmailrc just before they hit the return path address? This is primative, see RFFC 1894 for the full details on the 'approved bounce spec'. Don't expect all bounces to follow it though.

        # Redirect bounces to local bounce account :0 * ^Subject.*(Undelivered|Returned).*Mail bounce

        cheers

        tachyon