- Patrick Paysant <[EMAIL PROTECTED]>:
| Now, what I want to do is to forward the mails if they are
| not read after one hour (for instance).
| I'm not sure it is clear, so here is an example :
|
| Mail #1 arrive at 9H00AM to Joe.
| Joe is not here today.
| I want that this mail to be forwarded at 10h00AM
| to Bill.
|
| Is there any program doing that ?
Nothing in the standard qmail distribution, or anywhere else that I
can think of. But qmail makes it easy for you, if you can use maildir
format: Have Joe run a cron job, say once every 15 minutes, that
looks for messages in Maildir/new older than one hour. Any such
messages are forwarded and then moved elsewhere (so they don't
forwarded again). A simple shell script should do the job:
#!/bin/sh
find Maildir/new -type f -mtime +1 -print |
while read m; do
/var/qmail/bin/qmail-inject -a bill && mv $m Forwarded/new
done
The forwarded message should inherit the original's envelope sender
(picked up from the Return-Path field). Override with -f if you
prefer. You should also be aware that qmail-inject does some error
checking and header processing that is not totally appropriate for
mail forwarding. In particular, if the incoming mail has syntax
errors in the headers (not an unheard of situation) the above script
will fail. A better solution might be to use forward, but then you
have to set up the environment variables that forward expects, so this
is harder to do.
- Harald