Friday, April 5, 2002 07:53 AM
I understand that MTA approach works better as it is more reliable.
I would suggest that if at all possible, you do use a built-in "vacation" or "out of office" auto-responder in your MTA for the given user, rather than trying to re-implement the wheel yourself.
Also to do it right you need access to the SMTP envelope fields. Especially you need the "MAIL FROM", which is not the same as the "From:" or "Reply-To:" headers! Also other fields, the "RCPT TO's", possibly many of them, all to different local recipients for the same incoming message, if there are DSN parameters on them, for instance.
The MTA is the right place for this, before the message is dropped off to a local delivery system (what if the user's local mailbox gets full, before they return? then the MTA is the only place that will even know about, and could possibly respond to, new incoming messages).
Otherwise you have to learn all the applicable RFC's, and deal with a lot of tricky issues (study the way that Unix "vacation" works, and some sample "Procmail" scripts, and the Microsoft Exchange/Outlook (there is one that works server-side, one that works client-side) "Out of Office" auto-responders work), to avoid becoming a danger to the Internet -- a bad auto-responder can mailbomb other systems elsewhere on the Internet! Malicious people one one system can even use a bad auto-responder on another system, as a tool for attacking still other systems.
You need to NOT auto-respond to certain kinds of incoming messages -- if the incoming message is some kind of auto-response itself, you need to avoid getting into an infinite auto-response loop.
Following the RFC's, you need to determine if the incoming SMTP envelope MAIL FROM sender field is either null ("<>") or "MAILER-DAEMON" or some other variations indicating that it is some kind of DSN (Delivery Status Notification) -- you must NOT reply to DSN's.
Also you should keep a database like Unix "vacation" does, of who you have already auto-responded to, so no one sender will get more than one auto-response from you, in a set period of time, say no more than one per week, regardless of how many times they send you email in that week.
Etc. Sorry to be touchy on this but I was the Internet Postmaster for a couple of large Universities and a research company, for a long time during the 1980's and 1990's, and so I used to have to deal with these kinds of problems.