My goal is to limit outbound email to only three domains. All other email
destined for any other domain should be redirected to a single, valid
internal mail box.

It isn't working. Email to addresses outside this domain are still being
delivered.

/etc/postfix/access:
domain1.com  OK
domain2.com  OK
domain3.com  OK
.            REDIRECT valid@email.address



main.cf (changes from default):
mydomain=domain1.com
myorigin=$mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
relayhost = mailhost.domain1.com

# Sender restrictions:
smtpd_sender_restrictions =
    reject_non_fqdn_sender
    reject_unknown_sender_domain
    check_recipient_access hash:/etc/postfix/access
    permit_auth_destination
    reject

# Recipient restrictions:
smtpd_recipient_restrictions =
   reject_unauth_destination
   check_sender_access hash:/etc/postfix/access
   reject_invalid_hostname
   reject_non_fqdn_sender
   reject_non_fqdn_hostname
   reject_unknown_sender_domain
   reject_unauth_pipelining
   reject_non_fqdn_recipient
   reject_unknown_recipient_domain
   permit_mynetworks
   reject

As a regular user:
$ Mail -v addr...@domain.that.shouldntgetemail.org
Subject: testing #99 postfix
testing #99 removed commas
Cc:
Mail Delivery Status Report will be mailed to <userid>.

>From /var/log/maillog:
Apr  4 15:39:25 testhost postfix/postfix-script: refreshing the Postfix
mail system
Apr  4 15:39:25 testhost postfix/master[31423]: reload configuration
/etc/postfix
Apr  4 15:39:58 testhost postfix/pickup[32191]: 8869F1C9CE2: uid=21072
from=<userid>
Apr  4 15:39:58 testhost postfix/cleanup[32196]: 8869F1C9CE2:
message-id=<20120404193958.8869f1c9...@testhost.domain1.com>
Apr  4 15:39:58 testhost postfix/qmgr[32192]: 8869F1C9CE2:
from=<use...@domain1.com>, size=349, nrcpt=1 (queue active)
Apr  4 15:39:58 testhost postfix/smtp[32198]: 8869F1C9CE2:
to=<addr...@domain.that.shouldntgetemail.org>,
relay=mailhost.domain1.com[10.64.80.218]:25, delay=0.29,
delays=0.11/0/0.01/0.17, dsn=2.6.0, status=sent (250 2.6.0
<20120404193958.8869f1c9...@testhost.domain1.com> [InternalId=49042321]
Queued mail for delivery)
Apr  4 15:39:58 testhost postfix/cleanup[32196]: C967A1C9CE3:
message-id=<20120404193958.c967a1c9...@testhost.domain1.com>
Apr  4 15:39:58 testhost postfix/bounce[32199]: 8869F1C9CE2: sender
delivery status notification: C967A1C9CE3
Apr  4 15:39:58 testhost postfix/qmgr[32192]: 8869F1C9CE2: removed
Apr  4 15:39:58 testhost postfix/qmgr[32192]: C967A1C9CE3: from=<>,
size=2044, nrcpt=1 (queue active)
Apr  4 15:39:58 testhost postfix/smtp[32198]: C967A1C9CE3:
to=<use...@domain1.com>, relay=mailhost.domain1.com[1.1.1.1]:25,
delay=0.09, delays=0.04/0/0/0.04, dsn=2.6.0, status=sent (250 2.6.0
<20120404193958.c967a1c9...@testhost.domain1.com> [InternalId=31501637]
Queued mail for delivery)
Apr  4 15:39:58 testhost postfix/qmgr[32192]: C967A1C9CE3: removed

And I receive the email at addr...@domain.that.shouldntgetemail.org.

Ive been digging through every post about white lists and blocking
domains. Im sure this is either an order thing or a fatfinger or something
equally stupid but Im getting no errors from postfix either at startup or
mail processing.

Could anyone please offer any solutions?

Thanks!




-- 
Eric Kimminau
eak at kimminau dot org

Reply via email to