Apoligies if I'm not using the mailing list incorrectly, first time using
one.


I have a postfix installation that is used to relay mails from local users
and to receive mail from external domains.

my domain: example.com
my domain is setup with active directory lookup.

If a local user sends an email with an invalid email address (mailf
from:inva...@example.com, for example), the ldap table lookup does not
return anything, hence the mail is blocked.

If a local user sends an email with a valid email (mail
from:us...@example.com, for example), the ldap table lookup returns the
user1's email, then relays the mail.

This works well if the user's email is part of the configured domain (@
example.com).

The problem is if a user specifies an email address that is not part of the
configured domain. If the user sends an email with a source address of
inva...@test.net, for example, the ldap table lookup does not return
anything, but the email is still relayed.

How could change this behaviour and block this email?

Thanks for your help!


my config file:


# DIRECTORIES
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix

# BASIC
mail_owner = postfix
myhostname = mail01.example.com
mydomain = example.com

# SENDING MAIL
myorigin = $mydomain

# TRUST & RELAY CONTROL
mynetworks = 192.168.0.0/16, 127.0.0.0/8, localhost


# RECEIVING MAIL

# LOCAL AGENT
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
# LOCAL AGENT MAPS & REJECT CODE
unknown_local_recipient_reject_code = 550

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

# DELIVERY TO MAILBOX
home_mailbox = Maildir/

# Enable IPv4, and IPv6 if supported
inet_protocols = ipv4

# DEBUGGING CONTROL
debug_peer_level = 2
debugger_command =
         PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
         ddd $daemon_directory/$process_name $process_id & sleep 5


# INSTALL-TIME CONFIGURATION INFORMATION
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop

html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.6.6/samples
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES

#SASL
smtpd_sasl_local_domain = $mydomain

#Defining virtual mailbox settings
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /var/spool/mail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

#Verification mappings
smtpd_sender_login_maps = proxy:ldap:/etc/postfix/ad_sender_login_maps.cf
virtual_mailbox_maps = proxy:ldap:/etc/postfix/ad_virtual_mailbox_maps.cf
virtual_alias_maps = proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf

#Allow proxymap to read the proxy tables
#The default proxy_read_maps values (taken from postconf -d) + added values
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
$sender_bcc_maps $recipient_bcc_maps $smtp_generic_maps $lmtp_generic_maps
proxy:ldap:/etc/postfix/ad_virtual_group_maps.cf proxy:ldap:/etc/postfix/
ad_virtual_mailbox_maps.cf proxy:ldap:/etc/postfix/ad_sender_login_maps.cf

Reply via email to