Topic: Spammers sending from my domain to my domain
======== Required information ====
- iRedMail version: 0.9
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Ubuntu 14.04
- Related log if you're reporting an issue: See below
====
I have a problem with spammers sending email apparently from my email addresses to the same address.
I have a catch-all address set up and am using the iredapd reject_sender_login_mismatch plugin. However, it seems that a remote sender can send email, eg from info@mydomain.com to info@mydomain.com and it gets through. Surely, senders using mydomain.com should still need to authenticate, even if sending to mydomain.com? Otherwise, what's to stop rod@mydomain.com pretending to be jane@mydomain.com when he sends email to freddie@mydomain.com?
Example logs are below. In this case, a third party uses info@mydomain.com to send email to info@mydomain.com and this is then accepted and delivered to catchall-address@mydomain.com.
Is this something that the reject_sender_login_mismatch plugin is (or should be) designed to deal with or should I attempt to write a new plugin that checks for a local from address and requires SASL authentication?
Thanks in advance for any help!
postfix log:
Mar 9 05:42:14 mail postfix/smtpd[8218]: connect from unknown[121.169.78.237]
Mar 9 05:42:14 mail postfix/smtpd[8218]: D0EC1CC258F: client=unknown[121.169.78.237]
Mar 9 05:42:16 mail postfix/cleanup[8226]: D0EC1CC258F: message-id=<002b01d05a77$06425008$852f0db5$@mydomain.com>
Mar 9 05:42:16 mail postfix/qmgr[1484]: D0EC1CC258F: from=<info@mydomain.com>, size=1805, nrcpt=1 (queue active)
Mar 9 05:42:16 mail postfix/smtpd[8218]: disconnect from unknown[121.169.78.237]
Mar 9 05:42:17 mail postfix/smtpd[8235]: connect from mail.mydomain.com[127.0.0.1]
Mar 9 05:42:17 mail postfix/smtpd[8235]: 147BECC2594: client=mail.mydomain.com[127.0.0.1]
Mar 9 05:42:17 mail postfix/cleanup[8226]: 147BECC2594: message-id=<002b01d05a77$06425008$852f0db5$@mydomain.com>
Mar 9 05:42:17 mail postfix/qmgr[1484]: 147BECC2594: from=<info@mydomain.com>, size=2909, nrcpt=1 (queue active)
Mar 9 05:42:17 mail postfix/smtpd[8235]: disconnect from mail.mydomain.com[127.0.0.1]
Mar 9 05:42:17 mail amavis[5060]: (05060-05) Passed SPAM {RelayedTaggedInternal}, MYUSERS LOCAL [121.169.78.237]:34166 [121.169.78.237] <info@mydomain.com> -> <catchall-address@mydomain.com>, Queue-ID: D0EC1CC258F, Message-ID: <002b01d05a77$06425008$852f0db5$@mydomain.com>, mail_id: ApLJO2FtGGTK, Hits: 16.993, size: 1804, queued_as: 147BECC2594, 644 ms
Mar 9 05:42:17 mail postfix/smtp[8230]: D0EC1CC258F: to=<catchall-address@mydomain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=2.3, delays=1.7/0.01/0/0.67, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 147BECC2594)
Mar 9 05:42:17 mail postfix/qmgr[1484]: D0EC1CC258F: removed
Mar 9 05:42:17 mail postfix/pipe[8237]: 147BECC2594: to=<catchall-address@mydomain.com>, relay=dovecot, delay=0.14, delays=0.01/0.06/0/0.07, dsn=2.0.0, status=sent (delivered via dovecot service)
Mar 9 05:42:17 mail postfix/qmgr[1484]: 147BECC2594: removed
iredapd debug log:
2015-03-09 05:42:14 DEBUG Connect from 127.0.0.1, port 41997.
2015-03-09 05:42:14 DEBUG smtp session: request=smtpd_access_policy
2015-03-09 05:42:14 DEBUG smtp session: protocol_state=RCPT
2015-03-09 05:42:14 DEBUG smtp session: protocol_name=ESMTP
2015-03-09 05:42:14 DEBUG smtp session: client_address=121.169.78.237
2015-03-09 05:42:14 DEBUG smtp session: client_name=unknown
2015-03-09 05:42:14 DEBUG smtp session: reverse_client_name=unknown
2015-03-09 05:42:14 DEBUG smtp session: helo_name=[121.169.78.237]
2015-03-09 05:42:14 DEBUG smtp session: sender=info@mydomain.com
2015-03-09 05:42:14 DEBUG smtp session: recipient=info@mydomain.com
2015-03-09 05:42:14 DEBUG smtp session: recipient_count=0
2015-03-09 05:42:14 DEBUG smtp session: queue_id=
2015-03-09 05:42:14 DEBUG smtp session: instance=201a.54fd32b6.bdafa.0
2015-03-09 05:42:14 DEBUG smtp session: size=0
2015-03-09 05:42:14 DEBUG smtp session: etrn_domain=
2015-03-09 05:42:14 DEBUG smtp session: stress=
2015-03-09 05:42:14 DEBUG smtp session: sasl_method=
2015-03-09 05:42:14 DEBUG smtp session: sasl_username=
2015-03-09 05:42:14 DEBUG smtp session: sasl_sender=
2015-03-09 05:42:14 DEBUG smtp session: ccert_subject=
2015-03-09 05:42:14 DEBUG smtp session: ccert_issuer=
2015-03-09 05:42:14 DEBUG smtp session: ccert_fingerprint=
2015-03-09 05:42:14 DEBUG smtp session: ccert_pubkey_fingerprint=
2015-03-09 05:42:14 DEBUG smtp session: encryption_protocol=
2015-03-09 05:42:14 DEBUG smtp session: encryption_cipher=
2015-03-09 05:42:14 DEBUG smtp session: encryption_keysize=0
2015-03-09 05:42:14 DEBUG LDAP connection initialied success.
2015-03-09 05:42:14 DEBUG LDAP bind success.
2015-03-09 05:42:14 DEBUG --> Apply plugin: reject_null_sender
2015-03-09 05:42:14 DEBUG <-- Result: DUNNO
2015-03-09 05:42:14 DEBUG Skip plugin: amavisd_message_size_limit (protocol_state != RCPT)
2015-03-09 05:42:14 DEBUG Creating Amavisd database connection.
2015-03-09 05:42:14 DEBUG Got db cursor.
2015-03-09 05:42:14 DEBUG --> Apply plugin: amavisd_wblist
2015-03-09 05:42:14 DEBUG Sender is same as recipient, bypassed.
2015-03-09 05:42:14 DEBUG <-- Result: DUNNO
2015-03-09 05:42:14 DEBUG --> Apply plugin: reject_sender_login_mismatch
2015-03-09 05:42:14 DEBUG SKIP: No SASL username.
2015-03-09 05:42:14 DEBUG <-- Result: DUNNO
2015-03-09 05:42:14 DEBUG [+] Getting LDIF data of account: info@mydomain.com
2015-03-09 05:42:14 DEBUG search base dn: o=domains,dc=mydomain,dc=com
2015-03-09 05:42:14 DEBUG search filter: (&(|(mail=info@mydomain.com)(shadowAddress=info@mydomain.com))(|(objectClass=mailUser)(objectClass=mailList)(objectClass=mailAlias)))
2015-03-09 05:42:14 DEBUG search attributes: ['objectClass', 'listAllowedUser', 'accessPolicy']
2015-03-09 05:42:14 DEBUG No such account.
2015-03-09 05:42:14 DEBUG --> Apply plugin: ldap_maillist_access_policy
2015-03-09 05:42:14 DEBUG <-- Result: DUNNO (No recipient LDIF data)
2015-03-09 05:42:14 DEBUG Closed Amavisd database connection.
2015-03-09 05:42:14 INFO [121.169.78.237] info@mydomain.com -> info@mydomain.com, DUNNO
2015-03-09 05:42:14 DEBUG Session ended
2015-03-09 05:42:14 DEBUG Close LDAP connection.
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.