procmail
[Top] [All Lists]

Forward spool on demand?

1998-08-25 16:34:29
I am at a new job where I can't pop3 my private mail right now.
So I am trying to set up a recipe to do the following:

(a) Move my current mail spool somewhere temporary
(b) Use the convention 

        cat mailfile | formail -s sendmail my(_at_)work(_dot_)account

    (or something equally useful) to send the mail now
    sitting in the temporary location

I figure that each time I invoke this recipe (from work) and move the
spool it can overwrite the temporary file I had created from the last
time, if it is still there.

I haven't updated my .procmailrc in a couple of years, so I'm more than
a little rusty.  Of course I have to think about lockfiles, etc., in
doing this.

I also was considering that I keep my .procmailrc readable, and many
look at it.  Someone might spoof me and invoke the recipe.  This is not
so dangerous, though, because it will only send my mail to work.  If I'm
not there, I won't see it until the next time I get to work.  But that
is a not-very-likely scenario anyway.

Here's a stab that I'm a little too afraid to test until I get some
feedback.  (Also, it might not work, because my "procmailese" is so
rusty.):

#  On-Demand Mail Delivery
cd $HOME/.mailbox
             # I think word after last colon in first line is naming
             # convention for local lockfile?  ["dross" is a pun on
             # my work userid and the temporary purpose of the file]
:0 Dh:dross  # D says case-sensitive; I think h says ignore header(?)
* ^From +d(man|ross)@
* ^Subject: +#FWMAIL
| ( mv $ORGMAIL dross;
  cat dross ) | $FORMAIL -s $SENDMAIL dross(_at_)work(_dot_)address

($ORGMAIL, $SENDMAIL and $FORMAIL are defined up-top)

Reactions?  Oh, this is under 3.11 pre 4.  Another consideration: what
will happen if my mail spool is empty when I invoke the recipe?


--
  __                               ___               dman(_at_)netcom(_dot_)com
 (/ \  _   /) /) _ _ _  _    _    (/__) _   _   _    Dante Strasse 53
 /`  )(_(_( _(__/|/|/(_(_(_/| (   / (  (_)_/_)_/_)_  69115 Heidelberg
(___/                          ` (   \               Germany

<Prev in Thread] Current Thread [Next in Thread>