Experimenting? Make Backups!

While you're setting up mhook programs, as you're changing the setup later, or any time you aren't sure that things are working right, it's a good idea to make backup copies of all your incoming mail. Periodically, check your backup mail to be sure you've gotten all the messages you should. Then remove the backup.

If you have access to a second account, forward a copy of all your mail to it. My main account is jerry, but I also have a jerrytst account. My system runs sendmail, so I make a .forward file like this on my jerry account:

    jerrytst, "| /x/y/slocal -user jerry"
    
If you don't have a second account, you can use a .forward file that makes a copy in a file somewhere on your account. The file may need to be world-writable (mode 666 or 622), though, and that can be a security hole. The following .forward file copies all incoming mail to a file named mail.bak in my home directory:
    /home/jerry/mail.bak, "| /x/y/slocal -user jerry"
    
A third choice: have sendmail drop a copy of the message into your system mailbox before (or after) it runs slocal. It's simple to set up but it's also a little messy because your mailbox may get two copies of a lot of messages. Put a backslash before your username to prevent reforwarding of the copy:
    \jerry, "| /x/y/slocal -user jerry"
    
An easy way to clean out your backup mail file is by copying the system "empty file" onto it. For example, on the jerrytst account, I type:
    % scan -file /usr/spool/mail/jerrytst
            ...Check scan listing of my backup mail...
    % cp /dev/null /usr/spool/mail/jerrytst
    
Are you sure that slocal is working but uncomfortable that your .maildelivery file may be losing messages? If you aren't sure, add an entry to file a copy of all messages into a folder:
    *  -  ^  R  "/x/y/rcvstore +DELETE"
    
scan through your DELETE folder whenever you're looking for missing mail. Remember to clean it out with rmm or an automated script (see the Section Periodic Cleanup, Checking, etc. with cron and at for an introduction and examples).