Hey Bill,

        Wow!  Thanks for the details!!  cPanel definitely adds a butt load of 
complication to things but hosting hundreds of websites is just too much bloody 
work without some management middleware.

        At the end of the day, thanks to the list, I have what I consider to be 
a workable solution.  I've resolved the NDR and exim log error message issue.  
The one outstanding issue is the duplication of outgoing archived messages when 
a message is sent from a local account to a local alias.

        There have been some suggestions that a quick PERL script that uses 
memcache to cache the messageID's so that they can be compared in the 
outgoing_archiver router but I just don't have the time to dreg up my old PERL 
notes.  I figure that this is a pretty minor issue anyway.

        So, for anyone that was following, or stumbles across this in need of 
an archiver, this seems to be a working solution.  If there are issues that 
someone encounters or if someone has the time to resolve the aforementioned 
duplication issue, please contribute and cc me @ dbishop<at>rocksolidhq.com

        Just keep in mind that this is geared towards cPanel.

Thanks again,
Dean

ROUTERS
# Dean's Archiver Router
outgoing_archiver:
# works but duplicates messages sent from local to a local alias
condition = ${if and {{exists{${extract{5}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/$sender_address_domain/$sender_address_local_part}}{!eq{$sender_address_local_part}{root}}
 } }
debug_print = true
unseen
no_expn
verify
transport = outgoing_local_copy
driver = accept

incoming_archiver:
require_files = "+${extract{5}{::}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd"
condition = ${lookup {$local_part} lsearch{${extract{5}{:}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd}{true}{false}}
no_expn
no_verify
unseen
domains = +local_domains
transport = incoming_local_copy
driver = accept

TRANSPORTS
# Dean's Archiver Transport
incoming_local_copy:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  directory = "${extract{5}{:}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}/.Archive.Incoming"
  maildir_use_size_file
  maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  maildir_format
  maildir_tag = ,S=$message_size
  quota_size_regex = ,S=(\d+)
  mode = 0660
  quota = "${if exists{${extract{5}{:}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota}
 {${lookup{$local_part}lsearch*{${extract{5}{:}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${domain}/quota}{$value}}}
 {}}"
  quota_is_inclusive = false
  quota_directory = "${extract{5}{:}{${lookup 
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${domain}/${local_part}"
  return_path_add
  user = "${lookup{$domain}lsearch* {/etc/userdomains}{$value}}"
  group = ${extract{3}{:}{${lookup passwd{${lookup{$domain}lsearch* 
{/etc/userdomains}{$value}}}{$value}}}}


outgoing_local_copy:
  driver = appendfile
  delivery_date_add
  envelope_to_add
  directory = "${extract{5}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${sender_address_domain}/${sender_address_local_part}/.Archive.Outgoing"
  maildir_use_size_file
  maildir_quota_directory_regex = ^(?:cur|new|\.(?!Trash$)[^\@]+)$
  maildir_format
  maildir_tag = ,S=$message_size
  quota_size_regex = ,S=(\d+)
  mode = 0660
  quota = "${if exists{${extract{5}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${sender_address_domain}/quota}
 {${lookup{$sender_address_local_part}lsearch*{${extract{5}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/${sender_address_domain}/quota}{$value}}}
 {}}"
  quota_is_inclusive = false
  quota_directory = "${extract{5}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/mail/${sender_address_domain}/${sender_address_local_part}"
  return_path_add
   user = "${extract{2}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}"
   group = "${extract{2}{:}{${lookup 
passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}"

  
  
-- 
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to