[Exim] virtual aliasing with Exim 4.x

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Slawomir Orlowski
Datum:  
To: exim-users
Betreff: [Exim] virtual aliasing with Exim 4.x
Hello there,

I have decided to move from exim 3.36 to exim 4.34.
Unfortunately configuration options changed and I cannot make it work.
I would appreciate any help, I'm stuck, I have read online and documentation
specs.pdf and still cannot figure it out.

Server is supposed to accept mail for main domain with system accounts and
mail for several virtual domains. Both main and virtual domains have alias
files.

With configuration which works on exim 3.36 you can send emails to

- main domain with system accounts, alias file is /etc/aliases,
- to any account on virtual domains,
        list of domains is in /etc/mail/domain file,
        every virual domain have alias file /etc/mail/aliases.domain_name
and
        password file with users names /etc/mail/passwd.domain_name.


#part of transports configuration#

local_delivery:
driver = appendfile
file = /var/spool/mail/${local_part}
delivery_date_add
envelope_to_add
return_path_add
group = mail
mode = 0660

address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add

virtual_localdelivery:
driver = appendfile
file = /var/spool/mail/${domain}/${local_part}
user = mail
group = mail
mode = 660


#part of directors configuration#

virtual_alias:
driver = aliasfile
domains = lsearch:/etc/mail/domains
file = /etc/mail/aliases.${domain}
search_type = lsearch
qualify_preserve_domain

system_aliases:
driver = aliasfile
domains = $qualify_domain
file = /etc/aliases
search_type = lsearch
file_transport = address_file
pipe_transport = address_pipe

virtual_localuser:
driver = aliasfile
transport = virtual_localdelivery
domains = lsearch:/etc/mail/domains
file = /etc/mail/passwd.$domain
search_type = lsearch

localuser:
driver = localuser
transport = local_delivery


Base on what I have read, exim 4.34 configuration in question is:

#routers configuration#

virtual_aliases: (*)
driver = redirect
domains = lsearch:/etc/mail/domains
file = /etc/mail/aliases.${domain}
allow_fail
allow_defer
qualify_preserve_domain

system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
file_transport = address_file
pipe_transport = address_pipe

localuser:
driver = accept
check_local_user
transport = local_delivery
cannot_route_message = Unknown user

virtual_localuser:
driver = accept
domains = lsearch;/etc/mail/domains
local_parts = lsearch;/etc/mail/passwd.$domain
transport = virtual_localdelivery

#transports#
remote_smtp:
driver = smtp
...

local_delivery:
driver = appendfile
file = /var/spool/mail/$local_part
delivery_date_add
envelope_to_add
return_path_add
group = mail

virtual_localdelivery:
driver = appendfile
file = /var/spool/mail/$domain/$local_part
user = mail
group = mail
mode = 660

Aliasing and delivery for main local domain works.
But aliasing and delivery for virtual domains do not work.
I'm getting message in rejectlog:

2004-07-13 14:33:17 H=slawek.cympak.com (slawek) [192.168.0.73]
F=<sorlowski@???>temporarily rejected RCPT
<virtual_user@virtual_domain.com>:error in redirect file: missing or
malformed local part(expected word or "<") in "virtual_user1:
virtual_user2"

(where virtual_user1 : virtual_user2 is first line of proper alias file for
virtual_domain in question.) - exactly the some format have /etc/aliases
file system accounts

When I have commented out lines for virtual_aliases: (*) delivery for
virual domains worked, but I need alias files for every virtual domain.

How to make it wor? Any help suggestion would be greatly appreciated.

Best Regards
Slawomir Orlowski