On 20 October 2017 at 14:21, Emanuel <emanuel.gonza...@donweb.com> wrote:

> Hello,
>
> Is it possible to create a list where the IP of certain recipients can be
> blocked?
>
> Here and example:
>
> Oct 19 10:15:09 smtp01 postfix/smtpd[11048]: 5C28C20018459:
> client=myserver[172.17.111.242]
> Oct 19 10:15:09 smtp01 postfix/cleanup[6836]: 5C28C20018459: message-id=
> <59e8a0ca77...@domain.com> <59e8a0ca77...@domain.com>
> Oct 19 10:15:09 smtp01 postfix/qmgr[3054]: 5C28C20018459: from=
> <u...@domain.com> <u...@domain.com>, size=16981, nrcpt=1 (queue active)
> Oct 19 10:15:25 smtp01 smht-101-41/smtp[7698]: 5C28C20018459: to=
> <u...@hotmial.com> <u...@hotmial.com>, 
> relay=mail.h-email.net[198.133.159.122]:25,
> delay=16, delays=0.15/0/9.2/6.3, dsn=2.0.0, status=sent (250 Queued!)
> Oct 19 10:15:25 smtp01 postfix/qmgr[3054]: 5C28C20018459: removed
>
> Our users incorrectly type the domain name of the recipient.
>
> *hotmial.com <http://hotmial.com> ==> hotmail.com <http://hotmail.com>*
>
> My idea is block the MX or IP ==> mail.h-email.net - 198.133.159.122
>

​A better idea is to block the sending by recipient domain, with a suitable
warning:

/etc/postfixmain.cf:
<snip>
transport_maps = hash:/etc/postfix/transport
<snip>

/etc/postfix/transport:
hotmial.com error:5.1.2 maybe you mean hotmail.com
hotmal.com error:5.1.2 maybe you mean hotmail.com
hoitmail.com error:5.1.2 maybe you mean hotmail.com
homail.com error:5.1.2 maybe you mean hotmail.com
hotrmail.com error:5.1.2 maybe you mean hotmail.com
hotmil.com error:5.1.2 maybe you mean hotmail.com
hotmaill.com error:5.1.2 maybe you mean hotmail.com


Obvs you need to hash the transport file and then reload postfix. This
transport file can easily be extended to cover similar cases.

Reply via email to