use Sys::Syslog qw(:DEFAULT setlogsock);
use Getopt::Long;
use Text::Wrap;
+use POSIX qw(strftime);
use Email::MessageID;
umask (022);
# 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
$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'");