[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postfix-users
Subject:    Forward mail and receive mail to the same domain
From:       Dotan Cohen <dotancohen () gmail ! com>
Date:       2013-07-05 13:19:36
Message-ID: CAKDXFkPt4we8+wcH98jLB1OHGTNYsuapY9BzZav=z_=G8eEcZw () mail ! gmail ! com
[Download RAW message or body]

I need to set up a virtual alias (forwarder) and a virtual mailbox on
the same domain. I'm using Postfix on Ubuntu Server 12.04. Here is my
setup:

$ cat /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

append_dot_mydomain = no
readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname = awsBeta
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = awsBeta, localhost.localdomain, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

virtual_mailbox_domains = someDomain.com
virtual_mailbox_base = /var/mail/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmailbox
virtual_minimum_uid = 100
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000

virtual_alias_domains = someDomain.com

$ cat /etc/postfix/virtual
forward@someDomain.com test@gmail.com

$ cat /etc/postfix/vmailbox
dotan@someDomain.com someDomain.com/dotan

$ sudo postmap virtual
$ sudo postmap vmailbox
$ tree /var/mail/vhosts/
/var/mail/vhosts/
└── someDomain.com
    └── dotan

When mail is sent to forward@someDomain.com it is properly forwarded
to test@gmail.com. However, when mail is sent to dotan@someDomain.com
the sending address receives a mail with this error:
Recipient address rejected: User unknown in virtual alias table

This appears in the log:
warning: do not list domain someDomain.com in BOTH
virtual_alias_domains and virtual_mailbox_domains

Of course, I cannot remove the domain from either
virtual_alias_domains or virtual_mailbox_domains because I need to use
bothe of those features. So how might one set up dotan@someDomain.com
as a real mailbox (no unix account though), but forward@someDomain.com
to forward to test@gmail.com? I've been trolling Google for answers,
but though I thought that this would be easy, I'm stuck!


--
Dotan Cohen

http://gibberish.co.il
http://what-is-what.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic