From: Gijs on
Hello List,

I'm trying to get postfix work properly with Cyrus-imap but I've yet to
get everything completely working. My server hosts several domains and
uses Cyrus to deliver its email to the correct users. In my setup I've
configured a catch-all address and several other virtual addresses. Now
postfix seems to skip over the virtual addresses and goes straight to
the catch-all address when I try to send something to the domain.
However, it only does this for the domains that are not the default
domain. The default domain with catch-all works as it should. I don't
completely understand how postfix actually knows how mailboxes are
reachable through cyrus so I might have configured something completely
wrong but reading all the howto's online I ended up with the following
configs:

postconf -n:
alias_database = hash:/etc/aliases, hash:/etc/postfix/aliases
alias_maps = hash:/etc/aliases, hash:/etc/postfix/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
header_checks = regexp:/etc/postfix/header_checks
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydomain = ltb.nu
myhostname = mail.mydomain.com
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_tls_cert_file = /etc/pki/tls/certs/postfix.pem
smtpd_tls_key_file = $smtpd_tls_cert_file
smtpd_tls_received_header = yes
smtpd_use_tls = yes
tls_random_source = dev:/dev/urandom
unknown_local_recipient_reject_code = 550
virtual_alias_maps = hash:/etc/postfix/virtual
virtual_mailbox_domains = mydomain.com myotherdomain.com
virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp

/etc/postfix/virtual:
test(a)mydomain.com someuser
@mydomain.com catchalluser

info(a)myotherdomain.com someotheruser(a)myotherdomain.com
@myotherdomain.com catchalluser(a)myotherdomain.com

The mail to test(a)mydomain.com works as it should, but the mail to
info(a)myotherdomain.com always ends up in catchalluser(a)myotherdomain.com.
If I comment the catchall line for @myotherdomain.com, then it does get
delivered to the correct address.

Does anyone know what the problem might be?

Regards, Gijs

PS: The postfix version is 2.3.3, Cyrus-imapd version is 2.3.7

From: Ansgar Wiechers on
On 2010-03-10 Gijs wrote:
> virtual_alias_maps = hash:/etc/postfix/virtual
> virtual_mailbox_domains = mydomain.com myotherdomain.com
> virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp
>
> /etc/postfix/virtual:
> test(a)mydomain.com someuser
> @mydomain.com catchalluser
>
> info(a)myotherdomain.com someotheruser(a)myotherdomain.com
> @myotherdomain.com catchalluser(a)myotherdomain.com
>
> The mail to test(a)mydomain.com works as it should, but the mail to
> info(a)myotherdomain.com always ends up in catchalluser(a)myotherdomain.com.
> If I comment the catchall line for @myotherdomain.com, then it does get
> delivered to the correct address.
>
> Does anyone know what the problem might be?

Did you try Postfix example configuration for virtual mailboxes?

http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox

I think you're supposed to use $virtual_mailbox_maps rather than
$virtual_alias_maps for virtual mailboxes.

Regards
Ansgar Wiechers
--
"Abstractions save us time working, but they don't save us time learning."
--Joel Spolsky

From: Gijs on
On 3/10/10 15:05 , Ansgar Wiechers wrote:
> On 2010-03-10 Gijs wrote:
>
>> virtual_alias_maps = hash:/etc/postfix/virtual
>> virtual_mailbox_domains = mydomain.com myotherdomain.com
>> virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp
>>
>> /etc/postfix/virtual:
>> test(a)mydomain.com someuser
>> @mydomain.com catchalluser
>>
>> info(a)myotherdomain.com someotheruser(a)myotherdomain.com
>> @myotherdomain.com catchalluser(a)myotherdomain.com
>>
>> The mail to test(a)mydomain.com works as it should, but the mail to
>> info(a)myotherdomain.com always ends up in catchalluser(a)myotherdomain.com.
>> If I comment the catchall line for @myotherdomain.com, then it does get
>> delivered to the correct address.
>>
>> Does anyone know what the problem might be?
>>
> Did you try Postfix example configuration for virtual mailboxes?
>
> http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox
>
> I think you're supposed to use $virtual_mailbox_maps rather than
> $virtual_alias_maps for virtual mailboxes.
>
> Regards
> Ansgar Wiechers
>
Thanks for your reply Ansgar.

As far as I know virtual_mailbox is used when postfix delivers the
emails to the accounts itself, but I'm using Cyrus to do that. So the
use of virtual_alias should be correct in my setup. Unless I'm not
understanding the example right :)

Regards, Gijs

From: Victor Duchovni on
On Wed, Mar 10, 2010 at 02:10:48PM +0100, Gijs wrote:

> Hello List,
>
> I'm trying to get postfix work properly with Cyrus-imap but I've yet to get
> everything completely working. My server hosts several domains and uses
> Cyrus to deliver its email to the correct users. In my setup I've
> configured a catch-all address and several other virtual addresses. Now
> postfix seems to skip over the virtual addresses and goes straight to the
> catch-all address when I try to send something to the domain.

Search the documentation and list archives for the phrase "identity
mapping" virtual expansion is recursive. Also catch-all addresses
are a really bad idea. You should encourage your users to "un-request"
this feature.

--
Viktor.

P.S. Morgan Stanley is looking for a New York City based, Senior Unix
system/email administrator to architect and sustain our perimeter email
environment. If you are interested, please drop me a note.

From: Wietse Venema on
Gijs:
> On 3/10/10 15:05 , Ansgar Wiechers wrote:
> > On 2010-03-10 Gijs wrote:
> >
> >> virtual_alias_maps = hash:/etc/postfix/virtual
> >> virtual_mailbox_domains = mydomain.com myotherdomain.com
> >> virtual_transport = lmtp:unix:/var/lib/imap/socket/lmtp
> >>
> >> /etc/postfix/virtual:
> >> test(a)mydomain.com someuser
> >> @mydomain.com catchalluser
> >>
> >> info(a)myotherdomain.com someotheruser(a)myotherdomain.com
> >> @myotherdomain.com catchalluser(a)myotherdomain.com
> >>
> >> The mail to test(a)mydomain.com works as it should, but the mail to
> >> info(a)myotherdomain.com always ends up in catchalluser(a)myotherdomain.com.
> >> If I comment the catchall line for @myotherdomain.com, then it does get
> >> delivered to the correct address.
> >>
> >> Does anyone know what the problem might be?
> >>
> > Did you try Postfix example configuration for virtual mailboxes?
> >
> > http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox
> >
> > I think you're supposed to use $virtual_mailbox_maps rather than
> > $virtual_alias_maps for virtual mailboxes.
> >
> > Regards
> > Ansgar Wiechers
> >
> Thanks for your reply Ansgar.
>
> As far as I know virtual_mailbox is used when postfix delivers the
> emails to the accounts itself, but I'm using Cyrus to do that. So the
> use of virtual_alias should be correct in my setup. Unless I'm not
> understanding the example right :)

Then why are you using

virtual_mailbox_domains = mydomain.com myotherdomain.com

When in reality you should be using virtual_ALIAS_domains?

Wietse