Hello, How can I add a content filter to block by username? For example: 1. my domain name (mydomain.com) From: "mydomain.com" <any [email protected] domain.com> 2. my address ([email protected]) From: "[email protected]" <any [email protected] domain.com> Thank you!
If you want to block sending, there is setting "disable sending" in the mailbox settings. If you want to block receiving e-mails by sender, this is explained in ISPConfig Manual, page 187.
Thanks for your reply! But the problem is not with my domain, but with the username(false username and domain, phishing, spam) "any [email protected] domain.com"
There are multiple ways to block messages that are spoofed. You could implement it with "smtpd_sender_restrictions" and add them manually to the list to block them. Or implement SPF for the domain in question so it will fail when the origin IP is not listed in the record. Or use rspamd to filter out and block the message.
smtpd_sender_restrictions = check_sender_access proxy:mysql:/etc/postfix/mysql-virtual_sender.cf, check_sender_access regexp:/etc/postfix/tag_as_originating.re, reject_authenticated_sender_login_mismatch, permit_mynetworks, reject_sender_login_mismatch, permit_sasl_authenticated, reject_non_fqdn_sender, reject_unlisted_sender, reject_unknown_sender_domain, reject_unauth_destination, check_sender_access regexp:/etc/postfix/tag_as_foreign.re v=spf1 a mx ip4:my_ip_address ~all Installed sieve. Sieve does not block by sender name.