Email "Loops" und "Bounces"


Email "loops" and "bounces" are unwanted phenomena that occur when sending or receiving e-mails and can cause mailboxes to overflow.

E-mail loops can occur, for example, when two different email addresses are routed to each other. For example:
customer@company.abc - forwards to → agent@company.xyz
agent@company.xyz - forwards to → customer@company.abc
If an email is sent to customer@company.abc or agent@company.xyz, an e-mail loop is created in which the email is passed endlessly between the two addresses until the respective mailboxes are full and no more emails can be sent.

More critical for the daily work with todo4teams are the so-called email bounces. Bounces can arise through automated feedback on incoming emails, hereinafter referred to as autoresponder emails.
Autoresponder emails are automatically generated on the receiver side, if desired, e.g. with the aim of documenting that an email has been received (in the form of an acknowledgment of receipt) or informing the sender that the recipient is currently unable to process the received e-mail (absence notice).
Also from todo4teams out a kind of autoresponder mail can be sent to e.g. to confirm the receipt of a ticket and to inform the customer of the specific ticket number; see our tutorial on sending automatic responses to emails.

A concrete example of a case of email bouncing in todo4teams:
A customer of the company "ABC" fills out a web form for a maintenance order, specifies as a contact email address "customer@company.abc" and sends the form via the internet. Using a web service the contents are now transferred internally as an email to a mailbox, which is connected to todo4teams and is read by todo4teams so that every incoming email generates a new job.
In todo4teams the corresponding mailbox is now configured so that an autoresponder email is automatically generated and sent to the customer ("customer@company.abc") in order to confirm the receipt of a job.
However, the customer has now set his mail-client in such a way that an automatic acknowledgment of receipt for the mail from todo4teams in the form of an autoresponder mail is sent back to the mailbox in todo4teams.
This will then generate a new job in todo4teams, which will be confirmed by an autoresponder email, to which the customer will respond again with an autoresponder e-mail. ... and so on, until the  mailboxes are full.
Diagram:

emailbounces_en.png

What can you do now to prevent such email bounces?
here is a simple and clean solution here: You should not send such autoresponder emails from todo4teams directly via a mailbox that also sends new outgoing emails when emails arrive. A so-called “no-reply” mailbox has proven to be the standard for this; in the following example it is “no-reply@company.xyz”. Although these are integrated into todo4teams, they are configured so that no initial emails are generated. This immediately eliminates any possibility of an email bounce, even in the event that the customer responds directly with an autoresponder email, since the “no-reply” mailbox does not generate any established emails and therefore dies Bounce chain is broken.

It is also good practice to suppress sending to no-reply mailboxes in the mailboxes in which outgoing emails are sent:

function sendResponseEmail(toemail, subject, text, id)
{
    if (text != null && toemail.indexOf("noreply@")<0 && toemail.indexOf("no-reply@")<0)
     {
         text="<html><head>"+helper.getServerPropertyByName("emailCss")+"</head><body>" +text +"</body></html>";
         helper.sendmail("no-reply@company.xyz", "Re: "+subject+" (ID: "+id+")", text, toemail, null, null, true);
     }
    else
     {
         print("Mail not send!");
     }
}