Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
From: mouss (moussml.netoyen.net)
Date: Wed Apr 15 2009 - 17:12:15 CDT
Costin Guşă a écrit :
> I'd like to be able to accept mail for only ONE domain and deliver to
> cyrus (configured with singleinstancestore) with lmtp and also keep
> /etc/aliases and unix accounts.
> From what I've googled (some results from this list), I understand
> that I need to deliver with virtual in order to have lmtp send
> multiple 'rcpt to'.
> After reading VIRTUAL_README and ADDRESS_CLASS_README, I understood
> that my specific needs are not found in examples, so at first I
> thought of this configuration, with postfix_2.5.5-1.1_i386.deb on
> debian lenny x86 (note that my modification consists only of the
> virtual_* options, the rest is modified by debian package manager):
> test:~# postconf -n:
> alias_database = hash:/etc/aliases
> alias_maps = hash:/etc/aliases
> append_dot_mydomain = no
> biff = no
> config_directory = /etc/postfix
> inet_interfaces = all
> mailbox_command = procmail -a "$EXTENSION"
if you don't use procmail, remove this.
> mailbox_size_limit = 0
> mydestination = mail.domain.ro, localhost
> myhostname = mail.domain.ro
> mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
> myorigin = mail.domain.ro
> readme_directory = no
> recipient_delimiter = +
> virtual_alias_maps = $local_recipient_maps
oh no. don't mix virtual_alias_maps and local_recipient_maps.
> virtual_mailbox_domains = domain.ro
> virtual_transport = lmtp:unix:/var/run/cyrus/socket/lmtp
> In /etc/aliases I put (along the root aliasing defaults):
> then newalias'ed
> In linux I created user1 and user2
> After testing, I discovered that it wasn't doing the alias expanding
> as I expected (it delivered to 'test' user, which cyrus is configured
> to happily accept, since it's patched to autocreate the mailbox on
> first delivery and I count on postfix for user validation), so I
> created a /etc/postfix/valiases in which I put again test: user1,user2
> , postalias'ed it and removed the change in /etc/aliases, then
> newalias'ed. Then I adjusted "virtual_alias_maps =
> hash:/etc/postfix/valiases, $local_recipient_maps",
> /etc/init.d/postfix reload'ed and this time it worked.
> The next step was to remove /etc/postfix/valiases and symlink it from
> /etc/aliases, putting the alias back in /etc/aliases, then postalias
> /etc/postfix/valiases and newalias'ed. It worked as expected, again
> (two 'rcpt to' sent over a single session)
> 1. The above postconf -n with the modified 'virtual_alias_maps' does
> what I want. Are there other effects that I should be aware of?
> 2. Why it works with separate /etc/postfix/valiases file, even if it's
> content is the same with /etc/aliases? I have even tried to put
> "virtual_alias_maps = proxy:unix:passwd.byname, hash:/etc/aliases"
> (the same value for local_recipient_maps)...
> Thank you
if you want virtual aliases, better
- avoid using /etc/aliases
- use full addresses: include the domain part. when you don't, postfix
adds $myorigin. including the domain part avoids surprises.
in short, use virtual aliases like this:
to deliver to a unix account, use a "local" domain in the right hand
side. for example