1

Topic: Problem with mail relayed by Office365 in the same domain

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

Hello,
in my configuration there are two mail servers: Office365 and iRedMAil. They are supporting the same domain, one part account are supporting by Office and 2nd part by Postfix.

@mydomain.com MX record is set to Office365 service. Office365 relay is configure the way that if mailbox does not exists, forward to Postfix (smarthost).

My O365 users accounts:

one@mydomain.com
two@mydomain.com

My Postfix users accounts:

one@mydomain.com
two@mydomain.com
three@mydomain.com

If someone from Internet (other domain, other server) sends e-mail to three@mydomain.com -> delivered correctly on Postfix.

The problem is when one@mydomain.com (O365 in the same domain) or two@mydomain.com(O365 in the same domain) sends mail to three@mydomain.com. Office365 try relay mail to Postfix, but postfix bouncing with:

554 5.7.1 <three@mydomain.com>: Recipient address rejected: SMTP AUTH is required for users under this sender domain

Please help me to allow Office365 use the same sender domain as Postfix supporting.

----

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

2

Re: Problem with mail relayed by Office365 in the same domain

A possible solution is listing O365 as allowed sender servers in the SPF record of your mail domain.
if sender is hosted on your iRedMail server, iRedAPD checks whether it matches SPF, and bypass if matched.
Note: you'd better upgrade iRedAPD to the latest 3.6. FYI: https://docs.iredmail.org/upgrade.iredapd.html