procmail
[Top] [All Lists]

Re: GREPing files in procmail conditions

2003-12-07 13:42:15
At 15:19 2003-12-07 +0100, Ralf Hagen wrote:
Sorry, I did not find the list archive there. :-(

Didn't look much I guess.  Anyway, now you're aware of it.

In fact, it was a drag to even find this list, as all references to it
on procmail.org were outdated.

As I recently posted (probably before you arrived), I've attempted to hail the various parties responsible for the list server, the procmail mail host, the procmail website, and the procmail distribution itself, in an attempt to get the pointers to the list normalized. As yet, I don't actually have a reply on that (nor any bounces).

|>b) What I plan to do - is this a valid way, or too complicated /
|>inefficient?
| Well, you could run out of LINEBUF space if there are lots of
| users in the passwd file.

Hm... can you give me a catchword of a solution that does not have this
problem?
I thought about creating a file once a day of the legal users.

Well, there's the way you're checking the recipient against valid users, and then there's the simple fact that the recipient (at your host) may not be identified in the To: field at all. Take for instance THIS message - do you see your address in the To: ? That alone should be enough to force a rethink of the approach you're using. But then, I don't know why you're doing whatever you're doing.

What I lack is a rule saying
"if a grep of the contents of the To:-Header over a file does / does not
~ produce a result"

If you must, just extract the To: header and use it in a grep.  Like so:

* ? formail -xTo: | grep -i -f userfile

(though there remain issues with this approach, not the least of which is that the To: field may not contain your local recipient, may be an email ALIAS for the user, and also, grep is going to generate a etc).

$LOGUSER contains the username that mail is being delivered on behalf of (valid at least when procmail is running as LDA). THIS would have a correlation to an /etc/passwd entry:

* ? grep ^${LOGUSER}: /etc/passwd

If someone can help me, I will gladly put this into Howto- or FAQ-Format.

I can't say that what you're asking constitutes a FAQ. <g>

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail