I tried to search the net all over for this setting, but no success.
I do not have available a ready made solution for you. I'd expect you to do a little experimentation now and come up with one.
I'm using Qmail and under the same logic philip explained u, I've following points to mention .... You can use qmail and following setting ...
Taken from Qmail - FAQ (reffer urls down)
http://www.qmail.org/man/misc/FAQ.txt
8.2. How do I keep a copy of all incoming and outgoing mail messages?
Answer: Set QUEUE_EXTRA to "Tlog\0" and QUEUE_EXTRALEN to 5 in extra.h. Recompile qmail. Put ./msg-log into ~alias/.qmail-log.
You can also use QUEUE_EXTRA to, e.g., record the Message-ID of every message: run
| awk '/^$/ { exit } /^[mM][eE][sS][sS][aA][gG][eE]-/ { print }'
from ~alias/.qmail-log.
URLS :
http://cr.yp.to/qmail/faq/admin.html#copies You can set up a ~alias/.qmail-log file that decides about keeping a copy of a mail or not depending on anything you want. qmail provides lots of environment variables that may help you:
http://www.lifewithqmail.org/lwq.html#environment-variables
Now explore on your own ... This much information is sufficient for u as a pointer.
Regards, Ranjeet walunj