![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /usr/share/doc/perl-MailTools-2.12/examples/ |
#!/usr/bin/perl -w use Mail::Internet; @mail = <>; $mail = Mail::Internet->new(\@mail); $mail->remove_sig; $mail->tidy_body; @reply = (); if(open(HDR,"$ENV{HOME}/.mailhdr")) { @reply = <HDR>; close(HDR); } $rply = Mail::Internet->new(\@reply); $subject = $mail->get('Subject'); $rply->replace('To', ""); $rply->replace('Cc', ""); $rply->replace('Subject',$subject); $rply->body($body = $mail->body); unshift @{$body},"---------- Begin Included Message ----------\n"; push @{$body},"----------- End Included Message -----------\n"; $file = "/tmp/reply.$$"; open(FILE,">$file") || die "Cannot open $file:$!\n"; $rply->print(\*FILE); close(FILE); $editor = $ENV{"EDITOR"} || "/usr/bin/nvi"; warn "$editor :$!\n" if (system("$editor $file")); unlink($file,$file . '%'); exit 0;