On Fri, Apr 12, 2002 at 03:13:31PM -0500, Adam Rice wrote:
> 1. More a suggestion than question: As an end-user, it would be nice 
> if I could add to my user_prefs file by sending myself an e-mail 
> message that got munched by procmail. Perhaps something with a 
> subject line consisting of "spamassassin user_prefs [password]" 
> (where password would match something coded into the procmail 
> recipe), and the body consisting of new lines to add. I realize this 
> would be a non-trivial undertaking.

Not really a SpamAssassin issue, but ...  The procmailex man page has
half of this for the most part:

              :0
              * ^Subject: send file [0-9a-z]
              * !^X-Loop: [EMAIL PROTECTED]
              * !^Subject:.*Re:
              * !^FROM_DAEMON
              * !^Subject: send file .*[/.]\.
              {
                MAILDIR=$HOME/fileserver # chdir to the fileserver directory

                :0 fhw                   # reverse mailheader and extract name
                * ^Subject: send file \/[^ ]*
                | formail -rA "X-Loop: [EMAIL PROTECTED]"

                FILE="$MATCH"            # the requested filename

                :0 ah
                | cat - ./$FILE 2>&1 | $SENDMAIL -oi -t
              }


This will return the given requested file to the email sender.  You can
hack it down for only the user_prefs file.  You'd want another rule that
stores a message in the user_prefs file.  Something like:

:0b
* ^Subject: user_prefs update
* !^X-Loop: [EMAIL PROTECTED]
* !^FROM_DAEMON
| mv -f $USERPREFS $USERPREFS.old && cat - > $USERPREFS

You could get creative and make it run multiple commands, one pipes
to the user_prefs file.  The next one waits for the first to complete
then rewrites the Subject appropriately and passes to the "send file"
one above.  Get a verification that the update took place correctly. :)



I should probably write up a proper version of this for work -- SA is
installed, but there's no access to the home directory on the mail server,
so I have no way to update the preferences file.  Hmmm.

-- 
Randomly Generated Tagline:
"... the difference between contractors and consultants is that
 contractors augment staff while consultants solve problems."    - Unknown

_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to