On 09/22/11 16:33, Wietse Venema wrote:
Randy Ramsdell:
/etc/postfix/main.cf:
      virtual_alias_maps = hash:/etc/postfix/virtual

/etc/postfix/virtual:
      # All example.com users become mails...@example.net.
      @example.com      mails...@example.net

      # Except for f...@example.com, which stays itself.
      f...@example.com  f...@example.com

      # And except for b...@example.com, which goes elsewhere.
      b...@example.com  other@elsewhere

See http://www.postfix.org/DATABASE_README.html for tips to translate
this into other database formats.

        Wietse
ahh however we need :

@        singleuser@domain.

I tried this but does not work.
No surprise. The form "@" is not documented anywhere.

If you really must rewrite any domain, use regular expressions instead.

/etc/postfix/main.cf:
     virtual_alias_maps =
        hash:/etc/postfix/virtual pcre:/etc/postfix/virtual.pcre

/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

        Wietse
Well this worked and somehow I broke it or really not sure. We only want to accept mail from the app servers.

hostname -f
mail1-test.dfb.qa.vn

Relevant logs:

Sep 23 13:28:20 mail1-test postfix/error[18015]: 2760D17A7F6: to=<itst...@outdomain.com>, orig_to=<rramsd...@joeblow.com>, relay=none, delay=0.07, delays=0.04/0/0/0.03, dsn=5.0.0, status=bounced (User unknown in virtual alias table)


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
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,*.com
myhostname = mail1-test.dfb.qa.vn
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 = pcre:/etc/postfix/virtual.pcre

Reply via email to