Comment: Last mail not saved (Score 1) on 2009.11.09 14:20
if ( length( $message ) > 0 ) {
$message_count++;
$file = $file_base . sprintf( "%02d", $file_i );
#print "Got message # $message_count - appending to $file...\n";
if ( $need_to_write_init ) {
#write_initial_msg( $file );
$need_to_write_init = 0;
}
open( SPLIT, ">>$file" ) || die "Cannot append to $file: $!";
print SPLIT $message;
close( SPLIT );
}
to a function called save_msg and calling it where the code was, and ALSO before
close( MBOX );
Note that I'm ignoring the variables scope, since I'm in a hurry, but I shouldn't have.
Feel free to ask if you want me to post my script.
Ely.
