Re: Want to resend but set envelope From

[email protected] Sat, 3 Jan 2004 06:01:05 -0600
Newsgroups gmane.comp.lang.perl.modules.mail-audit
Message-ID <[email protected]>
The following hack enables me to set the envelope which then means
that the Orange alerts will correctly identify the From that I want

sub resend         {
    my $self = shift;
    my $local_opts = {}; $local_opts = shift if ref($_[0]) eq "HASH";
    my $rcpt = shift;
    my $from = shift;

    if (defined($from)) {
      $self->smtpsend(MailFrom => $from, To => $rcpt)
    } else {
      $self->smtpsend(To => $rcpt);
    }

    unless ((exists $local_opts->{noexit}
             and    $local_opts->{noexit})
            or $self->{_audit_opts}->{noexit}) { _log(2,"Exiting with status
DEL
IVERED = ".DELIVERED); exit DELIVERED; }
}


Quoting [email protected]:

> So interestingly enough I'm using orange.net for mobile alerts and I'm
> resending messages using Mail::Audit.
> 
> Despite the fact that their web based email shows the original From: of the 
> message and not the From used in the envelope of the forwarder their email
> alerts that they sent to the phone itself show From as the From from the
> envelope instead of the From: header of the message I'm resending. Thus
> every alert has ME as the From: which is pointless.
> 
> So, I would like to be able to set the From for the envelope in resend
> 
> Now Mail::Internet allows you to pass options to smtpsend and it
> specifically
> looks for
> 
> 
>     my $envelope = $opt{MailFrom} || mailaddress();
> 
> I don't think resend allows you pass this option thru though it just 
> sets the To in the envelope.
> 
> 
> 
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
> 
> 
> _______________________________________________
> mail-audit mailing list
> [email protected]
> http://lists.netthink.co.uk/listinfo/mail-audit
> 




----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.