I would like to allow the use of the recipient_delimiter, but rewrite the address to ensure that it is delivered to the original address.

i.e. [email protected] -> [email protected]

I would like this to be available to all addresses we accept mail for. To do so I have been testing a regexp using virtual_alias_maps.

Unfortunately, when doing so this causes an issue with recipient verification checks. Since the address "passes" the regexp it is being treated as a known address and accepted.

After reading through some of the docs I found information regarding smtpd_reject_unlisted_recipient and its use of $virtual_alias_maps to determine a "known" recipient. I tested setting $virtual_alias_domains to "$virtual_alias_domains=" to prevent the default of "$virtual_alias_domains=$virtual_alias_maps". By doing this I was able to properly detect addresses as unknown accept for those containing the "+" delimiter and hitting the virtual_alias_maps regexp.

I would like to be able to rewrite the address as described, but properly handle the recipient verification similar to that when the virtual_alias_maps is not enabled. With this not enabled address which do contain the recipient_delimiter are then properly known or unknown.

Is there a better way to handle the rewrite in my case rather than using virtual_alias_maps?

You'll see in the postconf output that I am attempting to rewrite after filtering too by setting "receive_override_options=no_address_mapping" and I also have "-o smtpd_recipient_restrictions=permit_mynetworks,reject" set the reinjection smtpd.

Here are the contents of the pertinent files and postconf -n related variables

# virtual_alias_maps
/^(.*)(\+.*)@(.*)$/     $1@$3

# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
anvil_rate_time_unit = 30s
bounce_queue_lifetime = 24h
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter = amavisd-new:[127.0.0.1]:10024
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
local_recipient_maps =
mail_owner = postfix
mailbox_size_limit = 11534336
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
maps_rbl_reject_code = 559
maximal_queue_lifetime = 24h
message_size_limit = 11534336
mydestination = $myhostname, localhost.$mydomain, localhost
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
receive_override_options = no_address_mappings
recipient_delimiter = +
relay_domains = hash:/etc/postfix/relay_domains
relay_recipient_maps = hash:/etc/postfix/relay_recipients
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtp_helo_timeout = 120s
smtp_mail_timeout = 120s
smtp_quit_timeout = 120s
smtp_rcpt_timeout = 120s
smtpd_client_connection_count_limit = 10
smtpd_client_connection_rate_limit = 20
smtpd_client_event_limit_exceptions = $mynetworks, 127.0.0.1
smtpd_client_message_rate_limit = 25
smtpd_error_sleep_time = 3
smtpd_hard_error_limit = 10
smtpd_helo_required = yes
smtpd_junk_command_limit = 10
smtpd_recipient_restrictions = check_helo_access pcre:/etc/postfix/helo_checks, reject_non_fqdn_recipient, reject_non_fqdn_sender, reject_unlisted_recipient, permit_sasl_authenticated, reject_rbl_client sbl-xbl.spamhaus.org, reject_rbl_client bl.spamcop.net, reject_rbl_client dnsbl.njabl.org, reject_rbl_client dnsbl.ahbl.org, permit_mynetworks, reject_unauth_destination, check_policy_service unix:private/policyd-spf, check_recipient_access hash:/etc/postfix/roleaccount_exceptions,
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = ruraltel.net
smtpd_soft_error_limit = 5
smtpd_timeout = 45s
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
unknown_relay_recipient_reject_code = 555
virtual_alias_domains =
virtual_alias_maps = pcre:/etc/postfix/virtual_alias_maps

Reply via email to