Hey,

 

                So I'm working on getting all incoming and outgoing
messages to be archived on my system.  For the most part it works but
e-mail aliases cause my solution to fall short.  I'm absolutely new to
exim and know that there are things that I just don't get.

 

                In the configuration below the result is that messages
sent to aliases are being processed twice by the outgoing_archiver
router and this causes in duplication in the outgoing archive.  It also
attempts to archive messages sent by an aliased address in a directory
name which is based on the sender_address_local_part which is the alias
rather than the actual account.  I've been at this for a couple of weeks
but just cannot find a solution.

 

                I had tried to add a header during the routing to
prevent the duplication but the unseen router drops the added headers
and I simply could not figure out how to get around that.  i also
thought of ensuring that the sender_address_local_part exists as an
account on the system but this prevents messages sent by the alias from
being archived.  Grrrr.  The headers_add still seems like the best
option but I just cannot figure it out.  I've run across post about
using ACL's and filters but again my noobness tripped me up and I could
not wrap my head around it.

 

                As for the issue of archiving messages sent by aliases I
need to find a way to map the alias to the actual account.  This just
struck me a 1a last night so I haven't spent much time on this yet.  I'm
pretty sure that this isn't a simple thing for me to figure out though.

 

                Can someone please put me out of my misery and lend a
hand?  It would be very much appreciated as my head is mushy from trying
to get this figured out.

 

Thanks in advance,

Dean

 

 

# Dean's Archiver Router

outgoing_archive_router:

#condition = ${if !def:h_X-Spam-Flag:}

condition = ${if !eq{$sender_address_local_part}{root}}

debug_print = true

unseen

no_expn

verify

transport = outgoing_archive_transport

driver = accept

 

incoming_archive_router:

#headers_add = "Archive_Copy: YESr"

condition = ${if !def:h_Archive_Copy:}

no_expn

no_verify

unseen

domains = +local_domains

local_parts = lsearch;${extract{5}{:}{${lookup
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/
etc/$domain/passwd

transport = incoming_archive_transport

driver = accept

#driver = redirect

#redirect_router = post_incoming

#data = ${lookup{$local_part}lsearch{/etc/aliases}}

#data = lsearch;${extract{5}{:}{${lookup
passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/
etc/$domain/passwd

#data = $local_part@$domain

 

#

# Causes Incoming mail to _only_ go to Archive

#

#post_incoming:

#no_expn

#no_verify

#driver = accept

#headers_add = "Archive_Copy: YESpi"

 

 

 

# Dean's Archiver Transport

incoming_archive_transport:

  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}}}}

  headers_add = "Archive_Copy: YESt"

 

 

outgoing_archive_transport:

  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}}}}"

#  headers_add = "Archive_Copy: YESto"

-- 
## 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