Blacklisting of emails
The general problem with unwanted emails
Sometimes public e-mail addresses, such as info @ ... or contact @ .... will generate a high volume of unwanted emails in companies. The incoming emails are highly heterogeneous, besides the classical spam you can possibly experience promotional emails etc.. In the periods of high email traffic this may cause a heavy burden to the team in charge of the e-mail processing, since in each case a new job in todo4teams with such an incoming email is generated.
Objective
In order to relieve the employees from the flood of unsolicited e-mails, you can block emails in todo4teams based upon the mail-address. Thus the incoming emails must be identified, the generated jobs selected and thereby incurred tickets will be closed automatically as a result without a user having to intervene manually. The steps are as follows:
Step 1: Definition of a system parameter
First you define the email addresses that you want to block within server property. Please define a system parameter "BLACKLIST_EMAILS". This one carries a list of blocked emails; the substring of the e-mail address, which identifies unwanted e-mail (in the example "noreply @"), is sufficient in this context:
hans.beispiel@test.de
noreply@
Step 2: Finish the generated tickets directly at the incoming of an unwanted email
For this purpose the in step 1 defined system parameter is evaluated and the affected tickets, that have been generated from unsolicited email, will be directly closed in the incoming action of the relevant mailbox. The following Java Script performs this through the system parameter "BLACKLIST_EMAILS":
var blacklistproperty = helper.getServerPropertyByName("BLACKLIST_EMAILS");
// Ist die Servereigenschaft für Blacklist-Mails gesetzt
if (blacklistproperty != null)
{
// Erzeuge Liste der zu blockenden E-Mails
var blacklists = blacklistproperty.toLowerCase().split("\n");
// Ist die Servereigenschaft für blacklist-Mails gesetzt?
for(var i = 0; i<blacklists.length; ++i)
{
var blacklist=blacklists[i].trim();
println("Prufe Absender "+ from+" gegen Blacklist "+blacklist);
// Enthaelt der Absender den zu blockierenden Eintrag?
if (blacklist.length()>0 && from.contains(blacklist))
{
println("Todo mit der id "+task.getId()+ " wurde als blacklist automatisch geschlossen.");
task.startWorking();
task.setDoneComment("Als blacklist erkannt.");
task.finishWorking(true);
}
}
}