develooper Front page | perl.perl5.porters | Postings from April 2003

[perl #21961] Mail script [ overriding Return-Path]

From:
raghu
Date:
April 14, 2003 14:39
Subject:
[perl #21961] Mail script [ overriding Return-Path]
Message ID:
rt-21961-55128.17.1125371193462@bugs6.perl.org
# New Ticket Created by  raghu 
# Please include the string:  [perl #21961]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=21961 >


Hi,

    I am using perl script for email & i am using 
sendmail unix command.

    In that i want to change Return-Path using my perl
script,so my question is it possible?.

    SCRIPT

     $MAIL = spopen('w', $sendmail, "-tf", $from,
$to); 
     print $MAIL "From: $from\n";
    print $MAIL "To: $to\n";
    print $MAIL "From: $from\n";
    print $MAIL "Return-Path:$returnpath\n";
    print $MAIL "Subject: test\n";
    print $MAIL "$BODY"\n";
   close($MAIL);

sub spopen {

        my ($type, @cmd) = @_;
        my $fh = gensym;

        if ($type eq 'r')       { $type = '-|' }
        elsif ($type eq 'w')    { $type = '|-' }
        else {
                #die "invalid spopen mode $type";
                return undef;
        }

                        my $pid = open $fh, $type;
                        #defined $pid;
                        if (!$pid )
                        {
                                local $^W;
                                $ENV{"PATH"} = "";
                                exec { $cmd[0] } @cmd
or die"Can't exec $cmd[0]: $!";
                        }
                        wantarray ? ($fh, $pid) : $fh;
}



    above script will change Return-Path??

  Please let me know ASAP?

Thanks
Raghu

__________________________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
http://tax.yahoo.com




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About