On 09/27/11 09:33, Noel Jones wrote:
On 9/27/2011 8:03 AM, Randy Ramsdell wrote:
/etc/postfix/virtual:
        #f...@example.com  stays itself.
        f...@example.com    f...@example.com

        #b...@example.com  goes elsewhere.
        b...@example.com    other@elsewhere

/etc/postfix/virtual.pcre:
        # Everything else goes to the mailsink.
        /./            mails...@example.net

?
Plus the portion of my example that you left out, and that lists
the PCRE file last in the virtual_alias_maps settings.

     Wietse
virtual_alias_maps =
         hash:/etc/postfix/virtual pcre:/etc/postfix/virtual.pcre

Has been this way since I started with your example.



When you have a /./ catchall, you need an identity mapping in the
hash file for every user to keep the catchall from grabbing it.

In your example above, you would add
    other@elsewhere   other@elsewhere
to your hash file.

Wietse's examples started out with just aliasing @example.com and
not the whole world.  In the case of aliasing only @example.com, no
identity mapping would be needed for @elsewhere as it wouldn't match
the domain wildcard.  But you're using a global wildcard, not just a
domain wildcard.


   -- Noel Jones
Okay. Tried so many iterations of this also had another person try without success.

CONFIGS:

r...@mail1-test.dfb.qa.vn:/etc/postfix # cat virtual
r...@mail1.dfb.qa.vn    rramsdell@elsewhere

r...@mail1-test.dfb.qa.vn:/etc/postfix # cat virtual.pcre
/rramsdell\@elsewhere/              rramsdell@elsewhere
/./                                     itstaff

r...@mail1-test.dfb.qa.vn:/etc/postfix # cat main.cf | grep virtual.pcre
virtual_alias_maps = hash:/etc/postfix/virtual pcre:/etc/postfix/virtual.pcre

TESTING

r...@mail1-test.dfb.qa.vn:/etc/postfix # telnet 192.168.21.31 25
Trying 192.168.21.31...
Connected to 192.168.21.31.
Escape character is '^]'.
220 mail1.dfb.qa.vn ESMTP Postfix
helo rramsdell
250 mail1.dfb.qa.vn
mail from: rramsd...@elsewhere.com
250 2.1.0 Ok
rcpt to: r...@mail1.dfb.qa.vn
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
.
250 2.0.0 Ok: queued as 6252A17A809


RESULT

Sep 27 12:25:38 mail1-test postfix/smtpd[16575]: 6252A17A809: client=mail1-test.dfb.qa.vn[192.168.21.31] Sep 27 12:25:42 mail1-test postfix/cleanup[16592]: 6252A17A809: message-id=<20110927162538.6252a17a...@mail1.dfb.qa.vn> Sep 27 12:25:42 mail1-test postfix/qmgr[16563]: 6252A17A809: from=<rramsdell@elsewhere>, size=352, nrcpt=1 (queue active) Sep 27 12:25:42 mail1-test postfix/error[16593]: 6252A17A809: to=<rramsdell@elsewhere>, orig_to=<r...@mail1.dfb.qa.vn>, relay=none, delay=25, delays=25/0/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table) Sep 27 12:25:42 mail1-test postfix/cleanup[16592]: A556C17A810: message-id=<20110927162542.a556c17a...@mail1.dfb.qa.vn> Sep 27 12:25:42 mail1-test postfix/qmgr[16563]: A556C17A810: from=<>, size=2208, nrcpt=1 (queue active) Sep 27 12:25:42 mail1-test postfix/bounce[16594]: 6252A17A809: sender non-delivery notification: A556C17A810
Sep 27 12:25:42 mail1-test postfix/qmgr[16563]: 6252A17A809: removed
Sep 27 12:25:42 mail1-test postfix/error[16593]: A556C17A810: to=<rramsdell@elsewhere>, relay=none, delay=0.06, delays=0.03/0/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table)
Sep 27 12:25:42 mail1-test postfix/qmgr[16563]: A556C17A810: removed

POSTCONF

r...@mail1-test.dfb.qa.vn:/etc/postfix # postconf -n
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
content_filter =
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
defer_transports =
delay_warning_time = 1h
disable_dns_lookups = no
disable_mime_output_conversion = no
home_mailbox = Maildir/
html_directory = /usr/share/doc/packages/postfix-doc/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 0
message_strip_characters = \0
mydestination = $myhostname, localhost.$mydomain
myhostname = mail1.dfb.qa.vn
mynetworks = 192.168.21.0/24 127.0.0.0/8
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix-doc/README_FILES
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix-doc/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_enforce_tls = no
smtp_sasl_auth_enable = no
smtp_use_tls = no
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtpd_sasl_auth_enable = no
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_use_tls = no
strict_8bitmime = no
strict_rfc821_envelopes = no
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual pcre:/etc/postfix/virtual.pcre

Reply via email to