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: [email protected] [mailto:[email protected]] 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 <[email protected]> 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/