in reply to Mail::Audit and time sensitivity
You could do something like:
unless (time % 5) { (forward mail) }
The percent is the modulus operator, which gives the integer remainder of the divisor. 6 % 5 is 1. 12 % 5 is 2. 10 % 5 is 0. As time() is delivered in seconds since the epoch, you can see if it is divisible by 5 (every 5 seconds). If it is, you do something with it.
Alternately, you could put the whole thing in a loop:
while (1) { sleep 5; (forward mail) }
But you'll probably want some kind of monitoring service to check to make sure your daemon is still alive and running.
Of course, if your purpose is simply to forward all mail from an inbox to a particular address, you don't need to use perl for that. More than likely, you could just use your MTA software.
Sendmail uses .forward files. You can use procmail rules to forward mail. Qmail uses .qmail files. (I'm not familiar with Postfix, but I'm sure there's a way to do it there, too.) check with your service provider.
|
|---|