[Exim] Linuxconf vdeliver and exim - virtual domains

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Marc Perkel
Data:  
Para: exim-users
Asunto: [Exim] Linuxconf vdeliver and exim - virtual domains
I got Linuxconf and it's vdeliver program working with exim. I also have
exim scripts that do the same thing as vdeliver. I'm just going to cut
some of my code into this message so it can be used by anyone who's
interested in making this work.

I'm still trying to work on the guy who writes linuxconf to create an
exim interface. So far no luck. If there are any programmers here I
think it could be done easilly.

Here's the director:

virtual_localuser_vdeliver:
driver = smartuser
transport = vdeliver
require_files = /etc/vmail/passwd.$domain
domains = lsearch;/etc/exim/vdomains
condition=${lookup {$local_part} lsearch {/etc/vmail/passwd.$domain}
{$value}}

And the transport:

vdeliver:
driver = pipe
command = /usr/lib/linuxconf/lib/vdeliver $local_part $domain
current_directory = /
return_path_add
envelope_to_add
delivery_date_add
return_output
user = root
group = root

Additionally - here's exim code to do the same things:

# This transport handles virtual domains using local delivery.-
linuxconf format

virtual_local_delivery:
driver = appendfile
create_directory = true
directory_mode = 700
file = /var/spool/vmail/${domain}/${local_part}
delivery_date_add
envelope_to_add
return_path_add
allow_symlink
user = ${extract{2} {:} {${lookup {$local_part} lsearch
{/etc/vmail/passwd.$domain} {$value}}}}
group = mail
mode = 600

# This director matches virtual local user mailboxes.

virtual_localuser:
driver = smartuser
transport = virtual_local_delivery
# transport = vdeliver
require_files = /etc/vmail/passwd.$domain
domains = lsearch;/etc/exim/vdomains
condition=${lookup {$local_part} lsearch {/etc/vmail/passwd.$domain}
{$value}}

---------------------------------
Additionally - I handle aliases and .forward files:

# This director handles virtual user aliases the same was alias files
# are handled

virtual_alias:
driver = aliasfile
user = root
expand
file_transport = address_file
pipe_transport = address_pipe
domains = lsearch;/etc/exim/vdomains
require_files = /etc/vmail/aliases.$domain
file = /etc/vmail/aliases.$domain
search_type = lsearch*
qualify_preserve_domain

userforward:
driver = forwardfile
require_files = /etc/vmail/passwd.$domain
condition = ${lookup {$local_part} lsearch {/etc/vmail/passwd.$domain}
{$value}}
file =
${lookup{$local_part}lsearch{/etc/vmail/passwd.$domain}{${extract{5}{:}{$value}}/.forward}}

no_verify
no_expn
no_check_local_user
check_ancestor
filter
skip_syntax_errors
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply

----------------------------
And: I have virtual domain forwarding and fallback domains:

######################################################################
#                      REWRITE CONFIGURATION                         #
######################################################################


# The /etc/exim/domainaliases file contains a list of domain aliases

# mydomain.net: mydomain.com
# mydomain.org: mydomain.com

*@*
${lookup{$2}lsearch{/etc/exim/domainaliases}{$local_part@$value}{$local_part@$domain}}
E
*@mail.* $1@$2



# VIRTUAL DOMAIN FALLBACK

# If there is no alias and local delivery fails, but there is an
alternative
# domain name to forward unsent mail to, then fallbackdomain picks up
the new
# name and resends the message. Thus if a message is sent to domain1.com
and
# there are not matching user mailboxes or aliases, then the message is
# forwarded to the same user at domain2.com. Domains can be chained.

# The file format is as follows:
#    domain1.com: domain2.com
#    domain2.com: domain3.com


fallbackdomain:
user=root
driver = smartuser
condition=${lookup{$domain}lsearch{/etc/exim/domainfallback}{$value}}
new_address =
${lookup{$domain}lsearch{/etc/exim/domainfallback}{$local_part@$value}{$local_part@$domain}}



end

------------------

Hope this is useful. Enjoy!