Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to avoid mail loop? 1

Status
Not open for further replies.

TonyGroves

Programmer
Aug 13, 2003
2,389
IE
I'm writing a script to send an auto-response to each e-mail received into a user's mailbox when he/she is away, but am conscious of the need to avoid creating a mail loop. For example, if the auto-response message gets bounced, I don't want to issue another auto-response. However, I'm really stuck for ideas about how to handle this. I've thought about inserting a special header into each auto-response message, and checking for its presence before auto-responding again, but that doesn't sound very foolproof as the header might get stripped.

Does anybody know of any well-established simple but effective methods to tackle this problem?

Thanks a lot.

Tony.


(P.S. I don't mean to cross-post but I haven't got any reply 24h after posting in the Postfix forum)
 
What do you mean with 'when he is away'?
Immeadeately when not logged in?

I don't think that's a good idea, and you already found out why.
If a user is away for several days, an message might make sense. How about sending it after a delay of x*24 hours?

seeking a job as java-programmer in Berlin:
 
What about creating a log file, where you store the email addresses of all those users who already got an auto-response? Send the auto-response only once to any user, no matter how many mails you get from them. This will make sense, if the auto-reply includes a date range, how long the user will be absent.
And the user may delete this log file when setting up another auto-response later on.

regards
 
Thanks for those replies!

stefanwagner:
I mean when the user has recorded the fact that he's away on holidays and wants an auto-response sent for each e-mail received.

hoinz:
That sounds like a good idea. I'll have to look into the fine details of how to implement that, especially since the users are non-technical and would have difficulty appreciating the significance of a log file. A good solution might be for the log-file entries to be kept for only one hour, which should be plenty of time to handle any bounces.
 
Glad it helped,
thanks for the star!

And yes, keeping log-file entries for a certain time only seems a good idea, as it won't cause any harm in those cases when a user is going to be absent for a long time, but doesn't tell this duration in the auto-response.

regards
 
Update:

I found the "vacation" program which is included in Debian. You pass it the incoming message and the path to the auto-response text file and it will decide, based on its log file and other sensible criteria, whether or not to send a response.

It's nice to see the work has been done already.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top