in reply to MIME::Lite + bounce email address

It is not supported by MIME-Lite by default because the mail transport standards dictate that error reports should go the the envelope from. Errors-To is not a known or valid email header according to standards, and mail transport systems are under no obligation to do anything at all with them.

If you want to make MIME-Lite send that header just call it 'Errors-To:' (ie add a :) and MIME-Lite will add the header. It will probably only work some of the time though for the reasons noted above.

use MIME::Lite; my $msg = MIME::Lite->new( From => 'from', Reply-To => 'replyto', To => 'email', 'Errors-To:' => 'errors', Subject => 'Errors to header', Data => 'Add a :' ); print $msg->as_string; __DATA__ Content-Disposition: inline Content-Length: 7 Content-Transfer-Encoding: binary Content-Type: text/plain MIME-Version: 1.0 X-Mailer: MIME::Lite 3.01 (F2.6; B2.12; Q2.03) Date: Thu, 15 Apr 2004 12:56:05 UT From: from To: email Errors-To: errors Subject: Errors to header Add a :

cheers

tachyon

Replies are listed 'Best First'.
Re: Re: MIME::Lite + bounce email address
by marynella (Novice) on Apr 15, 2004 at 14:25 UTC

    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!
      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!