Hello,
My mailcow container has been sending spam out recently.
The server is not an open relay nor does it allow unauthed email from anywhere but the docker network (host server obviously included).
It is using the mailserver’s TLD and random usernames as the sender, meaning it is getting SPF and DKIM affixed to the outbound mail and as a result of this the server is on RBL’s.
I have tried clamping the server down (short of closing off port 25), but can’t find the source of the spam source (I have no PHP , Webserver or SQL instance running outside of the mailcow setup).
I have also set up debug 3 to try and catch the spammer source.
Any help/ideas would be awesome!
Postfix Log
07/07/2025, 03:34:30 AM info check_server_access: MX r001@r-domain.tld
07/07/2025, 03:34:30 AM info generic_checks: name=check_recipient_mx_access
07/07/2025, 03:34:30 AM info >>> START Recipient address RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info >>> END Recipient address RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks status=1
07/07/2025, 03:34:30 AM info smtpd_acl_permit: smtpd_log_access_permit_actions: no match
07/07/2025, 03:34:30 AM info match_list_match: permit_mynetworks: no match
07/07/2025, 03:34:30 AM info smtpd_acl_permit: checking smtpd_log_access_permit_actions settings
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info permit_mynetworks: unknown 172.22.1.1
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks
07/07/2025, 03:34:30 AM info generic_checks: name=permit_sasl_authenticated status=0
07/07/2025, 03:34:30 AM info generic_checks: name=permit_sasl_authenticated
07/07/2025, 03:34:30 AM info >>> START Recipient address RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info >>> END Sender address RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks status=1
07/07/2025, 03:34:30 AM info smtpd_acl_permit: smtpd_log_access_permit_actions: no match
07/07/2025, 03:34:30 AM info match_list_match: permit_mynetworks: no match
07/07/2025, 03:34:30 AM info smtpd_acl_permit: checking smtpd_log_access_permit_actions settings
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info permit_mynetworks: unknown 172.22.1.1
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks
07/07/2025, 03:34:30 AM info >>> START Sender address RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info >>> END Client host RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks status=1
07/07/2025, 03:34:30 AM info smtpd_acl_permit: smtpd_log_access_permit_actions: no match
07/07/2025, 03:34:30 AM info match_list_match: permit_mynetworks: no match
07/07/2025, 03:34:30 AM info smtpd_acl_permit: checking smtpd_log_access_permit_actions settings
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 172.22.1.0/24
07/07/2025, 03:34:30 AM info match_hostaddr: mynetworks: 172.22.1.1 ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info match_hostname: mynetworks: unknown ~? 127.0.0.0/8
07/07/2025, 03:34:30 AM info permit_mynetworks: unknown 172.22.1.1
07/07/2025, 03:34:30 AM info generic_checks: name=permit_mynetworks
07/07/2025, 03:34:30 AM info >>> START Client host RESTRICTIONS <<<
07/07/2025, 03:34:30 AM info extract_addr: in: r001@r-domain.tld, result: r001@r-domain.tld
07/07/2025, 03:34:30 AM info ctable_locate: install entry key z8user01@example.com?r001@r-domain.tld
07/07/2025, 03:34:30 AM info resolve_clnt: z8user01@example.com’ -> r001@r-domain.tld’ -> transp=smtp’ host=r-domain.tld’ rcpt=r001@r-domain.tld’ flags= class=default
07/07/2025, 03:34:30 AM info send attr address = r001@r-domain.tld
07/07/2025, 03:34:30 AM info send attr sender = z8user01@example.com
07/07/2025, 03:34:30 AM info rewrite_clnt: local: r001@r-domain.tld -> r001@r-domain.tld
07/07/2025, 03:34:30 AM info send attr address = z8user01@example.com
07/07/2025, 03:34:30 AM info rewrite_clnt: local: z8user01@example.com -> z8user01@example.com
07/07/2025, 03:34:30 AM info smtpd_check_addr: addr=r001@r-domain.tld
07/07/2025, 03:34:30 AM info extract_addr: input: r001@r-domain.tld
07/07/2025, 03:34:30 AM info < unknown[172.22.1.1]: RCPT TO:r001@r-domain.tld
*** ENVELOPE RECORDS active/90B494873F2 ***
message_size: 560 1573 10 0 560 0
message_arrival_time: Mon Jul 7 00:23:31 2025
create_time: Mon Jul 7 00:23:33 2025
named_attribute: log_ident=90B494873F2
named_attribute: rewrite_context=remote
sender: u001@example.com
named_attribute: log_client_name=unknown
named_attribute: log_client_address=172.22.1.1
named_attribute: log_client_port=34182
named_attribute: log_message_origin=unknown[172.22.1.1]
named_attribute: log_helo_name=smtp.example.com
named_attribute: log_protocol_name=ESMTP
named_attribute: client_name=unknown
named_attribute: reverse_client_name=unknown
named_attribute: client_address=172.22.1.1
named_attribute: client_port=34182
named_attribute: server_address=172.22.1.253
named_attribute: server_port=25
named_attribute: helo_name=smtp.example.com
named_attribute: protocol_name=ESMTP
named_attribute: client_address_type=2
warning_message_time: Mon Jul 7 04:23:31 2025
Mailq
-Queue ID- –Size– —-Arrival Time—- -Sender/Recipient——-
03FF2413868 818 Mon Jul 7 01:32:45 u001@example.com
(Host or domain name not found. Name service error for name=r-ext1.tld type=AAAA: Host not found, try again)
r001@r-ext1.tld
A19A84108CE 880 Mon Jul 7 01:33:13 u002@example.com
(Host or domain name not found. Name service error for name=r-ext1.tld type=MX: Host not found, try again)
r001@r-ext1.tld
64D7C4155A9 812 Mon Jul 7 01:32:16 u003@example.com
(Host or domain name not found. Name service error for name=r-ext1.tld type=AAAA: Host not found, try again)
r001@r-ext1.tld
6F5E2410694 621 Mon Jul 7 01:33:39 u004@example.com
(Host or domain name not found. Name service error for name=r-ext1.tld type=MX: Host not found, try again)
r001@r-ext1.tld
9B472410686 871 Mon Jul 7 01:33:14 u005@example.com
(Host or domain name not found. Name service error for name=r-ext1.tld type=MX: Host not found, try again)
r001@r-ext1.tld
Thanks in advance