On Mon, Apr 16, 2012 at 08:37:00AM +0200, Rodolphe Quiédeville wrote:
> Le 13/04/2012 19:27, Kizito Thomas a écrit :
> > Thank you Ansgar, Does it mean I cannot use this method to block 
> > un desirable mails this way? At first I tried using the method 
> > explained on 
> > http://www.cyberciti.biz/faq/howto-blacklist-reject-sender-email-address/ 
> > but this could not allow postfix to restart. That is why I resort 
> > to this. Is there another way around this?

The OP should regard Noel's reply and refer to the documentation:

http://www.postfix.org/SMTPD_ACCESS_README.html
http://www.postfix.org/postconf.5.html#check_sender_access
http://www.postfix.org/documentation.html

> Indeed you can use this method to block incoming email,

Only if that header exists in the incoming mail. Since mail headers 
have nothing to do with mail routing, it's not generally a good idea 
to rely on them for blocking.

Furthermore, the idea of blocking sender addresses is itself of 
limited use. Anyone can specify any sender address in their mail.

If the ultimate goal is (for example) spam control, this idea is 
foolish. The vast majority of all spam (which is the vast majority of 
all SMTP traffic worldwide) is sent with forged sender addresses. Out 
of any five given mails you see arriving at a typical Internet MX 
site, you can bet at least four of them have forged sender addresses.

If you get a few spams that claim to be from someb...@example.com, do 
you conclude that someb...@example.com is a spammer? Absurd. What 
happens if the real someb...@example.com needs to contact you in the 
future after you have blocked "the spammer"?

> I do this actually. I guess your problem is the regex itselfs, add 
> an space after 'From:' and to be sure to match this "spammer" open 
> your regex like :

Oh goody! Some regular expression nitpicking in the morning! :)

> /^From: .*t...@mayengo.or.ug.*/ REJECT

Among other addresses that will match:

a...@mayengotoraugh.postfix.org

When you mean "." as a period, and not as the regexp metacharacter, 
it must be escaped. The end of the expression should be anchored, 
also, as well as the beginning of the address.

Better yet: give up the whole idea, as explained above.
-- 
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:

Reply via email to