![]() Server : Apache/2.4.52 (Ubuntu) System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 User : www-data ( 33) PHP Version : 8.1.2-1ubuntu2.21 Disable Function : NONE Directory : /usr/share/doc/libmailtools-perl/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;