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.
This can be prevented by special measures that most mail servers have, so that in general email loops are detected and interrupted.
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 e-mail 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 job and to inform the customer of the specific job 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 respective mailboxes are full.
Diagram:
What can you do now to prevent such email bounces?
There is a simple and clean solution here: You should not send such autoresponder mails from todo4teams directly via the incoming mailbox, but instead set up a separate mailbox for these purposes. The general solution for this is a so-called "no-reply" mailbox, in the following example this is "no-reply@company.xyz". Although this mailbox is integrated in todo4teams, it is configured in a way that incoming mails do not generate new jobs.
Now, if the autoresponder email from todo4teams is sent via this "no-reply" mailbox, any possibility for an email bounce is immediately suppressed, even in the event that the customer now replies directly with an autoresponder email, because the "no-reply" -mailbox does not create any jobs in todo4teams and thus the bounce-chain is interrupted.
You can do this as follows, provided you have already set up such a "no-reply" mailbox.
In the income-action of the mailbox you now define with the following javascript code that reply mails will be sent via this "no-reply" -mailbox ("no-reply@company.xyz") and not via the inbox. Please adjust the parameters according to your specific needs.
{
if (text != null && (responseSuppress==null || responseSuppress.length==0) && 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, mbox, true);
}
else
{
print("Mail not send!");
}
}
This code snippet additionally ensures that mails that incoming mails from "noreply@" or "no-reply@" addresses do not even create new jobs in todo4teams.