Mailing List Archive

Virtual Aliases and Domain Aliases
Scenario:

I have multiple virtual domains on my mail server, each with its own
alias file and passwd file, not to mention virtual mail directories for
each domain. I also have a main domain which has it's own password and
alias files. I am using code which was taken from the exim-users
mailing list archive to process the virtual domain and local domain
information.

The problem is compounded by the fact that {zmw.com} is a domain alias
for {pibomulti-na.com} (Same company, but all e-mail accounts are
actually handled by pibomulti-na.com and anything with @zmw.com simply
needs to be remapped to the files in the pibomulti-na.com configuration.
(ie, there is no /var/spool/vmail/zmw.com and /etc/vmail/*.zmw.com ...
I attempted to modify the file to compensate for this, but it's not
working. Also, if a virtual domain alias also exists in the main domain
(such as info or admin) they are being processed by the local domain
rules as if the virtual domain didn't exist and being delivered to the
local domain.

I remarked out the require_files bit because it was dumping some of my
mail because there was no alias file for the particular domain.

Would it be better to just let /usr/lib/linuxconf/lib/vdeliver handle
the incoming mail to the virtual domains (including aliases) instead of
trying to let exim handle them?

I tried putting my virtual domains under relay_domains = instead of
local_domains = but it was freezing the virtual domains in the queue
rather than delivering them.

Any suggestions as to how to alter this so it works properly?

Local Domain {labnet.com}

/etc/passwd
/etc/aliases
/var/spool/mail/${local_part}

Virtual Domains

/var/spool/vmail/${domain}/${local_part}
/etc/vmail/aliases.${domain}
/etc/vmail/passwd.${domain}

I have a file which contains the virtual domains for which mail is
accepted on this system.

/etc/mail/sendmail.cV


Here are the files as I have them, and the relevant entries from the
/etc/exim.conf


/etc/mail/sendmail.cV:

[/root]-> less /etc/mail/sendmail.cV
carlylefund.com
mail.carlylefund.com
ensemble.org
ensemble.labnet.com
friskyfans.org
holidayestate.com
houstonvoice.com
jshorton.com
lsggroup.com
mail.lsggroup.com
mckenziemethod.com
mail.mckenziemethod.com
personalsalternative.com
pflagwaco.org
pibomulti-na.com
mail.pibomulti-na.com
mail.zmw.com
zmw.com
texascooking.com
mail.texascooking.com
lists.texascooking.com
vilastic.com
mail.vilastic.com
/etc/mail/sendmail.cV lines 1-23/23 (END)

[/root]-> less /etc/exim.conf
######################################################################
# MAIN CONFIGURATION SETTINGS #
######################################################################

# it would be nice if this could be handled by a file listing one domain
per line
# rather than this long string, but here it is.

local_domains = localhost:labnet.com:mail.labnet.com:vmail.labnet.com:

carlylefund.com:ensemble.org:friskyfans.org:texascooking.com:

holidayestate.com:houstonvoice.com:jshorton.com:lsggroup.com:

mckenziemethod.com:personalsalternative.com:pflagwaco.org:

pibomulti-na.com:zmw.com:vilastic.com:logcabin.org:mail.logcabin.org:
ballins.com:vader.labnet.com:www.lsggroup.com

# there are multiple entries which shouldn't matter, but seem to be
rejected, obviously.

######################################################################
# TRANSPORTS CONFIGURATION #
######################################################################

# 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.$do
main} {$value}}}}
group = mail
mode = 600

zmw_local_delivery:
driver = appendfile
create_directory = true
directory_mode = 700
file = /var/spool/vmail/pibomulti-na.com/${local_part}
delivery_date_add
envelope_to_add
return_path_add
allow_symlink
user = ${extract{2} {:} {${lookup {$local_part} lsearch
{/etc/vmail/passwd.pib
omulti-na.com} {$value}}}}
group = mail
mode = 600

local_delivery:
driver = appendfile
group = mail
mode = 0660
mode_fail_narrower = false
envelope_to_add = true
file = /var/spool/mail/${local_part}

# virtual_pipe:
# driver = pipe
# command = /usr/lib/linuxconf/lib/vdeliver $local_part $domain
# return_path_add = true
# delivery_date_add = true
# envelope_to_add = true
# check_string = "From "
# escape_string = ">From "
# group = mail
# user= root


######################################################################
# DIRECTORS CONFIGURATION #
# Specifies how local addresses are handled #
######################################################################

# This allows local delivery to be forced, avoiding alias files and
# forwarding.

real_local:
prefix = real-
driver = localuser
transport = local_delivery

# 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/mail/sendmail.cV
# require_files = /etc/vmail/aliases.$domain
file = /etc/vmail/aliases.$domain
search_type = lsearch*
qualify_preserve_domain

zmw_virtual_alias:
driver = aliasfile
user = root
expand
file_transport = address_file
pipe_transport = address_pipe
domains = lsearch;/etc/mail/sendmail.cV
# require_files = /etc/vmail/aliases.$domain
file = /etc/vmail/aliases.pibomulti-na.com
search_type = lsearch*
qualify_preserve_domain

# This director handles aliasing using a traditional /etc/aliases file.
# If any of your aliases expand to pipes or files, you will need to set
# up a user and a group for these deliveries to run under. You can do
# this by uncommenting the "user" option below (changing the user name
# as appropriate) and adding a "group" option if necessary.

system_aliases:
driver = aliasfile
file_transport = address_file
pipe_transport = address_pipe
file = /etc/aliases
search_type = lsearch
user = root
group = mail

# 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/mail/sendmail.cV
condition=${lookup {$local_part} lsearch {/etc/vmail/passwd.$domain}
{$value}}

# This director matches local user mailboxes.

localuser:
driver = localuser
transport = local_delivery


/etc/exim.conf lines 347-393/457 86%