procmail
[Top] [All Lists]

Re: procmail: small filters need sleep 1

2004-09-05 18:02:58
Dan Jacobson wrote:

David> I don't remember how find's exit codes work
Always 0 here. So I want to test the string it might produce.

OK.

Perhaps I can even use an internal procmail string match function
instead of the external call to "test" here?:
* ? test `find $LAST_LOGIN_FILE -mtime +333`
then just needing the single call to find.

It wouldn't be an improvement, because you'd have to save it in a variable first:

 :0
 * the other conditions
 {
  throwawaystring=`find $LAST_LOGIN_FILE -mtime +333`

  :0hWc:locallockfile
  * throawaystring ?? .
  | formail -D size cachename

  :0e and the other flags
  | formail -r andwhatevertherestwas
 }

Perhaps I needed sleep 1 to avoid the 'early closed pipe' mentioned on
procmailrc(5).

If sleep can fool procmail out of recognizing a write error, that's a bug in procmail.

"i" must have fixed it.  But now I don't need "i" either.

Right, because now test "`find ...`" is in the conditions. So the action will either use the input or not run at all; it won't ever run without using the input.

\<$\LOGNAME\> is from procmailex(5). BTW I suppose LOGNAME is
guaranteed by procmail even if not by UNIX who might use USER.

The only characters for which $\LOGNAME will differ from $LOGNAME either don't belong in a logname or are periods. If the system doesn't allow periods in lognames $\LOGNAME is unnecessary, but it doesn't really hurt.


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail