1

Topic: Undelivered mail returned to sender when using Exchange on Android

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release):
- Deployed with iRedMail Easy or the downloadable installer?
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

0.9.9

I have configured my iredmail based server to relay outgoing emails using Sendgrid. Works fine. It sends successfully emails using Outlook for Windows connected to the Exchange ActiveSync back-end.

However, doing the same thing on Android (Using Gmail or BlueMail applications) configured as Exchange accounts results in "Undelivered mail returned to sender":

The log reads like this:

Sep  2 21:14:15 mail postfix/smtp[23393]: Trusted TLS connection established to smtp.sendgrid.net[159.122.219.55]:587: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep  2 21:14:15 mail postfix/smtp[23393]: 4BhYX73C4fz4wLc: to=<addr@domain.com>, relay=smtp.sendgrid.net[159.122.219.55]:587, delay=0.24, delays=0.01/0.03/0.17/0.04, dsn=5.0.0, status=bounced (host smtp.sendgrid.net[159.122.219.55] said: 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developer … -identity/ to see the Sender Identity requirements (in reply to end of DATA command))

----

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

2

Re: Undelivered mail returned to sender when using Exchange on Android

MW wrote:

The from address does not match a verified Sender Identity

You may need to check sender address and/or display name in your Android MUA.

3 (edited by MW 2020-09-03 13:15:53)

Re: Undelivered mail returned to sender when using Exchange on Android

ZhangHuangbin wrote:
MW wrote:

The from address does not match a verified Sender Identity

You may need to check sender address and/or display name in your Android MUA.

I have checked that. The from address is exactly the same on both situations, the only difference I see which may be causing the issue is the  format of the message-id:

Windows - Outlook connected to the Exchange Active-Sync endpoint, email DELIVERED:

Sep  3 07:04:28 mail postfix/smtpd[26079]: 4Bhpd82qgjz4wMH: client=mail[127.0.0.1]
Sep  3 07:04:28 mail postfix/cleanup[26088]: 4Bhpd82qgjz4wMH: message-id=<003401d681af$b32b0810$19811830$@my.domain>
Sep  3 07:04:28 mail postfix/qmgr[25922]: 4Bhpd82qgjz4wMH: from=<contact@my.domain>, size=20851, nrcpt=1 (queue active)
Sep  3 07:04:28 mail postfix/smtpd[26079]: disconnect from mail[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Sep  3 07:04:28 mail postfix/smtp[26095]: Trusted TLS connection established to smtp.sendgrid.net[159.122.219.55]:587: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep  3 07:04:28 mail postfix/smtp[26095]: 4Bhpd82qgjz4wMH: to=<target@domain.com>, relay=smtp.sendgrid.net[159.122.219.55]:587, delay=0.44, delays=0.12/0.01/0.15/0.16, dsn=2.0.0, status=sent (250 Ok: queued as LvXSvq-LQ0KHpgYNSnW-oA)
Sep  3 07:04:28 mail postfix/qmgr[25922]: 4Bhpd82qgjz4wMH: removed

Android - BlueMail application connected to the Exchange Active-Sync endpoint, email NOT DELIVERED:

Sep  3 07:03:33 mail postfix/smtpd[26079]: 4Bhpc53ZZ3z4wMF: client=mail[127.0.0.1]
Sep  3 07:03:33 mail postfix/cleanup[26088]: 4Bhpc53ZZ3z4wMF: message-id=<ce7c6a38-67e6-4e18-90de-408aa6e6ba22@my.domain>
Sep  3 07:03:33 mail postfix/qmgr[25922]: 4Bhpc53ZZ3z4wMF: from=<contact@my.domain>, size=795, nrcpt=1 (queue active)
Sep  3 07:03:33 mail postfix/smtpd[26079]: disconnect from mail[127.0.0.1] ehlo=1 mail=1 rcpt=1 data=1 quit=1 commands=5
Sep  3 07:03:33 mail postfix/smtp[26095]: Trusted TLS connection established to smtp.sendgrid.net[159.122.219.43]:587: TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)
Sep  3 07:03:33 mail postfix/smtp[26095]: 4Bhpc53ZZ3z4wMF: to=<target@domain.com>, relay=smtp.sendgrid.net[159.122.219.43]:587, delay=0.31, delays=0.11/0.01/0.15/0.04, dsn=5.0.0, status=bounced (host smtp.sendgrid.net[159.122.219.43] said: 550 The from address does not match a verified Sender Identity. Mail cannot be sent until this error is resolved. Visit https://sendgrid.com/docs/for-developers/sending-email/sender-identity/ to see the Sender Identity requirements (in reply to end of DATA command))

Shortly:

When the message-id is something like:
message-id=<003401d681af$b32b0810$19811830$@my.domain>
The email is delivered successfully.

However, when the message-id is something like:
message-id=<ce7c6a38-67e6-4e18-90de-408aa6e6ba22@my.domain>
it is not delivered and SendGrid claims that the sender identity is not verified (i.e. the domain name).

4

Re: Undelivered mail returned to sender when using Exchange on Android

IMPORTANT UPDATE:

problem occurs only when sending from contact@my.domain only. Works fine when sending from postmaster@my.domain or other email accounts (domains) hosted on my server.

5

Re: Undelivered mail returned to sender when using Exchange on Android

The issue is related to some Sendgrid bug, that they even don't care to respond to my support request regarding it. Wasted time on nothing. I don't recommend Sendgrid. Great work iredmail!