1

Topic: Postfix does not rejects unknow sender adresses

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- 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?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release):
0.9.0
- Linux/BSD distribution name and version:
FreeBSD
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
MYSQL
- Web server (Apache or Nginx):
Apache
- Manage mail accounts with iRedAdmin-Pro?
No
- Related log if you're reporting an issue:
====

Postfix delivers internal mails from none existing users. Is there anyway to check if the sender email is an valid user in my domain?

For example:

l@r ~ % telnet host.com 25
Trying 1.2.3.4...
Connected to host.com.
Escape character is '^]'.
220 host.com ESMTP Postfix
helo host.com
250 host.com
mail from: noneexistinguser@host.com
250 2.1.0 Ok
rcpt to: existinguser@host.com
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
asdasdasdasd
.
250 2.0.0 Ok: queued as 658732332FF

But when i am using _mail from_ with an existing user, postfix denys it correctly because I am not logged in.

l@r ~ % telnet host.com 25
Trying 1.2.3.4...
Connected to host.com.
Escape character is '^]'.
220 host.com ESMTP Postfix
helo host.com
250 host.com
mail from: existinguser@host.com
250 2.1.0 Ok
rcpt to: existinguser@differenthost.com
553 5.7.1 <existing@differenthost.com>: Sender address rejected: not logged in

postconf -n output: (cut)

smtpd_reject_unlisted_sender = yes
smtpd_sender_login_maps = proxy:mysql:/usr/local/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated

----

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

2

Re: Postfix does not rejects unknow sender adresses

Does it work if you set "smtpd_sender_restrictions" to:

smtpd_sender_restrictions =
    reject_unknown_sender_domain
    reject_non_fqdn_sender
    reject_unlisted_sender
    permit_mynetworks
    reject_sender_login_mismatch
    permit_sasl_authenticated

3

Re: Postfix does not rejects unknow sender adresses

i did, unfortunately no changes.

It is a little bit strange. Spammers start to use this problem on our mailserver.

4

Re: Postfix does not rejects unknow sender adresses

Try this:

*) Enable iRedAPD plugin "reject_sender_login_mismatch".
*) If you're running iRedAPD-1.8.0, please remove below 2 lines in /opt/iredapd/plugins/reject_sender_login_mismatch.py:

    if not sasl_username:
        logger.debug('Bypass: Not sent by hosted user (no sasl_username).')
        return SMTP_ACTIONS['default']

*) Restart iredapd service.