virtual domain configure file example

Top Page
Delete this message
Reply to this message
Author: mark david mcCreary
Date:  
To: exim-users
Subject: virtual domain configure file example
fyi

The following setup appears to be working in test at this time. It is designed to handle virtual domains with one alias file.

The virtual domain alias file must have one line for each domain name, corresponding to the default delivery address for that domain.

    aaa.com:    joe@???


Additional lines for each domain name may be present, and if incoming mail matches one of the specific lines, then mail is sent to the corresponding address on that line.

In addition, any email address at a virtual domain can be expanded into 2 or more addresses via a second alias file.

My thanks to Philip for the coding, and everybody else who figured this out and posted the clues.



######################################################################
#                  Runtime configuration file for Exim               #
######################################################################
######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################


accept_timeout = 60s

always_bcc

delay_warning = 0s

deliver_load_max = 3

freeze_tell_mailmaster

local_domains_include_host_literals

# virtual machine only
local_domains = "@:partial-lsearch;/etc/aliases.virtual:[127.0.0.1]"


# uncomment for appropriate machine if virtual web server present

#local_interfaces = "207.108.113.139:127.0.0.1"

log_ip_options

log_level = 3

log_received_recipients

log_smtp_confirmation

log_subject

#never_users = root

queue_run_max = 5

queue_only

smtp_accept_max = 35

smtp_accept_queue = 15

smtp_accept_reserve = 10

smtp_connect_backlog = 30

trusted_users = "exim:list"

relay_domains_include_local_mx

sender_net_accept_relay = "207.108.113.0/24"

ignore_errmsg_errors

check_spool_space = 10M
check_spool_inodes = 100

check_log_space = 10M
check_log_inodes = 100

collapse_source_routes

headers_checks_fail
headers_sender_verify_errmsg

log_arguments

end



######################################################################
#                      TRANPORTS CONFIGURATION                       #
######################################################################


# This transport is used for local delivery to user mailboxes.

local_delivery:
driver = appendfile;
file = /home/ftp/popuser/${local_part},
group = popuser



# This transport is used for handling pipe addresses generated by alias
# or .forward files. It has a conventional name, since it is not actually
# mentioned elsewhere in this configuration file.

address_pipe:
driver = pipe;
ignore_status,
# return_output
# return_fail_output

# This transport is used to pass an incoming message to procmail for delivery
#

procmail_pipe:
driver = pipe;
command = "/usr/bin/procmail -d ${local_part}",
user = exim


# This transport is used for handling file addresses generated by alias
# or .forward files. It has a conventional name, since it is not actually
# mentioned elsewhere in this configuration file.

address_file:
driver = appendfile

# This transport is used for handling autoreplies generated by the filtering
# option of the forwardfile director. It has a conventional name, since it
# is not actually mentioned elsewhere in this configuration file.

address_reply:
driver = autoreply

# This transport is used for delivering messages over SMTP connections.

smtp:
driver = smtp;
end




######################################################################
#                      DIRECTORS CONFIGURATION                       #
######################################################################


# pick off any mail to postmaster, hostmaster for any domain

postmaster:
driver = smartuser,
local_parts = postmaster:hostmaster;
new_address = postmaster@???


# This director handles virtual domains - matching explicit user name.

virtual_specific:
driver = smartuser,
new_director = dual_aliases,
domains = "partial-lsearch;/etc/aliases.virtual";
new_address = ${lookup{$local_part@$domain}lsearch{/etc/aliases.virtual} {$value} fail};

# If exact user name was not found in previous step, use default address

virtual_default:
driver = smartuser,
new_director = dual_aliases,
domains = "partial-lsearch;/etc/aliases.virtual";
new_address = ${lookup{$domain}lsearch{/etc/aliases.virtual} {$value} fail};

# send one message to several addresses for virtual domain customers

dual_aliases:
driver = aliasfile;
file = /etc/aliases.dual,
search_type = lsearch,
user = exim

# Bozo addresses to the bit bucket. Use :Blackhole:

bozo_aliases:
driver = aliasfile;
file = /etc/aliases.bozo,
search_type = lsearch,
user = exim

# Basic system mail aliases

system_aliases:
driver = aliasfile;
file = /etc/aliases.exim,
search_type = lsearch,
user = exim

# This director matches local user mailboxes.

localuser:
driver = localuser,
transport = local_delivery;


end



######################################################################
#                      ROUTERS CONFIGURATION                         #
######################################################################


# This router routes to remote hosts over SMTP using a DNS lookup with
# default options.

lookuphost:
driver = lookuphost,
transport = smtp;

# This router routes to remote hosts over SMTP by explicit IP address,
# given as a "domain literal" in the form [nnn.nnn.nnn.nnn]. The RFCs
# require this facility, which is why it is enabled by default in Exim.
# If you want to lock it out, set forbid_domain_literals in the main
# configuration section above.

literal:
driver = ipliteral,
transport = smtp;

end



######################################################################
#                      RETRY CONFIGURATION                           #
######################################################################


# This single retry rule applies to all domains and all errors. It specifies
# retries every 15 minutes for 2 hours, then increasing retry intervals,
# starting at 2 hours and increasing each time by a factor of 1.5, up to 16
# hours, then retries every 8 hours until 4 days have passed since the first
# failed delivery.

# Domain               Error       Retries
# ------               -----       -------


*                      *           F,2h,10m; G,16h,1h,1.5; F,3d,8h


end



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


# There are no rewriting specifications in this default configuration file.

# End of Exim configuration file








Where /etc/aliases.virtual looks like

aaa.com:    joe@???
bbb.com:    sam@???
sales@???:    larry@???
info@???:    sue@???
ccc.com:    alias-ccc.com@???




Where /etc/aliases.dual looks like

alias-ccc.com:    harry@???, greg@???











mark david mcCreary
Internet Tools, Inc.            1436 West Gray #438
mdm@???          Houston, Texas 77019
http://www.internet-tools.com    713.627.9600




--
* This is sent by the exim-users mailing list.  To unsubscribe send a
    mail with subject "unsubscribe" to exim-users-request@???
* Exim information can be found at http://www.exim.org/