6

I have a mail server X which acts as a middle man between the customers (A) of our feedback applet, created to be used in their websites, and customers (B) of our customers.

So, whenever B sends an email to A, it goes via X, where we decorate the same so as to give it a specific look. We have a specific method of forwarding the same, wherein we attach an ID to each message going through the server.

Problem: Infinite loops are being created if both A and C have automatic responses on.

How can the same be prevented?

Solutions thought of so far:

  1. Maintain a dictionary of plausible words that can be used in "Away" methods.

    Problem: Not exhaustive.

  2. Not allowing more than 'X' messages between 2 parties in one day.

    Problem: Limits legitimate usage.

5
  • en.wikipedia.org/wiki/Email_loop#Prevention
    – Bob
    Jan 3, 2013 at 15:11
  • Which mail server are you using? Any solution would be implementation-specific to the functionality of the mail server and the operating system. Jan 3, 2013 at 15:13
  • 1
    I like this question... would be a great candidate for ServerFault
    – Bigbio2002
    Jan 3, 2013 at 15:13
  • Could you change the auto respond emails to come from noreply@[yourdomain.com]?
    – rtf
    Jan 3, 2013 at 15:25
  • any vacation autoresponder that sends more than one email to any individual address per day is breaking the internet and should be blocked by any means neccessary
    – user313114
    Jan 19, 2017 at 2:35

3 Answers 3

2

Not allowing more than 'X' messages between 2 parties in one day.

Almost right, now consider how fast automatic responses happen as opposed to legitimate messages; if you implement a flood limit, you will allow typical messages while not allowing rapid flooding because of automatic responses.

So, set up "X messages per Y minutes" or something along those lines.

2

in addition to the "limit x amount of messages in y amount of time per address" there are a few indicators that a message is automatically generated and should therefore probably not be forwarded.

check for example the following headers (and SET THEM in your mail forwarder as well, so well behaving out-of-office implementations don't even reply to your application)

precedence: bulk/list/junk
x-precedence: bulk/list/junk
auto-submitted: auto-replied
X-Auto-Response-Suppress: ALL/DR/NDR/RN/NRN/OOF/AutoReply
x-autoresponse

also, some out-of-office implementations do not use the user email as envelope sender but something like postmaster@ or the null sender.

I listed a few more indicators in this stackoverflow question but I'm not sure they apply in your case.

2
  • what does x-autoresponse on the last line mean? it appears to be a syntax error.
    – user313114
    Jan 19, 2017 at 2:27
  • The above list is not meant to be code, it's just a list. In the first four examples the header value is important, but for the last one gerally means that the message is a automated response, regardless of the header value.
    – Gryphius
    Jan 19, 2017 at 6:18
1

More information would be great, but in the absence of that I will assume you can do whatever you please. I'm also going to assume that these auto-replies quote the message they respond to.

As such, assuming your volume and computing power allow this, why not look for repeated responses in the ABAB pattern? That is, if you see the following, bounce it back with a kind message saying that the similarity of responses is like that generated by automatic responses:

From: Adam
Sent: Wednesday, January 03, 2013 9:10 AM
To: Box Co
Subject: RE: That thing

I'm on vacation and will get back to you on January 10.
-Adam

From: Box Co
Sent: Wednesday, January 03, 2013 9:11 AM
To: Adam
Subject: RE: That Thing

We are closed in order to observe the Tamaseseri Festival and will return tomorrow.
Box Co
Where the boxes are best!

From: Adam 
Sent: Wednesday, January 03, 2013 9:10 AM
To: Box Co
Subject: RE: That thing

I'm on vacation and will get back to you on January 10.
-Adam

From: Box Co
Sent: Wednesday, January 03, 2013 9:08 AM
To: Adam
Subject: RE: That Thing

We are closed in order to observe the Tamaseseri Festival and will return tomorrow.
Box Co
Where the boxes are best!

From: Adam 
Sent: Wednesday, January 03, 2013 9:07 AM
To: Box Co
Subject: That thing

Do you have that thing I put in the box?
-Adam

Do something along the lines of /\nSubject.*\n([.\n]*?)\nFrom/ to find what each party sent to each other and compare for sameness in the ABAB pattern. You'll have to remove the effects of auto-indenting etc.

This is not a simple solution, but I believe that it could be made to work and should minimize false positives and false negatives.

You must log in to answer this question.