procmail
[Top] [All Lists]

/var/db/passwd.db

2003-10-22 02:37:18
Hi All,

I'm using procmail 3.22 & inetd as a LMTP client. Most of the users' accounts are defined in /var/db, a few are defined in /etc/passwd (I have an nsswitch.conf entry "passwd: files db").

If I have this procmailrc:

> DEFAULT=$HOME/Maildir/
> LOGFILE=/var/log/procmail.log
> VERBOSE=off
>
> DROPPRIVS=yes
>
> :0HD
> * X-Sift_SpamFound:
> $HOME/Spam/

then all messages which have a header X-Sift_SpamFound: get dumped in the users' Spam maildir in their home directory, all other messages get dumped in the users' Maildir maildir in their home directory; so far so good.

If I have this procmailrc:

> DEFAULT=$HOME/Maildir/
> LOGFILE=/var/log/procmail.log
> VERBOSE=on
>
> :0HD
> * ^X-Sift_SpamFound:
> | ( F="$HOME/Spam/new/`date +%s`.$RANDOM.$$" ; grep -v '^X-Sift_SpamFound:' - > $F ; chown $LOGNAME:apache $F ; chmod 660 $F )

What should happen is that messages with the X-Sift_SpamFound: header should get put into a file "$HOME/Spam/new/`date +%s`.$RANDOM.$$" with the X-Sift_SpamFound: line removed, and then have chown/chmod alter the file's permissions. However, this only works with users which are defined in /etc/passwd, mail for users in /var/db simply vanishes. I've even tried it with an action line:

> | ( F="$HOME/Spam/new/`date +%s`.$RANDOM.$$" ; cat - > $F )

in case there's something screwy about the grep or the chmod/chown stuff. Can someone enlighten me please? Alternatively, can someone suggest another program to use as a lmtp server which will allow me to accomplish this task i.e. if the message has the X-Sift_SpamFound: header, then dump it in a different maildir in the users' home directory and change the permissions.

Thanks.


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

<Prev in Thread] Current Thread [Next in Thread>