1

Topic: Adding custom tags on E-mail Headers

==== Required information ====
- iRedMail version: iRedAdmin-Pro-LDAP-1.8.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Centos 6.3
- Related log if you're reporting an issue:
====

Hi we would like to use BULK E-mail marketing for one of our domains. SPF record and DKIM are set also working fine. But E-mails are dropping in SPAM at user end.

Upon Googling one of the help post of Google suggests: (https://support.google.com/mail/bin/ans … thirdparty)

All bulk messages you send must be formatted according to RFC 2822 SMTP3 standards and, if using HTML, w3.org standards.
Messages should indicate that they are bulk mail, using the 'Precedence: bulk' header field.
Attempts to hide the true sender of the message or the true landing page for any web links in the message may result in non-delivery.
The subject of each message should be relevant to the body's content and not be misleading.

I would like to know how can we add customer tags in E-mail headers so that E-mails are not treated as SPAM.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Adding custom tags on E-mail Headers

Try Postfix parameter header_checks. References:
- http://www.postfix.org/postconf.5.html#header_checks
- http://www.postfix.org/header_checks.5.html

You need to filter sender address, then use action PREPEND to insert the header you need. Here's an example, but i didn't test it, please test it yourself before applying on production server.

*) In postfix main.cf:

header_checks = pcre:/etc/postfix/header_checks

*) In /etc/postfix/header_checks:

# Filter mail header 'From:' which contains email address @domain.com, and insert (PREPEND) required new header.
/^From:.*@domain.com.*/i PREPEND Precedence: bulk

3

Re: Adding custom tags on E-mail Headers

Thanks zhang,

adding tags in headers working fine but still the E-mails are going in SPAM, I don't know whats the issue as SPF, DKIM and Header tag everything is fine in E-mail.

4

Re: Adding custom tags on E-mail Headers

ketan.aagja wrote:

still the E-mails are going in SPAM

We have to figure out why it was going in SPAM first. Is there any related info in mail header of the email which going into SPAM? If you're not sure, please post all mail headers here to help troubleshoot. Replace sensitive info before posting.

5 (edited by ketan.aagja 2012-11-19 23:21:43)

Re: Adding custom tags on E-mail Headers

Hi Zhang,

Here is the header:

Delivered-To: myid@gmail.com
Received: by 10.147.17.16 with SMTP id u16csp466636yai;
        Wed, 14 Nov 2012 10:42:55 -0800 (PST)
Received: by 10.66.85.66 with SMTP id f2mr230462paz.56.1352918575527;
        Wed, 14 Nov 2012 10:42:55 -0800 (PST)
Return-Path: <myuser@mydomain.com>
Received: from mydomain.com ([xx.xxx.xxx.xx])
        by mx.google.com with ESMTP id bc7si19341496pab.123.2012.11.14.10.42.54;
        Wed, 14 Nov 2012 10:42:55 -0800 (PST)
Received-SPF: pass (google.com: domain of myuser@mydomain.com designates xx.xxx.xxx.xx as permitted sender) client-ip=xx.xxx.xxx.xx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of myuser@mydomain.com designates xx.xxx.xxx.xx as permitted sender) smtp.mail=myuser@mydomain.com; dkim=pass header.i=mydomain.com
Received: from localhost (myserver.com [127.0.0.1])
    by mydomain.com (Postfix) with ESMTP id A03072C15BD
    for <myid@gmail.com>; Wed, 14 Nov 2012 18:42:53 +0000 (GMT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=
    mydomain.com; h=content-type:content-type
    :content-transfer-encoding:mime-version:x-mailer:message-id
    :subject:subject:from:from:precedence:to:date:date; s=dkim; t=
    1352918573; x=1355510573; bh=74nadMY5tTFftdmBjr+E9YCBzg65mSHlZxV
    TX9fahus=; b=i/Afv6tXb9lpgz83E7hrsvsb+UWAtaDAFLqcPHLwM83bFmziiYl
    3DD8glfEQVlY2dFuTbnEL1RUoYot9ceO+E8TEiCO8OpmJN3rtnTUzt/ydSUPzY1r
    cehaRgkIZfWgDxWnWgqH9ykqxUOs2NpYJ5izmrQc+ojC9k4oaINqVOPU=
X-Virus-Scanned: amavisd-new at mydomain.com
Received: from mydomain.com ([127.0.0.1])
    by localhost (mydomain.com [127.0.0.1]) (amavisd-new, port 10024)
    with ESMTP id GwkXze0ITcTq for <myid@gmail.com>;
    Wed, 14 Nov 2012 18:42:53 +0000 (GMT)
Received: from 172.16.1.42 (unknown [172.16.1.42])
    by mydomain.com (Postfix) with ESMTPA id 145F92C1602
    for <myid@gmail.com>; Wed, 14 Nov 2012 18:42:24 +0000 (GMT)
Date: Wed, 14 Nov 2012 18:42:12 +0000
To: myid@gmail.com
Precedence: bulk
From: myuser <myuser@mydomain.com>
Subject: deals
Message-ID: <c2ba9b38dec985df2ef0842999f22645@172.16.1.42>
X-Priority: 3
X-Mailer: PHPMailer [version 1.72]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/html; charset="UTF-8"

6

Re: Adding custom tags on E-mail Headers

I cannot figure out why it was detected as spam with pasted mail header. sorry.