diff options
author | Jonas Smedegaard <dr@jones.dk> | 2003-06-01 14:22:54 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2003-06-01 14:22:54 +0000 |
commit | a386acafc4233f13ab2ad1ae024c7127334951be (patch) | |
tree | 67a9438a04708043f837a49b9eabf7005fa86914 /userforward | |
parent | 8772aaea563198a99323ff1c16aa624a6aad74c1 (diff) |
Rename mailspool before forwarding it, to make sure noone accidentally works on it simultaneously.
Diffstat (limited to 'userforward')
-rwxr-xr-x | userforward | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/userforward b/userforward index 8479d07..4c5caca 100755 --- a/userforward +++ b/userforward @@ -39,8 +39,9 @@ thismaildomain=`cat /etc/mailname 2> /dev/null || hostname -d` if [ -f $mailspool ]; then if [ -s $mailspool -a -x /usr/bin/formail -a -x /usr/lib/sendmail ]; then - /usr/bin/formail -A "X-Resent-By: postmaster@$thismaildomain" -i "To: $addr" -R Cc: Old-Cc: -R Bcc: Old-Bcc: -s /usr/lib/sendmail -t < $mailspool - rm -f $mailspool + mv $mailspool $mailspool.off + /usr/bin/formail -A "X-Resent-By: postmaster@$thismaildomain" -i "To: $addr" -R Cc: Old-Cc: -R Bcc: Old-Bcc: -s /usr/lib/sendmail -t < $mailspool.off + rm -f $mailspool.off echo "Old incoming mails forwarded to new account." else echo "OBS! Old incoming mails not forwarded." |