Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

Archiving Problems

 

 

First page Previous page 1 2 Next page Last page  View All exim users RSS feed   Index | Next | Previous | View Threaded


dbishop at rocksolidhq

Nov 12, 2011, 7:49 AM

Post #1 of 37 (1187 views)
Permalink
Archiving Problems

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/


tlyons at ivenue

Nov 14, 2011, 7:51 AM

Post #2 of 37 (1165 views)
Permalink
Re: Archiving Problems [In reply to]

On Sat, Nov 12, 2011 at 7:49 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> 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.

The issue is probably ordering. You are archiving the message first
with unseen, then processing how that message will actually get
delivered. If it's an aliased email, the alias router generates the
new email address(es) and re-runs that message through the routers,
starting at the top. If you think about this, that means you want
exim to NOT archive messages that are subject to expansion, but you DO
want exim to archive messages that are subject to local delivery or
remote delivery.

So the simple solution is to put the archiving router after the alias
expansion router and before the local delivery and remote delivery
routers (i.e. between them).

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health

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


dbishop at rocksolidhq

Nov 15, 2011, 3:38 AM

Post #3 of 37 (1170 views)
Permalink
Re: Archiving Problems [In reply to]

Thanks Todd,

I kinda figured that this was the basic problem. It makes perfect sense but I just cannot seem to find the correct place to put my archiving routers. Would you mind having a look at the config attached and poke me in the eye with the correct placement? The config is a cPanel generated config (with my add-in routers and transports).

Thanks in advance,
dean




-----Original Message-----
From: tlyons [at] sitehelp [mailto:tlyons [at] sitehelp] On Behalf Of Todd Lyons
Sent: Monday, November 14, 2011 10:52 AM
To: Dean Bishop
Cc: exim-users [at] exim
Subject: Re: [exim] Archiving Problems

On Sat, Nov 12, 2011 at 7:49 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> 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.

The issue is probably ordering. You are archiving the message first with unseen, then processing how that message will actually get delivered. If it's an aliased email, the alias router generates the new email address(es) and re-runs that message through the routers, starting at the top. If you think about this, that means you want exim to NOT archive messages that are subject to expansion, but you DO want exim to archive messages that are subject to local delivery or remote delivery.

So the simple solution is to put the archiving router after the alias expansion router and before the local delivery and remote delivery routers (i.e. between them).

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread, pasta, white rice and sugary snacks, we would wipe out almost all the problems we have with weight and diabetes and other metabolic diseases. -- Dr. Walter Willett, Harvard School of Public Health
Attachments: exim.conf (53.3 KB)


tlyons at ivenue

Nov 15, 2011, 8:16 AM

Post #4 of 37 (1170 views)
Permalink
Re: Archiving Problems [In reply to]

On Tue, Nov 15, 2011 at 3:38 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> Thanks Todd,
>
> I kinda figured that this was the basic problem. It makes perfect sense but I just cannot seem to find the correct place to put my archiving routers. Would you mind having a look at the config attached and poke me in the eye with the correct placement? The config is a cPanel generated config (with my add-in routers and transports).

That config is much more complicated than a basic aliases type of
router situation as virtual users and aliases are intermixed
throughout. In this case, you're better off IMHO continuing along
your current path: trying to find something stateful that can indicate
for a message that it has already passed through the archive router.

The route I'd try is probably something as simple as setting an
$acl_m_archived variable in the router. Test if it's unset, do the
archive, set it (assuming you can do this in routers), then subsequent
passes through the routers it will already be set and so skip the
archive for the next email that comes through.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health

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


wbh at conducive

Nov 15, 2011, 8:49 AM

Post #5 of 37 (1165 views)
Permalink
Re: Archiving Problems [In reply to]

Todd Lyons wrote:
> On Tue, Nov 15, 2011 at 3:38 AM, Dean Bishop<dbishop [at] rocksolidhq> wrote:
>> Thanks Todd,
>>
>> I kinda figured that this was the basic problem. It makes perfect sense but I just cannot seem to find the correct place to put my archiving routers. Would you mind having a look at the config attached and poke me in the eye with the correct placement? The config is a cPanel generated config (with my add-in routers and transports).
>
> That config is much more complicated than a basic aliases type of
> router situation as virtual users and aliases are intermixed
> throughout. In this case, you're better off IMHO continuing along
> your current path: trying to find something stateful that can indicate
> for a message that it has already passed through the archive router.
>
> The route I'd try is probably something as simple as setting an
> $acl_m_archived variable in the router. Test if it's unset, do the
> archive, set it (assuming you can do this in routers), then subsequent
> passes through the routers it will already be set and so skip the
> archive for the next email that comes through.
>
> Regards... Todd

Tood,

Good idea... but while router/transports can READ acl_m's...

...they cannot alter them. (..but do have a few useful variables of
their own.. not always enough)

Nearly all of mine use SQL, partly for that very reason.

NO limits, there.

CAVEAT: Don't add the extra load of an SQL environment unless you have
good cause.

It needs resources, and adds more stuff that can break.

Bill
--
韓家標

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


dbishop at rocksolidhq

Nov 16, 2011, 5:07 AM

Post #6 of 37 (1154 views)
Permalink
Re: Archiving Problems [In reply to]

Hey guys,

This all makes sense and matches my test results and reading...sadly. So the current iteration is below. It works in all respects except that it duplicates the archived copy of messages send from a locally hosted account to a locally hosted alias. The copies are identical in every way. I've added a header in the transport archiver but the router seems to ignore this added header. If I'm not mistaken this is just the way that routers work. Ignoring anything but original message headers. Is this an accurate assessment? Is there any way to add something to a message that the router can use as a flag in a condition statement? A filter maybe?

Thanks again,
dean


# 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}}}}/etc/$sender_address_domain/passwd}}{!eq{$sender_address_local_part}{root}}{!def:h_Archive_Copy:} } }
debug_print = true
unseen
no_expn
verify
transport = outgoing_local_copy
driver = accept

incoming_archiver:
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_local_copy
driver = accept



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


tlyons at ivenue

Nov 16, 2011, 5:31 AM

Post #7 of 37 (1156 views)
Permalink
Re: Archiving Problems [In reply to]

On Wed, Nov 16, 2011 at 5:07 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> Hey guys,
>
> This all makes sense and matches my test results and reading...sadly. So the current iteration is below. It works in all respects except that it duplicates the archived copy of messages send from a locally hosted account to a locally hosted alias. The copies are identical in every way. I've added a header in the transport archiver but the router seems to ignore this added header. If I'm not mistaken this is just the way that routers work. Ignoring anything but original message headers. Is this an accurate assessment? Is there any way to add something to a message that the router can use as a flag in a condition statement? A filter maybe?

When the message matches the alias router and gets rerun through the
routers, it still has the same mail queue id. In the archive router,
check if a flag file exists, do the archive if not, create the flag
file (named with the queue name, something like /tmp/exim/$queueid).
Then if it matches an alias router, when the email goes through the
routers again, the flag file exists for that mail queue id so
archiving will be skipped. Write a script that runs hourly that
cleans that /tmp/exim/ subdirectory for anything older than an hour).

Feel free to substitute any type of storage that you're willing to use
instead of flag files, such as mysql or memcache or mongodb. Memcache
can be accessed using Mike Cardwell's method of raw memcache socket
access (search the archive via google) so no external perl modules or
programming would be needed. Personally I tend to use memcache and
perl because I have memcache machines here.

Figure out what is best for you.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health

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


dbishop at rocksolidhq

Nov 30, 2011, 3:46 AM

Post #8 of 37 (1084 views)
Permalink
Re: Archiving Problems [In reply to]

Whew. Finally getting back to this.

Yes, I see your point. A PERL script using memcache sounds like just the trick. I'll have to dust off my PERL books as it's probably been 10 years since I last wrote a line (used it in combination with gawk <yoinks>)

At this point I'm pretty happy with the way it's working and can live with the infrequent duplication until I get some time to dedicate to creating the script _but_ I'm encountering one other small issue.

If a message is received for an account/alias that does not exist then I get an error:

2011-11-29 17:01:57 1RVTMY-00086X-Qi failed to open //etc/servername.domain.com/passwd for linear search: No such file or directory

I understand what's going on (you can't search a file that doesn't exist) but I can't seem to find the proper solution. The line causing me trouble is in the incoming archiver and tests to ensure that the message is addressed to a locally held account/alias:

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

Is there a better way to test to ensure that the email account/alias exists that won't generate this sort of error?

Thanks,
Dean


-----Original Message-----
From: tlyons [at] sitehelp [mailto:tlyons [at] sitehelp] On Behalf Of Todd Lyons
Sent: Wednesday, November 16, 2011 8:32 AM
To: Dean Bishop
Cc: exim users
Subject: Re: [exim] Archiving Problems

On Wed, Nov 16, 2011 at 5:07 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> Hey guys,
>
> This all makes sense and matches my test results and reading...sadly. So the current iteration is below. It works in all respects except that it duplicates the archived copy of messages send from a locally hosted account to a locally hosted alias. The copies are identical in every way. I've added a header in the transport archiver but the router seems to ignore this added header. If I'm not mistaken this is just the way that routers work. Ignoring anything but original message headers. Is this an accurate assessment? Is there any way to add something to a message that the router can use as a flag in a condition statement? A filter maybe?

When the message matches the alias router and gets rerun through the routers, it still has the same mail queue id. In the archive router, check if a flag file exists, do the archive if not, create the flag file (named with the queue name, something like /tmp/exim/$queueid).
Then if it matches an alias router, when the email goes through the routers again, the flag file exists for that mail queue id so archiving will be skipped. Write a script that runs hourly that cleans that /tmp/exim/ subdirectory for anything older than an hour).

Feel free to substitute any type of storage that you're willing to use instead of flag files, such as mysql or memcache or mongodb. Memcache can be accessed using Mike Cardwell's method of raw memcache socket access (search the archive via google) so no external perl modules or programming would be needed. Personally I tend to use memcache and perl because I have memcache machines here.

Figure out what is best for you.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread, pasta, white rice and sugary snacks, we would wipe out almost all the problems we have with weight and diabetes and other metabolic diseases. -- Dr. Walter Willett, Harvard School of Public Health



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


jgh at wizmail

Nov 30, 2011, 4:18 AM

Post #9 of 37 (1086 views)
Permalink
Re: Archiving Problems [In reply to]

On 2011-11-30 11:46, Dean Bishop wrote:
> If a message is received for an account/alias that does not exist then I get an error:
>
> 2011-11-29 17:01:57 1RVTMY-00086X-Qi failed to open //etc/servername.domain.com/passwd for linear search: No such file or directory

So check if the account exists first? At the very worst, use the existence of the
file ( ${if exists {<filename>}} ) as a proxy for the account existence?
--
Jeremy

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


dbishop at rocksolidhq

Nov 30, 2011, 4:35 AM

Post #10 of 37 (1086 views)
Permalink
Re: Archiving Problems [In reply to]

Sadly this will fail if the message is directed at an alias.

Thanks,
dean


-----Original Message-----
From: exim-users-bounces+dbishop=rocksolidhq.com [at] exim
[mailto:exim-users-bounces+dbishop=rocksolidhq.com [at] exim] On Behalf
Of Jeremy Harris
Sent: Wednesday, November 30, 2011 7:22 AM
To: exim-users [at] exim
Subject: Re: [exim] Archiving Problems

On 2011-11-30 11:46, Dean Bishop wrote:
> If a message is received for an account/alias that does not exist then
I get an error:
>
> 2011-11-29 17:01:57 1RVTMY-00086X-Qi failed to open
//etc/servername.domain.com/passwd for linear search: No such file or
directory

So check if the account exists first? At the very worst, use the
existence of the
file ( ${if exists {<filename>}} ) as a proxy for the account existence?
--
Jeremy

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



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


tlyons at ivenue

Nov 30, 2011, 5:42 AM

Post #11 of 37 (1087 views)
Permalink
Re: Archiving Problems [In reply to]

On Wed, Nov 30, 2011 at 3:46 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> I understand what's going on (you can't search a file that doesn't exist) but I can't seem to find the proper solution. The line causing me trouble is in the incoming archiver and tests to ensure that the message is addressed to a locally held account/alias:
>
> local_parts = lsearch;${extract{5}{:}{${lookuppasswd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd
>
> Is there a better way to test to ensure that the email account/alias exists that won't generate this sort of error?

The easiest way seems to be to go the manual route and make two copies
of the archiver. Have the first router detect if it's an alias and if
it is (you'll have to construct a "condition" statement that does this
for you), then don't do the passwd check above. Instead do a more
limited test to determine if the alias is valid. The second router
should basically detect if it's NOT an alias and then do the
local_parts test above.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health

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


dbishop at rocksolidhq

Dec 1, 2011, 12:07 PM

Post #12 of 37 (1086 views)
Permalink
Re: Archiving Problems [In reply to]

Grrrr....still can't seem to get this working. I'm at my wit's end. If I understand this correctly the incoming_archiver router is passing messages to the router even though they are directed to non-existent accounts/aliases.

All of the accounts are listed in folders that my local_parts directive expands and the aliases are all in files named /etc/valiases/$domain. So I need to prevent this router from routing if the $local_part of the message does not exist in either of these files.

Todd, I understand on a basic level what you are saying but I cannot figure out how to accomplish it. Would it be possible to get you to have a look at the current router config below and show me what I should be doing?

Many thanks,
dean


incoming_archiver:
#condition = ${if and {{exists{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd}}{!eq{$local_part}{root}}} }
#condition = ${if and {{eq{lsearch;${extract{5}{:}{${lookup passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$sender_address_domain/passwd}{$sender_address_local_part}}{eq{lsearch;/etc/valiases/$sender_address_domain}{$sender_address_local_part} }}}
#condition = ${if and {{exists{${extract{5}{:}{${lookup passwd{${lookup{$sender_address_domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}}}{exists{${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}}}}} }
###
### Need to ensure that this address exists as an account or alias
### should be able to do this by ensuring that it is in
### /etc/valiases/$domain
###
#condition = ${if {lookup {$local_part}lsearch;{/etc/valiases/$doamin}fail}}
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_local_copy
driver = accept


-----Original Message-----
From: tlyons [at] sitehelp [mailto:tlyons [at] sitehelp] On Behalf Of Todd Lyons
Sent: Wednesday, November 30, 2011 8:43 AM
To: Dean Bishop
Cc: exim users
Subject: Re: [exim] Archiving Problems

On Wed, Nov 30, 2011 at 3:46 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> I understand what's going on (you can't search a file that doesn't exist) but I can't seem to find the proper solution. The line causing me trouble is in the incoming archiver and tests to ensure that the message is addressed to a locally held account/alias:
>
> local_parts =
> lsearch;${extract{5}{:}{${lookuppasswd{${lookup{$domain}lsearch*{/etc/
> userdomains}{$value}}}{$value}}}}/etc/$domain/passwd
>
> Is there a better way to test to ensure that the email account/alias exists that won't generate this sort of error?

The easiest way seems to be to go the manual route and make two copies of the archiver. Have the first router detect if it's an alias and if it is (you'll have to construct a "condition" statement that does this for you), then don't do the passwd check above. Instead do a more limited test to determine if the alias is valid. The second router should basically detect if it's NOT an alias and then do the local_parts test above.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread, pasta, white rice and sugary snacks, we would wipe out almost all the problems we have with weight and diabetes and other metabolic diseases. -- Dr. Walter Willett, Harvard School of Public Health



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


tlyons at ivenue

Dec 1, 2011, 12:12 PM

Post #13 of 37 (1080 views)
Permalink
Re: Archiving Problems [In reply to]

On Thu, Dec 1, 2011 at 12:07 PM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> Grrrr....still can't seem to get this working. I'm at my wit's end. If I understand this correctly the incoming_archiver router is passing messages to the router even though they are directed to non-existent accounts/aliases.

Right. So whatever test you do to determine if it's an existing user
or alias in the respective router, you also need to do on this archive
router.

...Todd

--
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health

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


dbishop at rocksolidhq

Dec 1, 2011, 2:18 PM

Post #14 of 37 (1026 views)
Permalink
Re: Archiving Problems [In reply to]

Arg. This is so frustrating. Try as I might I just don't see anything of the sort in the routers. Is it possible that it's handled in another way?

I've attached just the routers and the whole bloody config. I'll buy you beer :) it'd be cheaper than replacement hair therapy.

Thanks,
dean



-----Original Message-----
From: exim-users-bounces+dbishop=rocksolidhq.com [at] exim [mailto:exim-users-bounces+dbishop=rocksolidhq.com [at] exim] On Behalf Of Todd Lyons
Sent: Thursday, December 01, 2011 3:16 PM
To: Dean Bishop
Cc: exim users
Subject: Re: [exim] Archiving Problems

On Thu, Dec 1, 2011 at 12:07 PM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> Grrrr....still can't seem to get this working. I'm at my wit's end. If I understand this correctly the incoming_archiver router is passing messages to the router even though they are directed to non-existent accounts/aliases.

Right. So whatever test you do to determine if it's an existing user or alias in the respective router, you also need to do on this archive router.

...Todd

--
If Americans could eliminate sugary beverages, potatoes, white bread, pasta, white rice and sugary snacks, we would wipe out almost all the problems we have with weight and diabetes and other metabolic diseases. -- Dr. Walter Willett, Harvard School of Public Health

--
## 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/
Attachments: exim routers.txt (6.47 KB)
  exim.conf (50.6 KB)


dbishop at rocksolidhq

Dec 2, 2011, 6:00 AM

Post #15 of 37 (1075 views)
Permalink
Re: Archiving Problems [In reply to]

Hallelujah!!! I've almost got it!

It looks as though I can use require_files to eliminate the errors. Basically I need to determine if the passwd file exists for the domain.

If I hard-code:

Require_files = /home/[cpanel-accountname]/etc/domain.com/passwd-badname

Then the errors are eliminated and even if my expansion does not work (which is does not) I still get no errors. Perfect. Well almost.

All I need to do is variablize the require_files. This is where my simple, mushy brain could really use some assistance.

The first part of the file path (/home/[cpanel-accountname]) is stored in the main /etc/passwd file
[cpanel-accountname]:x:503:501::/home/[cpanel-accountname]:/bin/bash

The following works for my local_parts to get that bit out
local_parts = lsearch;${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}}{$value}}}}/etc/$domain/passwd

but I cannot seem to replicate it for my require_files. This is my current iteration. It keeps complaining about a missing close brace but it seems like I've closed them all.
require_files = lsearch;${extract{5}{:}{${lookup passwd{${lookup{$domain}lsearch*{/etc/userdomains}{$value}}} {$value}}}}/etc/$domain/passwd

where am I going wrong??

Again, thanks for the help,
dean

-----Original Message-----
From: tlyons [at] sitehelp [mailto:tlyons [at] sitehelp] On Behalf Of Todd Lyons
Sent: Wednesday, November 30, 2011 8:43 AM
To: Dean Bishop
Cc: exim users
Subject: Re: [exim] Archiving Problems

On Wed, Nov 30, 2011 at 3:46 AM, Dean Bishop <dbishop [at] rocksolidhq> wrote:
> I understand what's going on (you can't search a file that doesn't exist) but I can't seem to find the proper solution. The line causing me trouble is in the incoming archiver and tests to ensure that the message is addressed to a locally held account/alias:
>
> local_parts =
> lsearch;${extract{5}{:}{${lookuppasswd{${lookup{$domain}lsearch*{/etc/
> userdomains}{$value}}}{$value}}}}/etc/$domain/passwd
>
> Is there a better way to test to ensure that the email account/alias exists that won't generate this sort of error?

The easiest way seems to be to go the manual route and make two copies of the archiver. Have the first router detect if it's an alias and if it is (you'll have to construct a "condition" statement that does this for you), then don't do the passwd check above. Instead do a more limited test to determine if the alias is valid. The second router should basically detect if it's NOT an alias and then do the local_parts test above.

Regards... Todd
--
If Americans could eliminate sugary beverages, potatoes, white bread, pasta, white rice and sugary snacks, we would wipe out almost all the problems we have with weight and diabetes and other metabolic diseases. -- Dr. Walter Willett, Harvard School of Public Health



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


wbh at conducive

Dec 2, 2011, 6:19 AM

Post #16 of 37 (1070 views)
Permalink
Re: Archiving Problems [In reply to]

Dean Bishop wrote:
> Hallelujah!!! I've almost got it!
>
*snip* details...

>> Is there a better way to test to ensure that the email
>> account/alias exists that won't generate this sort of error?
>

Been trying to keep my mouf shut, but all the while wondering why your
acl_smtp_rcpt woudn't have rejected traffic for an account you can't
deliver to right up front.

In which case it would never reach the router/transports.

CAVEAT: I'm probably biased because OUR users have to ask the MailAdmin
to set an alias for them. They aren't enabled to do it themselves.

That way we can check if it is valid.

If they want to play independent random games with aliases that may or
may not exist, they can go off and run their own damn Mailserver.

JM2CW

Bill
--
韓家標

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


dbishop at rocksolidhq

Dec 2, 2011, 9:07 AM

Post #17 of 37 (1071 views)
Permalink
Re: Archiving Problems [In reply to]

Hey Bill,

A great question. Sadly not one that I have an answer to. Half of this battle is trying to sift through cPanel's stock exim.conf which is extraordinarily convoluted (at least to me). I know that there are a thousand config combinations and permutations available in cPanel so I expect that something buried in there is the root reason for it not rejecting traffic using the acl.

I wish I knew but I think that even if I did, it wouldn't help as I have to thread changes into their rats nest.

My 2c in return; keep the change :)

Later,
dean

Dean Bishop
Rock Solid Computer Services
Office: 705-222-HELP(4357)
Cell: 705-662-8807




-----Original Message-----
From: exim-users-bounces+dbishop=rocksolidhq.com [at] exim [mailto:exim-users-bounces+dbishop=rocksolidhq.com [at] exim] On Behalf Of W B Hacker
Sent: Friday, December 02, 2011 11:38 AM
To: exim users
Subject: Re: [exim] Archiving Problems

Dean Bishop wrote:
> Hallelujah!!! I've almost got it!
>
*snip* details...

>> Is there a better way to test to ensure that the email account/alias
>> exists that won't generate this sort of error?
>

Been trying to keep my mouf shut, but all the while wondering why your acl_smtp_rcpt woudn't have rejected traffic for an account you can't deliver to right up front.

In which case it would never reach the router/transports.

CAVEAT: I'm probably biased because OUR users have to ask the MailAdmin to set an alias for them. They aren't enabled to do it themselves.

That way we can check if it is valid.

If they want to play independent random games with aliases that may or may not exist, they can go off and run their own damn Mailserver.

JM2CW

Bill
--
韓家標

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


dbishop at rocksolidhq

Dec 2, 2011, 9:26 AM

Post #18 of 37 (1064 views)
Permalink
Re: Archiving Problems [In reply to]

One step closer.

I have the expansion worked out and it has at least stopped generating NDR's. Now it's just generating errors in the log.

I know it seems like a minor issue but our system has a security manager on it that sees these errors and tosses an e-mail at us to alert us. I figure I know the answer already but is there a way to suppress the error in just this router?

Thanks again,
dean

-----Original Message-----
From: exim-users-bounces+dbishop=rocksolidhq.com [at] exim [mailto:exim-users-bounces+dbishop=rocksolidhq.com [at] exim] On Behalf Of W B Hacker
Sent: Friday, December 02, 2011 11:38 AM
To: exim users
Subject: Re: [exim] Archiving Problems

Dean Bishop wrote:
> Hallelujah!!! I've almost got it!
>
*snip* details...

>> Is there a better way to test to ensure that the email account/alias
>> exists that won't generate this sort of error?
>

Been trying to keep my mouf shut, but all the while wondering why your acl_smtp_rcpt woudn't have rejected traffic for an account you can't deliver to right up front.

In which case it would never reach the router/transports.

CAVEAT: I'm probably biased because OUR users have to ask the MailAdmin to set an alias for them. They aren't enabled to do it themselves.

That way we can check if it is valid.

If they want to play independent random games with aliases that may or may not exist, they can go off and run their own damn Mailserver.

JM2CW

Bill
--
韓家標

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


wbh at conducive

Dec 2, 2011, 1:40 PM

Post #19 of 37 (1061 views)
Permalink
Re: Archiving Problems [In reply to]

Dean Bishop wrote:
> Hey Bill,
>
> A great question. Sadly not one that I have an answer to. Half of
> this battle is trying to sift through cPanel's stock exim.conf which
> is extraordinarily convoluted (at least to me). I know that there
> are a thousand config combinations and permutations available in
> cPanel so I expect that something buried in there is the root reason
> for it not rejecting traffic using the acl.
>
> I wish I knew but I think that even if I did, it wouldn't help as I
> have to thread changes into their rats nest.
>
> My 2c in return; keep the change :)
>
> Later, dean

I can't be bothered with CPanel or Sputniks when a text-editor gives me
less backtalk.

'Conventionally' The acl code is a one-liner:

require_verify = recipient

CAVEAT: What this does is a 'router walk', asking each router in turn
that does NOT have the 'no_verify' flag set if it COULD deliver that
message IF asked. Sort of a show of hands - not a real delivery.

The caveat is that you must not have a promiscuous or 'leaky' router -
one that is willing to drop trou and take anything and everything poked
at it.

A 'blackhole' router (bad practice anyway) and SOME types of ALIAS
routers can be just that sort of 'leak', and you may WANT it to
participate in verification. Catch 22.

If/as/when that is problematic, I use an SQL call instead and don't look
at the router chain at all.

But .. one THEN has to make sure that EVERYONE, even aliases and
'postmaster@' exist in the DB.

- Downside is the overhead of an SQL engine.

- Upside is editing of ALL users in one place, and with separate privs
from Exim. IOW - can be compartmentalized with the DB's rights control
toolset and handed-off to one or more outsiders who are restricted to
managing only ther own sub-clan, and cannot touch Exim itself.

===

Otherwise...

Pragmatically, I tend to use negated tests, as I am more accustomed to
'stacking' the conditionals, so my code is of the form:

deny
!verify = recipient


...or IF one has not ALREADY done an 'accept' to exempt your own
user-group, who are not sending to ONLY local destinations, then:

===

deny
!authenticated = *
!verify = recipient

===

Functional flow is like this:

Deny

but not if the caller is authenticated
if you got this far, and the recipient cannot be verified

===

There's the change back for the 2cents change from the 2 ... nevermind..

;-)

Bill
--
韓家標

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


dbishop at rocksolidhq

Dec 3, 2011, 7:36 AM

Post #20 of 37 (1045 views)
Permalink
Re: Archiving Problems [In reply to]

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/


wbh at conducive

Dec 3, 2011, 9:19 AM

Post #21 of 37 (1048 views)
Permalink
Re: Archiving Problems [In reply to]

Dean Bishop wrote:

*snip*

The one outstanding issue is the duplication of
> outgoing archived messages when a message is sent from a local
> account to a local alias.

Interesting. Dig deeper.

Exim can tell - or be allowed to find out - the difference.

You can use that to craft the router you need.

Our local-to-local, for example were the only ones that were NOT archived.

We already had 'good enough' chance of preservation with both ends being
on the same box.

Bill
--
韓家標

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


dbishop at rocksolidhq

Dec 3, 2011, 10:13 AM

Post #22 of 37 (1046 views)
Permalink
Re: Archiving Problems [In reply to]

W B Hacker wrote:

Exim can tell - or be allowed to find out - the difference.

Hmmmm....

Okay you've dragged me back in :)
The difference between what? I've looked at the archived messages and they are identical.
They are both being sent from the same machine (so local-to-local) and are from the same sender. Even the messageID is the same.

You have me intrigued though. Can you explain what you mean?

Thanks,
dean



-----Original Message-----
From: exim-users-bounces+dbishop=rocksolidhq.com [at] exim [mailto:exim-users-bounces+dbishop=rocksolidhq.com [at] exim] On Behalf Of W B Hacker
Sent: Saturday, December 03, 2011 12:25 PM
To: exim users
Subject: Re: [exim] Archiving Problems

Dean Bishop wrote:

*snip*

The one outstanding issue is the duplication of
> outgoing archived messages when a message is sent from a local account
> to a local alias.

Interesting. Dig deeper.

Exim can tell - or be allowed to find out - the difference.

You can use that to craft the router you need.

Our local-to-local, for example were the only ones that were NOT archived.

We already had 'good enough' chance of preservation with both ends being on the same box.

Bill
--
韓家標

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


chris+exim at qwirx

Dec 3, 2011, 11:10 AM

Post #23 of 37 (1044 views)
Permalink
Re: Archiving Problems [In reply to]

Hi Dean,

On Sat, 3 Dec 2011, Dean Bishop wrote:

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

Why so complicated? Why two routers?

The problem seems to be that when a message is directed to an alias, each
expansion of the alias is passed down the entire router stack again,
resulting in duplicates for each one. (If I misunderstood this, please
ignore the rest of this email).

You can avoid this by setting redirect_router on all your redirect
routers, setting it to the router after incoming_archiver, like this:

begin routers

outgoing_archiver: ...

incoming_archiver: ...

dnslookup:
# or whatever your next router is

aliases:
driver = redirect
data = ${lookup{$local_part}wildlsearch{/etc/exim/domains/$domain}}
# this is the important part:
# don't archive redirected emails again!
redirect_router = dnslookup
...

Cheers, Chris.
--
_____ __ _
\ __/ / ,__(_)_ | Chris Wilson <chris+sig [at] qwirx> Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\__/_/_/_//_/___/ | We are GNU : free your mind & your software |

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


dbishop at rocksolidhq

Dec 3, 2011, 11:31 AM

Post #24 of 37 (1041 views)
Permalink
Re: Archiving Problems [In reply to]

Hey Chris,

I'm not sure if you've misunderstood but then maybe I'm misunderstanding
your message :).

The only two routers involved in the archiving are the incoming router
and the outgoing router.

The way I understand it, and this is based on what I consider my pretty
slim knowledge of exim, is that when a message is being sent to the
local alias from the local account the message is first archived as it
passes through as it's being sent from sender's local account and then
the outgoing message is archived again as it sent from the local alias
to the recipient's local account.

It's this last piece that I cannot figure out how to avoid. How do I
make the router ignore messages that are being passed through during the
re-direction from alias to account?

Thanks,
dean



-----Original Message-----
From: Chris Wilson [mailto:chris+exim [at] qwirx]
Sent: Saturday, December 03, 2011 2:11 PM
To: Dean Bishop
Cc: exim-users [at] exim
Subject: Re: [exim] Archiving Problems

Hi Dean,

On Sat, 3 Dec 2011, Dean Bishop wrote:

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

Why so complicated? Why two routers?

The problem seems to be that when a message is directed to an alias,
each expansion of the alias is passed down the entire router stack
again, resulting in duplicates for each one. (If I misunderstood this,
please ignore the rest of this email).

You can avoid this by setting redirect_router on all your redirect
routers, setting it to the router after incoming_archiver, like this:

begin routers

outgoing_archiver: ...

incoming_archiver: ...

dnslookup:
# or whatever your next router is

aliases:
driver = redirect
data =
${lookup{$local_part}wildlsearch{/etc/exim/domains/$domain}}
# this is the important part:
# don't archive redirected emails again!
redirect_router = dnslookup
...

Cheers, Chris.
--
_____ __ _
\ __/ / ,__(_)_ | Chris Wilson <chris+sig [at] qwirx> Cambs UK | / (_/
,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\__/_/_/_//_/___/ | We are GNU : free your mind & your software |



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


chris at qwirx

Dec 3, 2011, 1:18 PM

Post #25 of 37 (1022 views)
Permalink
Re: Archiving Problems [In reply to]

Hi Dean,

On Sat, 3 Dec 2011, Dean Bishop wrote:

> I'm not sure if you've misunderstood but then maybe I'm misunderstanding
> your message :).
>
> The only two routers involved in the archiving are the incoming router
> and the outgoing router.

Yes, I'm not sure why you need to separate them?

> The way I understand it, and this is based on what I consider my pretty
> slim knowledge of exim, is that when a message is being sent to the
> local alias from the local account the message is first archived as it
> passes through as it's being sent from sender's local account and then
> the outgoing message is archived again as it sent from the local alias
> to the recipient's local account.
>
> It's this last piece that I cannot figure out how to avoid. How do I
> make the router ignore messages that are being passed through during the
> re-direction from alias to account?

In that case I think that the solution I proposed should apply to your
case.

Cheers, Chris.
--
_____ __ _
\ __/ / ,__(_)_ | Chris Wilson <chris+sig [at] qwirx> Cambs UK |
/ (_/ ,\/ _/ /_ \ | Security/C/C++/Java/Ruby/Perl/SQL Developer |
\__/_/_/_//_/___/ | We are GNU : free your mind & your software |

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

First page Previous page 1 2 Next page Last page  View All exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.