Charles Marcus:
> Ok, Can't seem to figure this out...
> 
> I want to block sending to certain domains - in this case, a domain that
> is typod...
> 
> Googling suggests this should work:
> 
> smtpd_relay_restrictions = check_recipient_access
> ${hash}/blacklisted_domains, permit_sasl_authenticated,
> permit_mynetworks, reject
> 
> blacklisted_domains contains
> exemple.com REJECT did you mean 'exAmple.com'?
> 
> But querying the map only works for the plain TLD, not for email
> addresses for the TLD.

check_recipient_access automatically makes queries for the email
address, the domain, and more. See access(5).

>  # postmap -q exemple.com hash:/etc/postfix/maps/hash/blacklisted_domains
> REJECT did you mean 'exAmple.com'?
> 
>  # postmap -q recipi...@exemple.com
> hash:/etc/postfix/maps/hash/blacklisted_domains
> 
> What am I missing?

The postmap command does not automatically make related queries for
email address, domain name, and more. You have make the related
queries yourself.

postmap cannot figure out by itself that you want to query an access
map. It needs help. For example, to simulate the queries in
header/body_checks, you specify "postmap -mh" or "postmap -mb".

There currently are no options tell postmap that you want to query
access maps, canonical maps, transport maps, etc. You have to make
the related queries yourself.

It should be possible to extract the code that makes related queries
for access maps and transport maps and put that code into library
functions (the related queries for canonical, virtual alias and
generic maps are already generated by a library routine). Then,
postmap could make the same related queries as Postfix daemons.

        Wietse

Reply via email to