[PLUG] Deleting mail messages in an alpine directory within a shell script

Rich Shepard rshepard at appl-ecosys.com
Sun Sep 17 18:45:09 UTC 2017


   Once a week I manually run sa-learn on the messages in
~/mail/spam-uncaught. Now I'd like to write a cron.weekly script to do this
for me autmagically.

   Changing the pwd to ~/mail/ and executing the command, 'sa-learn --mbox
--spam spam-uncaught' is straight-forward. Deleting the messages processed
by spamassassin while leaving the first alpine-specific message is where I
am not sure of the correct command.

   The alpine message at the top of all mail files is,

>From MAILER-DAEMON Sun Sep 17 11:01:00 2017
Date: 17 Sep 2017 11:01:00 -0700
From: Mail System Internal Data <MAILER-DAEMON at appl-ecosys.com>
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
Message-ID: <1505671260 at appl-ecosys.com>
X-IMAP: 1082321840 0000019491 $Forwarded
Status: RO

This text is part of the internal format of your mail folder, and is not
a real message.  It is created automatically by the mail system software.
If deleted, important folder data will be lost, and it will be re-created
with the data reset to initial values.

   The date-time stamp reflects when I manually deleted each message. If the
script issues 'rm -f ~/mail/spam-uncaught' I think alpine will re-create this
message the next time I save a spam message. It should tell me that the file
(they call 'em folders) does not exist and ask me if I want to create it.

   Is my interpretation/assumption correct?

Rich




More information about the PLUG mailing list