Hello.

This is what I did today. Maybe someone can follow my steps
and arrive at something.

I'm using this $HOME/.procmailrc file:

---------------------------------
LOGFILE=$HOME/.cache/procmail.log
VERBOSE=yes

:0 h
SUBJECT=|formail -cXSubject:|cat

MYVAR=$SUBJECT

:0
/dev/null
---------------------------------

and this command to test it:

echo "Subject: thesubject" | formail | procmail

A non-buggy procmail (for example, the one in bullseye) will
produce a $HOME/.cache/procmail.log file like this:

procmail: [2236560] Tue Feb 14 20:27:41 2023
procmail: Assigning "SUBJECT="
procmail: [2236560] Tue Feb 14 20:27:41 2023
procmail: Executing "formail -cXSubject:|cat"
procmail: Assigning "MYVAR=Subject: thesubject"
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
procmail: Notified comsat: "bluser@0:/dev/null"
From foo@bar  Tue Feb 14 20:27:41 2023
 Subject: thesubject
  Folder: /dev/null                                                          60


However, a buggy procmail (for example, procmail_3.24-1) will
produce a $HOME/.cache/procmail.log file like this:

procmail: [2236823] Tue Feb 14 20:30:28 2023
procmail: Assigning "SUBJECT="
procmail: [2236823] Tue Feb 14 20:30:28 2023
procmail: Executing "formail -cXSubject:|cat"
procmail: Assigning "MYVAR="
procmail: Assigning "LASTFOLDER=/dev/null"
procmail: Opening "/dev/null"
procmail: Notified comsat: "bluser@0:/dev/null"
From foo@bar  Tue Feb 14 20:30:28 2023
 Subject: thesubject
  Folder: /dev/null                                                          60

The relevant thing here is that MYVAR is empty.


Now, to do a git-bisect (or something which resembles it),
I'm doing this:

git checkout some-git-id --force

To avoid putting the debian/* files on top of this,
I'm using this simple script "make-procmail" to compile:

#!/bin/sh
set -e
make CC=gcc CFLAGS0="" LDFLAGS0="" SEARCHLIBS="-lm" LOCKINGTEST=100
cat src/procmail > /usr/bin/procmail

where I've previously made /usr/bin/procmail mode 777 for that to work.
(This is naturally in a test machine).

It is possible that the above fails with "text file busy", then
I execute this other script as root:

#!/bin/sh
set -e
cd /usr/bin
rm -f procmail
touch procmail
chmod 777 procmail


If "some-git-id" is too old, the following error may arise:

formisc.h:20:2: error: conflicting types for ‘getline’
   20 |  getline P((void));
      |  ^~~~~~~
In file included from includes.h:41,
                 from formail.c:16:
/usr/include/stdio.h:616:18: note: previous declaration of ‘getline’ was here
  616 | extern __ssize_t getline (char **__restrict __lineptr,

(This was Bug #549426 fixed in version 3.22-18).

In such case this is enough to get rid of such error:

git show 2df8bdb0d2557d6cdc7632e | patch -p1


Now the bad news:

According to my tests, this commit, tagged v3.23pre, is already buggy:

commit 98ca67898b3f38ea09f1a0d1119d0794c044f9b6 (HEAD, tag: v3.23pre)
Author: Philip Guenther <guent...@sendmail.com>
Date:   Tue Nov 1 03:15:48 2005 +0000

    Fixed properties

The previous commit is huge and it's already buggy:

commit 5281aac102d92966c5963ea8694d95e4f1103747
Author: Philip Guenther <guent...@sendmail.com>
Date:   Tue Nov 1 01:44:56 2005 +0000

    Various fixes.

[lots of stuff]


And finally, the commit before that makes this simple command

echo "Subject: thesubject" | formail  | procmail

to take some time to return (locking problems?) and
the log output on procmail.log is like this:

procmail: [2243217] Tue Feb 14 21:04:28 2023
procmail: Assigning "SUBJECT="
procmail: [2243217] Tue Feb 14 21:04:28 2023
procmail: Executing "formail -cXSubject:|cat"
procmail: Out of memory
buffer 0: "formail -cXSubject:|cat"
buffer 1: "formail -cXSubject:|cat"
procmail: Notified comsat: "bluser@:**Bounced**"
From foo@bar  Tue Feb 14 21:04:28 2023
  Folder: **Bounced**                                                         0

Because there is not a MYVAR= line, I'm not even able
to tell if this is also buggy or not.

So, to summarize: I still need help to fix this...

Thanks.

Reply via email to