Postfix reject unknown recipients

Issues related to applications and software problems
Post Reply
jjrowan
Posts: 132
Joined: 2005/09/10 13:07:15
Contact:

Postfix reject unknown recipients

Post by jjrowan » 2019/06/23 15:20:05

I've been googling and searching postfix forums on how to reject e-mail addressed to particular user with no luck.
An account has been receiving 50 to 100 messages per day from various .icu domains. That user tried opting out (never opted in) but had no effect. The user has been given a new e-mail address but e-mail addressed to his old one is accepted by postfix and sent to the user. I don't understand how postfix is taking in e-mail and routing it to different user. I need to reject e-mail addressed to user@domain but can't figure out how to do that in postfix.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Postfix reject unknown recipients

Post by TrevorH » 2019/06/23 15:23:02

You can probably use /etc/postfix/header_checks. I reject mail that loops from our ticketing system to other people's using something like

Code: Select all

/^From.\ .*noreply\@spammy.co.uk/ REJECT
You'll probably want to look at ^To not ^From. And you have to postmap the file and main.cf needs an addition to activate header checks at all.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply