×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

check_sender_access map seems to be ignored

check_sender_access map seems to be ignored

check_sender_access map seems to be ignored

(OP)
I have

smtpd_recipient_restrictions = permit_mynetworks,
 permit_sasl_authenticated,
 reject_unauth_destination,
 check_sender_access pcre:/etc/postfix/sender_access.pcre,
 check_recipient_access hash:/etc/postfix/recipient_access,
 

but the check_sender_access map seems to be ignored, and I cannot understand why.

For example, I have this line in the file:

/^[A-Z][a-z]{2,}[A-Z][a-z]{2,}\d\d+@/i REJECT You look like spam bot 1

The test with a sender address that was accepted seems to show it should have been rejected:

postmap -q "HoldenAlejandra43@jmcwealth.com" pcre:/etc/postfix/sender_access.pcre 
REJECT You look like spam bot 1
 

What am I doing wrong?

Below is my full (slightly edited) postconf -n output.

Thanks for your help

alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
content_filter = smtp-amavis:[127.0.0.1]:10024
delay_warning_time = 4h
home_mailbox = Maildir/
inet_interfaces = all
local_recipient_maps = unix:passwd.byname, $alias_maps
mailbox_size_limit = 0
message_size_limit = 20480000
milter_connect_macros = j {daemon_name} v {if_name} _
milter_default_action = accept
mydestination = mail.example.com, localhost.example.com, localhost
myhostname = mail.example.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 my.ip.add.ress/26
myorigin = /etc/mailname
non_smtpd_milters = unix:/opendkim/opendkim.sock
queue_directory = /var/spool/postfix
readme_directory = no
recipient_delimiter = +
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_error_sleep_time = 5s
smtpd_hard_error_limit = 10
smtpd_helo_required = yes
smtpd_milters = unix:/opendkim/opendkim.sock
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_sender_access pcre:/etc/postfix/sender_access.pcre, check_recipient_access hash:/etc/postfix/recipient_access,
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/MyCA.pem
smtpd_tls_cert_file = /etc/ssl/MyCert.pem
smtpd_tls_key_file = /etc/ssl/private/MyCert.key
smtpd_tls_mandatory_protocols = !SSLv2,!SSLv3
smtpd_tls_protocols = !SSLv2,!SSLv3
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = regexp:/etc/postfix/virtual.regex
 

RE: check_sender_access map seems to be ignored

(OP)
It looks like the sender address is converted to lower case before the lookup.
So apparently, it is not possible to match upper case characters in a pcre lookup
(which also makes the /i flag quite useless and misleading)

Debug output shows the "problem" :

Mar 24 14:42:50 pe2 postfix/smtpd[28637]: >>> START Sender address RESTRICTIONS <<<
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: generic_checks: name=check_sender_access
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: check_mail_access: SomeUser1234@somedomain.tld
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: ctable_locate: move existing entry key SomeUser1234@somedomain.tld
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: check_access: someuser1234@somedomain.tld
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: dict_pcre_lookup: /etc/postfix/sender_access.pcre: someuser1234@somedomain.tld
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: check_domain_access: somedomain.tld
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: check_access: someuser1234@
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: generic_checks: name=check_sender_access status=0
Mar 24 14:42:50 pe2 postfix/smtpd[28637]: >>> END Sender address RESTRICTIONS <<<
 

Is there any way to prevent this case folding to happen?

I have postfix version 2.9.6 (in Debian Jessie).

Thanks.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close