Frage

Postfix, Debian. I'm receiving spam and I'm not sure how can block it, because spammers uses different mail address everytime.

For example: mike.newsletter30@gmail.com mike.sfsd4f564s6df45ds@gmail.com mike.newsletter30u@gmail.com

etc.

I have setup sender access file, so I can block mails from specific servers like this:

mike.newsletter30u@gmail.com REJECT

But it's not enough. I need to setup more specific rule, for example all senders containing 'mike.' should be blocked in this case.

Unfortunatelly, rule like this: mike. REJECT

doesn't work. I've searched google and postfix docs I still can't figure out how to do this. Is this even possible?

Do you have any ideas?

War es hilfreich?

Lösung

2 Years and no clarification :S Note that it is a regular expression, Using:

/^(F|f)rom: *mike*@gmail.com/

won't work because you are thinking of * as a wildcard, regex uses * to match preceding character 0 or more times, the dot (.) is used to match any character, so the regex to match fsdghfsdjmike84329@gmail.com should be something like

/^(F|f)rom: .*mike.*@gmail.com/

Andere Tipps

First ensure that you have enabled header checks in your main.cf

header_checks = regexp:/etc/postfix/header_checks

Then add a matching rule to your checks for example:

/^(F|f)rom: mike.*@gmail.com/ REJECT JUNK is not allowed by this server

Finally restart/reload postfix to active changes.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top