# Include this configuration snippet into your amavisd.conf file to share
# a common list of virtual domains resp. local domains between exim and
# amavis. Put it after the comment section of " Lookup list of local domains".
# You may need to replace the existing code about local_domains_acl.
#
# You do not need this code if you maintain a single column list conatining
# all domain names which you receive mail for. In this case use amavis
# read_hash(). 
# If your file happens to be multi column, with the local domains
# in the first one and as a separator string a colon, then use this code. The
# method described in the "Debian Exim with Virtual Domains Pseudo-HOW-TO"
# is alike. You can also adopt this code for other separator characters and
# file path. You can find the separator string between the two backslashes
# below, after "my @domain = split(".

 @local_domains_acl;                    # Clearing the variable
 push(@local_domains_acl,$mydomain);    # include $mydomain
 
# Populate @local_domains_acl with the first column
# of /etc/exim/virtual_domains eliminating all comments
   open (VIRTDOM, "/etc/exim/virtual_domains");
   foreach my $d (<VIRTDOM>) {
           chomp($d);
           unless ($d =~ "^[:space:]*#" or $d eq "" ) {
              my @domain = split(/:/, $d);
              push(@local_domains_acl,@domain[0]);
           }
   }
   close(VIRTDOM);

# This is based on the code of Roberto Suarez in the amavis user
# mailinglist: AMaViS-user@lists.sourceforge.net on 2005-02-24 10:09:28
# (see http://marc.theaimsgroup.com/?l=amavis-user&m=110923985901128&w=2).

# (c) 2005 under GPL. Andreas Moor and Adrian Zaugg.

