procmail
[Top] [All Lists]

Re: Sending later

1997-05-07 02:28:00
On Wed, 7 May 1997 09:29:23 +0200 (MET DST),
Bernard El-Hagin <sokrates(_at_)sound(_dot_)eti(_dot_)pg(_dot_)gda(_dot_)pl> 
wrote:
 Is it possible for procmail to send mail automatically at a later date
set by me? 

Invoking Procmail on outgoing mail is not a standard thing to do and
the solution will depend on how you do that. Let's assume you just
send yourself a message with the string LATER in the Subject, and the
real headers of the message to actually send later are immediately at
the beginning of the message body.

Then you could do this:

    :0b
    * ^Subject: LATER$
    | sleep 50000 ; $SENDMAIL $SENDMAILFLAGS -t

This is just a "proof of concept" and not very useful in itself, of
course. The b flag makes Procmail feed only the body of the message to
the pipeline, and Sendmail will then take the first lines of the body
for a header instead.

(You probably want to code in the time it is to be sent, or do you
intend to just batch send all mail at some particular time? You should
do a check that the message is really from yourself, to prevent abuse
and embarrassing incidents. Perhaps you'd want to make sure it doesn't
get invoked recursively, although that's of limited importance.
"sleep" is probably not the optimal mechanism for the delay :-)
Etcetera.)

I'm not sure there is not an option in Sendmail to do this in a much
simpler fashion, or something ...

Hope this helps,

/* era */

To avoid misunderstandings, here's an example message you'd want sent
to this list at a later date:

    From you
    Subject: LATER
    Date: Wed, 7 May 1997 09:29:23 +0200 (MET DST)
    From: Bernard El-Hagin 
<sokrates(_at_)sound(_dot_)eti(_dot_)pg(_dot_)gda(_dot_)pl>
    Message-Id: 
<you(_dot_)could(_dot_)have(_dot_)already(_dot_)won--scratch(_dot_)here(_at_)sound(_dot_)eti(_dot_)pg(_dot_)gda(_dot_)pl>
    To: sokrates

    From: Bernard El-Hagin 
<sokrates(_at_)sound(_dot_)eti(_dot_)pg(_dot_)gda(_dot_)pl>
    To: procmail(_at_)informatik(_dot_)rwth-aachen(_dot_)de (those jolly 
fellows)
    Subject: I am sending this later

    Hello, 

    Body of message goes here

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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