Bounces management with sendmail and enterprise mail server

Use this forum for all questions related to bounce management of OpenEMM

Moderator: moderator

carlo.dambrosio
Posts: 10
Joined: Sun Mar 03, 2013 3:55 pm

Bounces management with sendmail and enterprise mail server

Post by carlo.dambrosio »

Good evening and thanks Agnitas for this great piece of software.

I'm trying to use OpenEMM 2013 for an organization that has an enterprise mail server (MS Exchange 2010) for intranet mailing domain, that forwards to another enterprise mail server (MS Exchange 2007) for public mailing.

I've setup OpenEMM without problems, using sendmail (8.14.4, installed on Red Hat Enterprise Linux 6.4 that hosts also OpenEMM itself).

Sendmail is configured to use, as smart host, the internal enterprise mail server (MS Exchange 2010), that hosts "department.organization.org" domain (domain is an example, I don't expose real domain for security reasons).

All works fine, except bounce management (I want to implement asyncronous bounce management), cause it doesn't recognize bounce messages.

Following is my actual configuration.

Server
Hostname: myserver.department.organization.org

DNS
OpenEMM domain: newsletter.department.organization.org
OpenEMM MX record: myserver.department.organization.org

Sendmail
sendmail.mc (only relevant informations)
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
FEATURE(masquerade_envelope)dnl
INPUT_MAIL_FILTER(`bav', `S=unix:/home/openemm/var/run/bav.sock, F=T')dnl
define(`SMART_HOST',`relay:exchangehub.department.organization.org')
MASQUERADE_AS(`organization.org')
define(`confDOMAIN_NAME', `newsletter.department.organization.org')dnl

relay-domains
newsletter.department.organization.org

mailertable
newsletter.department.organization.org procmail:/home/openemm/conf/bav/bav.rc

local-host-names
localhost
myserver.department.organization.org

Internal Enterprise Mail Server
Custom recipient internal address: openemm@newsletter.department.organization.org
Custom recipient external address: openemm@department.organization.org

External Enterprise Mail Server
Custom recipient internal address: openemm@department.organization.org
Custom recipient external address: openemm@organization.org

I've also removed "-NNEVER" option in mailer.sh script, to correctly receive notifications from the enterprise mail server.

Result is that mails are correctly sent, with address "openemm@organization.org", and bounces come back to sendmail, but OpenEMM don't recognize them.

Following is a bounce example (maillog and bounces):

maillog
Mar 3 16:33:57 myserver sendmail[2669]: STARTTLS=client, relay=exchangehub.department.organization.org., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128
Mar 3 16:33:57 myserver sendmail[2668]: STARTTLS=client, relay=exchangehub.department.organization.org., version=TLSv1/SSLv3, verify=FAIL, cipher=AES128-SHA, bits=128/128
Mar 3 16:33:58 myserver sendmail[2669]: 00004500000000004: to=<nonexistantmail1@fakedomain1.org>, delay=00:00:06, xdelay=00:00:01, mailer=relay, pri=0, relay=exchangehub.department.organization.org. [10.0.1.10], dsn=2.0.0, stat=Sent (<20130303163330-1.1.1x.4.0.18shq99hs4@myserver.department.organization.org> [InternalId=797016] Queued mail for delivery)
Mar 3 16:33:58 myserver sendmail[2668]: 00004500000000005: to=<nonexistantmail2@fakedomain2.org>, delay=00:00:06, xdelay=00:00:01, mailer=relay, pri=0, relay=exchangehub.department.organization.org. [10.0.1.10], dsn=2.0.0, stat=Sent (<20130303163330-1.1.1x.5.0.q5fxhqnfje@myserver.department.organization.org> [InternalId=797017] Queued mail for delivery)
Mar 3 16:34:01 myserver sendmail[2672]: r23FY1RX002672: from=<>, size=4909, class=0, nrcpts=1, msgid=<20130303153400.6B3BA1DC08A@externalrelay.organization.org>, bodytype=7BIT, proto=ESMTP, daemon=MTA, relay=exchangehub-nat.department.organization.org [10.0.1.15]
Mar 3 16:34:01 myserver sendmail[2672]: r23FY1RX002672: Milter add: header: X-AGNMailloop: from=<>,rid=local,to=<openemm@newsletter.department.organization.org>
Mar 3 16:34:01 myserver sendmail[2672]: r23FY1RX002672: Milter add: header: X-AGNLoop: set
Mar 3 16:34:01 myserver sendmail[2674]: r23FY1RX002672: to=<openemm@newsletter.department.organization.org>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=35216, dsn=2.0.0, stat=Sent
Mar 3 16:34:15 myserver sendmail[2677]: r23FYFN5002677: from=<>, size=4949, class=0, nrcpts=1, msgid=<20130303153415.C8AC7300084@externalrelay.organization.org>, bodytype=7BIT, proto=ESMTP, daemon=MTA, relay=exchangehub-nat.department.organization.org [10.0.1.15]
Mar 3 16:34:15 myserver sendmail[2677]: r23FYFN5002677: Milter add: header: X-AGNMailloop: from=<>,rid=local,to=<openemm@newsletter.department.organization.org>
Mar 3 16:34:15 myserver sendmail[2677]: r23FYFN5002677: Milter add: header: X-AGNLoop: set
Mar 3 16:34:15 myserver sendmail[2679]: r23FYFN5002677: to=<openemm@newsletter.department.organization.org>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=35254, dsn=2.0.0, stat=Sent

Bounces
Message 1:
From MAILER-DAEMON@organization.org Sun Mar 3 16:34:01 2013
Return-Path: <MAILER-DAEMON@organization.org>
X-Virus-Scanned: Content Filter at organization.org
Date: Sun, 3 Mar 2013 16:34:00 +0100
From: Mail Delivery System <MAILER-DAEMON@organization.org>
Subject: Undelivered Mail Returned to Sender
To: <OpenEMM@organization.org>
Auto-Submitted: auto-replied
Content-Type: multipart/report; report-type=delivery-status;
boundary="635301DC085.1362324840/externalrelay.organization.org"
X-OriginalArrivalTime: 03 Mar 2013 15:34:03.0093 (UTC) FILETIME=[88A81850:01CE1824]
X-AGNMailloop: from=<>,rid=local,to=<openemm@newsletter.department.organization.org>
X-AGNLoop: set

Content-Description: Notification
Content-Type: text/plain; charset="us-ascii"

This is the mail system at host externalrelay.organization.org.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<nonexistantmail1@fakedomain1.org>: Host or domain name not found. Name service error
for name=fakedomain1.org type=A: Host not found

Message 2:
From MAILER-DAEMON@organization.org Sun Mar 3 16:34:01 2013
Return-Path: <MAILER-DAEMON@organization.org>
X-Virus-Scanned: Content Filter at organization.org
Date: Sun, 3 Mar 2013 16:34:00 +0100
From: Mail Delivery System <MAILER-DAEMON@organization.org>
Subject: Undelivered Mail Returned to Sender
To: <OpenEMM@organization.org>
Auto-Submitted: auto-replied
Content-Type: multipart/report; report-type=delivery-status;
boundary="635301DC085.1362324840/externalrelay.organization.org"
X-OriginalArrivalTime: 03 Mar 2013 15:34:03.0093 (UTC) FILETIME=[88A81850:01CE1824]
X-AGNMailloop: from=<>,rid=local,to=<openemm@newsletter.department.organization.org>
X-AGNLoop: set

Content-Description: Notification
Content-Type: text/plain; charset="us-ascii"

This is the mail system at host externalrelay.organization.org.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to <postmaster>

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<nonexistantmail2@fakedomain2.org>: host etb-1.mail.fakedomain2.org[XX.XXX.XX.XX] said: 550
5.1.1 <nonexistantmail2@fakedomain2.org> recipient does not exist (in reply to RCPT
TO command)

Thank you in advance for help.

Carlo.
carlo.dambrosio
Posts: 10
Joined: Sun Mar 03, 2013 3:55 pm

Re: Bounces management with sendmail and enterprise mail ser

Post by carlo.dambrosio »

Good evening,
I found my error, my mailloop domain was configured as local sendmail domain, so procmail was not fired.

Now bounces are correctly counted, but I have another problem: forwarding bounces to real email address doesn't work.

Following is a part of my /var/log/maillog file, forward address is correctly inserted into X-AGNMailloop header, but no forwarding is performed:

Mar 27 23:39:21 myserver sendmail[10179]: r2RMdLfm010179: from=<>, size=5094, class=0, nrcpts=1, msgid=<20130327223920.2AC65300104@externalrelay.organization.org>, bodytype=7BIT, proto=ESMTP, daemon=MTA, relay=exchangehub-nat.department.organization.org [10.0.1.15]
Mar 27 23:39:21 myserver sendmail[10179]: r2RMdLfm010179: Milter add: header: X-AGNMailloop: from=<>,rid=1,cid=1,fwd=myrealemailaddress@mydomain.it,to=<openemm@newsletter.department.organization.org>
Mar 27 23:39:21 myserver sendmail[10179]: r2RMdLfm010179: Milter add: header: X-AGNLoop: set
Mar 27 23:39:21 myserver sendmail[10182]: r2RMdLfm010179: to=<openemm@newsletter.department.organization.org>, delay=00:00:00, xdelay=00:00:00, mailer=procmail, pri=125094, relay=/home/openemm/conf/bav/bav.rc, dsn=2.0.0, stat=Sent

Thank you in advance for help.

Regards.
ud
Posts: 154
Joined: Thu Aug 17, 2006 9:56 am
Location: Munich, Germany
Contact:

Re: Bounces management with sendmail and enterprise mail ser

Post by ud »

OpenEMM tries to filter all automatically generated mails so only human written mails should be forwarded by the bounce management. In your example, the mail is recognized as an automatic mail (due to sender <>). These mails are swallowed by the bounce management.

-- ud
carlo.dambrosio
Posts: 10
Joined: Sun Mar 03, 2013 3:55 pm

Re: Bounces management with sendmail and enterprise mail ser

Post by carlo.dambrosio »

Thank you very much.

I have misunderstood this concept, i have been thinking that also system bounces would return to real address: now I know that my system is working as expected.

Regards.
Post Reply