Subject: | Extra From line inserted |
Mails are being added to my mailbox with two 'From ' lines above the header. I modified Audit.pm to pass $opts{MailFrom} and $opts{Modify} to its Mail::Internet object. MailFrom=IGNORE left one 'From ' line in the output, but it was generated by Mail::Audit::accept, not the original from exim. MailFrom=KEEP puts 2 'From ' lines in the mailbox. The first is generated by Mail::Audit and the second was read from stdin by Mail::Header. I think Mail::Audit does not correctly check to see if it should output a 'From ' line. I've attached a small patch with my changes.
$ exim -bV
Exim version 3.33 #1 built 28-Nov-2001 22:13:21
Mail::Audit::VERSION = '2.0'
Mail::Internet::VERSION = "1.41"
Mail::Header::VERSION = "1.41"
$ perl -v
This is perl, v5.6.1 built for i386-linux
*** /root/.cpan/build/Mail-Audit-2.0/Audit.pm Mon Dec 10 13:52:51 2001
--- local/share/perl/5.6.1/Mail/Audit.pm Sun Jan 6 09:24:28 2002
***************
*** 32,38 ****
my $self = bless({
%opts,
obj => Mail::Internet->new(
! exists $opts{data}? $opts{data} : \*STDIN
)
}, $class) ;
if (exists $self->{loglevel}) {
--- 32,40 ----
my $self = bless({
%opts,
obj => Mail::Internet->new(
! exists $opts{data}? $opts{data} : \*STDIN ,
! (exists $opts{MailFrom}? ('MailFrom' => $opts{MailFrom}) : undef ),
! (exists $opts{Modify}? ('Modify' => $opts{Modify}) : undef )
)
}, $class) ;
if (exists $self->{loglevel}) {
***************
*** 94,100 ****
flock(FH, LOCK_EX)
or _log(1,"Couldn't get exclusive lock on $file");
seek FH, 0, 2;
! if (${$self->{obj}->body}[0] !~ /^From\s/) {
if (exists $ENV{UFLINE}) {
_log(3,"Looks qmail, but preline not run, prepending UFLINE, RPLINE, DTLINE");
print FH $ENV{UFLINE};
--- 96,102 ----
flock(FH, LOCK_EX)
or _log(1,"Couldn't get exclusive lock on $file");
seek FH, 0, 2;
! if ( not $self->{obj}->head()->get('From ') ) {
if (exists $ENV{UFLINE}) {
_log(3,"Looks qmail, but preline not run, prepending UFLINE, RPLINE, DTLINE");
print FH $ENV{UFLINE};