From: short <> Date: Sun, 6 Oct 2002 22:13:55 +0000 (+0000) Subject: =input is now written as raw data w/o any Mail::Audit reformatting X-Git-Tag: bp_lace~102 X-Git-Url: http://git.jankratochvil.net/?p=PerlMail.git;a=commitdiff_plain;h=ec7d34da4cccb27afe64d488bb0ee67a9d64a957 =input is now written as raw data w/o any Mail::Audit reformatting - My-Audit.pm no longer writes =input --- diff --git a/My-Audit.pm b/My-Audit.pm index 20ffb81..c81515e 100644 --- a/My-Audit.pm +++ b/My-Audit.pm @@ -23,11 +23,6 @@ sub audit_init sub audit { - { - local $store_ignorenewmail=1; # no reason now, just a paranoia - store "=input","btw"; - } - # TODO: storage? # never spawn new mail if FROM_MAILER diff --git a/perlmail-accept b/perlmail-accept index 09bdc03..f241d9c 100755 --- a/perlmail-accept +++ b/perlmail-accept @@ -555,6 +555,21 @@ my($funcref,@funcargs)=@_; return @AuditStored!=$did_last; } +sub write_message +{ +my($folder)=@_; + + local $_; + local *F; + open F,">>$folder" or do { warn "Append \"$folder\": $!"; return 0; }; + do { warn "Lock \"$folder\": $!"; return 0; } if $_=Mail::Audit::audit_get_lock(\*F,$folder); + seek F,0,IO::Handle::SEEK_END or warn "Seek-end \"$folder\" (ignoring): $!"; + # No 'need_from' here although it is a bit risky to rely on our network peer + print F $Message,"\n" or warn "Write to \"$folder\": $!"; + close F or warn "Close \"$folder\""; + return 1; # some attempt was made, FIXME: proper error detection +} + sub process { my($message)=@_; @@ -568,6 +583,7 @@ my($message)=@_; ); local @AuditStored=(); do { smssend $opt_smstest; return; } if $opt_smstest; + write_message("$Mail/input"); audit(); warn 'Corrupted $_, repaired' if defined($save_)!=defined($_) || (defined($_) && $save_ ne $_); }