Re: [exim] Archiving Problems

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Dean Bishop
Date:  
À: exim users
CC: Todd Lyons
Sujet: Re: [exim] Archiving Problems
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@??? [mailto:tlyons@sitehelp.org] 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@???> 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