From: unknown Date: Tue, 23 Mar 2010 15:31:45 +0000 (-0500) Subject: Import version as of 2010-03-23 for upload-ftp-v1.1.pl X-Git-Tag: 20200730__import~30 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=549d2ce5f9ddd12250e34b187f817879bf500750;p=gatekeeper.git Import version as of 2010-03-23 for upload-ftp-v1.1.pl --- diff --git a/upload-ftp-v1.1.pl b/upload-ftp-v1.1.pl index 0b59d18..8df14a8 100755 --- a/upload-ftp-v1.1.pl +++ b/upload-ftp-v1.1.pl @@ -95,6 +95,7 @@ use Date::Manip; use Sys::Syslog qw(:DEFAULT setlogsock); use Getopt::Long; use Text::Wrap; +use POSIX qw(strftime); use Email::MessageID; umask (022); @@ -262,7 +263,6 @@ sub archive { # Abort if file to archive doesn't exist &fatal("$subdir/$file does not exist - can not archive",1) if (!-e "$destfinal/$subdir/$file"); - use POSIX qw(strftime); my $timestamp = strftime "%Y-%m-%d_%H-%M-%S", localtime; $timestamp .= sprintf("_%09d",rand(1000000000)); # Add a large random number for good measure # Abort if a file with same name exists in the archive @@ -1146,11 +1146,12 @@ sub mail { $smtp->recipient (@email_list, { SkipBad => 1}); $smtp->data (); - $smtp->datasend ("To: " . join (", ", @email_list) . "\n"); - $smtp->datasend ("From: $sender\n"); - $smtp->datasend ("Reply-To: ftp-upload\@gnu.org\n"); + $smtp->datasend ("To: " . join (", ", @email_list) . "\r\n"); + $smtp->datasend ("From: $sender\r\n"); + $smtp->datasend ("Reply-To: ftp-upload\@gnu.org\r\n"); my $mid = Email::MessageID->new; - $smtp->datasend("Message-ID: $mid\n"); + $smtp->datasend("Message-ID: <$mid>\r\n"); + $smtp->datasend("Date: " . strftime("%a, %b %e %Y %H:%M:%S %z", localtime) . "\r\n"); if ($subject ne '') { $smtp->datasend ("Subject: [gnu-ftp-upload] $subject"); ftp_syslog('info', "($log_style) Subject: '$subject'");