From: "Jack Knowlton" on
Hi all.
I have a Postfix virtual users setup based on mysql tables. Messages are
stored in Maildir format.
I am aware that creating a virtual alias @domain1.com -> user(a)domain2.com
will make Postfix accept emails for any username and deliver them to
user(a)domain2.com.

Is it possible to do the same thing with users? I would like Postfix to
accept mail for any recipient of that particular domain and create the
matching Maildir once the first message has been received.
Thanks,

-JK


alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
data_directory = /var/lib/postfix
fast_flush_domains = vp44.net
header_checks = regexp:/etc/postfix/header_checks
html_directory = /usr/share/doc/postfix/html
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
maximal_queue_lifetime = 14d
message_size_limit = 0
mynetworks = 127.0.0.0/8, 10.0.0.0/16, 172.16.0.0/24
myorigin = /etc/mailname
readme_directory = /usr/share/doc/postfix
receive_override_options = no_address_mappings
recipient_bcc_maps = hash:/etc/postfix/recipient_bcc_map
recipient_delimiter = +
relayhost = [172.16.0.30]:587
sender_bcc_maps = hash:/etc/postfix/sender_bcc_map
sender_dependent_relayhost_maps = hash:/etc/postfix/relay_map
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name
smtpd_client_connection_count_limit = 150
smtpd_client_restrictions = permit_mynetworks, permit_sasl_authenticated,
check_client_access cidr:/etc/postfix/cidr_checks,
check_client_access regexp:/etc/postfix/client_access_checks,
permit
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_helo_required = yes
smtpd_recipient_restrictions = permit_mynetworks,
permit_sasl_authenticated, reject_unauth_destination,
check_recipient_access regexp:/etc/postfix/accounts_regex,
check_recipient_access hash:/etc/postfix/accounts, check_client_access
cidr:/etc/postfix/postfix-dnswl-permit, reject_rbl_client
bl.spamcop.net, reject_rbl_client dyna.spamrats.com,
reject_rbl_client noptr.spamrats.com, reject_rbl_client
spam.spamrats.com, reject_rbl_client zen.spamhaus.org, permit
smtpd_reject_unlisted_sender = yes
smtpd_restriction_classes = nodnsfilter
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sender_login_maps = mysql:/etc/postfix/mysql-virtual_sender_check..cf
smtpd_sender_restrictions = check_recipient_access
hash:/etc/postfix/classes, reject_authenticated_sender_login_mismatch,
check_sender_access hash:/etc/postfix/origin_access_checks,
permit_mynetworks, permit_sasl_authenticated,
reject_unknown_sender_domain, reject_non_fqdn_sender, reject_rbl_client
dul.dnsbl.sorbs.net, reject_rbl_client dnsbl.njabl.org,
reject_rhsbl_sender dsn.rfc-ignorant.org, check_policy_service
inet:127.0.0.1:2501, permit
smtpd_timeout = 60
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
strict_rfc821_envelopes = yes
tls_random_exchange_name = ${data_directory}/prng_exch
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transport.cf
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings..cf
mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/mail/virtual
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_limit = 0
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes..cf
virtual_uid_maps = static:5000

From: Wietse Venema on
Jack Knowlton:
> I would like Postfix to
> accept mail for any recipient of that particular domain and create the
> matching Maildir once the first message has been received.
> Thanks,

This is possible but I don't think it is a good idea to auto-create
maildirs for users whose name starts with "../../", shell special
characters, and so on. For these reasons Postfix will not allow
regular expression maps to be used for this purpose.

Wietse

From: "Jack Knowlton" on
On Mon, March 1, 2010 11:34 pm, Wietse Venema wrote:
> Jack Knowlton:
>> I would like Postfix to
>> accept mail for any recipient of that particular domain and create the
matching Maildir once the first message has been received.
>> Thanks,
> This is possible but I don't think it is a good idea to auto-create
maildirs for users whose name starts with "../../", shell special
characters, and so on. For these reasons Postfix will not allow
> regular expression maps to be used for this purpose.
> Wietse

Hi Wietse,

Thank you for the response. I am working on a disposable e-mail addressing
service thus need to accept mail for any username. The message files will
be read by the WWW daemon on a drive that shadow copies the primary
Postifx Maildirs. I can manually work out a list of "forbidden"
destination usernames that will be rejected.
Parsing one by one the message files to match against "X-Original-To"
header is not an option performance-wise.
If possible I would still like to implement the automatic maildir creation
process.
Thanks,

JK