Allow some user to send email without smtp authentication

Attention

Check out the lightweight on-premises email archiving software developed by iRedMail team: Spider Email Archiver.

Attention

This tutorial is applicable to iRedMail-1.0 and later releases. If you're running an iRedMail-0.9.9 or earlier release, please follow this tutorial instead.

Postfix

Open file /etc/postfix/sender_access.pcre (Linux/OpenBSD) or /usr/local/etc/postfix/sender_access.pcre (FreeBSD), append the user's email address which you're going to allow to send email without smtp authentication. We use email address user@example.com for example here.

/^user@example\.com$/ OK

It's ok to use IP address instead like below if you want to allow all emails sent from this IP address:

/^192\.168\.1\.1$/ OK
/^192\.168\.2\./   OK
/^172\.16\./       OK

Attention

Now restart or reload postfix to make it work:

postfix reload

iRedAPD

iRedAPD plugin reject_sender_login_mismatch checks forged sender address. If sender domain is hosted on your server, but email was sent without smtp auth, it's considered as a forged email, and iRedAPD rejects this email (with rejection message: SMTP AUTH is required for users under this sender domain).

ALLOWED_FORGED_SENDERS = ['user@example.com']
MYNETWORKS = ['192.168.0.1', '192.168.1.0/24']

Restarting iRedAPD service is required if you updated /opt/iredapd/settings.py.