HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Server Operation (http://www.howtoforge.com/forums/forumdisplay.php?f=5)
-   -   PostFix drop mail to specific account (http://www.howtoforge.com/forums/showthread.php?t=20036)

kule 1st February 2008 18:23

PostFix drop mail to specific account
 
Hi There,

I used the postfix guide on the site which worked a charm!

Only one little niggle, I've currently got a catchall, but I keep getting spam to a specific address - e.g. lots of spam, always going to abc@mydomain.com.

Is there a way I can just block all emails to that address?

Thanks
Luke

falko 2nd February 2008 19:11

Take a look here: http://www.postfix.org/header_checks.5.html

kule 2nd February 2008 19:23

Cheers Falco, I'll take a look - will that work for BCC fields as well?

falko 3rd February 2008 19:18

I'm not sure... :o

kule 6th February 2008 15:19

*snip*
Hmm no it doesn't work for Bcc fields - I'll have to look into another method.

In case anyone wants to try this for blocking emails to a specific address in To: or Cc: fields:
*/snip*

I tried sending a bcc email to myself and received it so I assumed it didn't work. However I haven't had any spam mail since so this must be working with BCC fields too! :D

1) Add a line to your main.cf
Code:

header_checks = regexp:/etc/postfix/header_checks
2) Create a new file, /etc/postfix/header_checks
Code:

/addresstoblock@yourdomain\.com/    DISCARD
3) Restart postfix
Code:

/etc/init.d/postfix restart
This will silently accept the email but not deliver it - if you wish you can use REJECT instead of DISCARD and it will send an undelivered message back to the sender.

Cheers
Luke

jarif 5th September 2012 00:01

It can't work with bcc: fields, as there is no such fields in SMTP headers. header_checks do indeed check headers.

Bcc recipient is entered by the protocol with RCPT-TO command, but otherwise bcc recipient is invisible.


All times are GMT +2. The time now is 12:57.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.