Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reject mail TO a specific address

Status
Not open for further replies.

chmac

Technical User
Jan 22, 2004
2
TH
The majority of spam I get comes to a few selected addresses, info@, sales@, etc. As I use a catch-all alias, all of these addresses are delivered.

I'd like to reject mail that received for a few specific addresses. So any mail that is being sent to sales@, info@, and one or two others, would be rejected before being received, but my catch-all alias would still work for all other aliases.

Despite extended searching here and on the postfix mailing list, I can't find anywhere that explains how this works. It's quite easy on sendmail, but I can't find anything that explains it on postfix. I'm sure it's simple of course...

Thanks in advance - Callum.

--
Blog: Gallery:
 
If you are using local delivery then the main.cf entry alias_maps = maptype://path/to/file is what you need.

If you are delivering to the network (eg your postfix install is a relay to an internal host like MS Exchange) then you should use

relay_recipients = maptype://path/to/file

For example:

Local delivery:
alias_maps = hash:/etc/aliases
(when you change the file do 'newaliases && postfix reload' to update postfix)

Network delivery:
relay_recipients = hash:/etc/postfix/relay_recipients

You can generate relay recipients automatically if you use an internal AD domain by using Chris Covingham's excellent getadsmtp script.


Hope that helps.
millap
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top