procmail
[Top] [All Lists]

Procmail action cannot append to a file

2000-08-16 02:02:44
Hi folks,

    I have a question that has been puzzling me for a day, but hopefully
will be familiar / obvious to someone of more experience, and perhaps
somewhat less frustration.

    I have a /etc/procmailrc file that appends mail to a file, using
gzip, pretty much as shown in the procmailex man pages. All was working
well, when suddenly ...   the appending ceased. The modified stamp on
the file froze at 11:34-odd today.

    After much searching and testing, I have established that procmail
can no longer successfully append data to a file using the ">>" unix
operator. I don't know what I've done to achieve this effect. I was
attempting to get a sendmail rule to call procmail at the time, so I was
regenerating /etc/procmail.cf at the time, and had edited the new
rule(s) into /etc/procmail as well (although I did not modify the rule
that was appending to the file).

    For what it's worth, I am running Redhat linux 6.2.

I am enclosing 4 very short files which demonstrate this effect:

procmailrc    - which has 2 interesting variable assignments (DUMMY1 and
DUMMY2), and
                        2 recipes. More on this later.

procmail.log    - the diagnostic output of procmail, after a piece of
mail was processed through it
ls.archive         - the output of "ls -l /var/spool/mqueue/archive"
after the mail was processed.
ls.etc                - the output of "ls -l procmailrc.

    The point to note is that the procmailrc file should cause 4 files
to be created/modified, but only 2 are. Two files are modified/created
"directly" (using "touch" and a simple file-name as an action) - and
these two are created and updated. The other two files are
created/updated with a unix command that includes ">>" to append the
output to the file - and neither of these files is created.

    Note that while the filename in the "gzip" rule is complex, this
appears not to be the cause of the problem.

Things I have tried/tinkered with:

1. All sorts of different file and pathnames for the output files.
2. changing the group and/or group permissions of the archive directory.

3. changing the group of /etc/procmailrc

    Although I would not expect you to see the same results as I am
(after all, mine worked until this morning), It is very easy to test
this setup yourself:

1. Move your /etc/procmailrc file to somewhere safe
2. Copy mine in.
3. Tell sendmail to use procmail as the local delivery agent (I use
linuxconf to do this)
4. Create a directory called "archive" in the /var/spool/mqueue
directory (or wherever your sendmail will run procmail).
5. Send a piece of mail to someone (yourself will do fine)


Any and all help in solving the mystery will be gratefully appreciated.

Cheers!
Nik.

-rw-rw-r--    1 root     root          274 Aug 16 18:14 /etc/procmailrc
# Simple logging procmail file
LOGFILE=/var/procmail.log
VERBOSE=on
LOGABSTRACT=all
DUMMY1=`touch archive/xxx`
DUMMY2=`echo here >> archive/yyy`


#  write everything to a file
:0 c
archive/test

#  Archive all mail to the file
:0 wc
| gzip >> archive/mail-`date +%y-%m`.gz
total 2
-rw-rw----    1 root     mail         1036 Aug 16 18:17 test
-rw-------    1 root     mail            0 Aug 16 18:17 xxx

Attachment: procmail.log
Description: application/unknown-content-type-txtfile

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