Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 140650 Details for
Bug 205263
mail-client/smtpclient - add fullheaders patch
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
perl script to redeliver mail
redeliver (text/plain), 1.21 KB, created by
Kristian Kallenberg
on 2008-01-11 00:43:19 UTC
(
hide
)
Description:
perl script to redeliver mail
Filename:
MIME Type:
Creator:
Kristian Kallenberg
Created:
2008-01-11 00:43:19 UTC
Size:
1.21 KB
patch
obsolete
>#!/usr/bin/perl -w > ># Redelivers mail using a modified version of smtpclient ># By: Jens Hilligsoe <gentoo@hilli.dk> > >use strict; > >if(!($#ARGV == 0)) { > die "Usage:\n$0 maildir_mail\n"; >} > >my $mail = $ARGV[0]; >my $to = ""; >my $from = ""; > >sub prunefile ( $ ); > ># Retrive To and From envelope adresses >open (MAIL, $mail) or die "Could not open $mail: $?\n"; >while(<MAIL>) { > if(($to eq "") || ($from eq "")) { > chop; > (my $key, my $value) = split (/:/); > if($key eq "X-Envelope-To") { > $to = $value; > $to =~ s/[\<\>,]//g; # Remove "<", ">" and "," > $to =~ s/^\s+|\s+$//g; #Remove whitespace before and after > } > if($key eq "X-Envelope-From") { > $from = $value; > $from =~ s/[\<\>,]//g; > $from =~ s/^\s+|\s+$//g; > if($from eq "") { > $from = "postmaster"; # Lets see if the works out > } > } > } >} > >if($to eq "") { > prunefile($ARGV[0]); # Just nuke it if to is empty >} else { > my $redelivercmd = "cat $ARGV[0] | smtpclient -F -S 127.0.0.1 -P 10025 -f $from $to"; > unless (system($redelivercmd) == 0 ) { > die "Unable to redeliver: $?"; > } > prunefile($ARGV[0]); # Clean up >} > >sub prunefile ( $ ) { > my ($file) = @_; > unless (unlink $file) { > die "Unable to remove mail: $?"; > } >} >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 205263
:
140648
|
140649
| 140650