procmail 3.22-19 on Linux / Fedora 7
I wrote a recipe to add X-Priority and X-Keyword headers based on
certain criteria.
The X-Priority header gets added but the X-Keywords header does not.
Does formail care whether DROPPRIVS=YES is in effect or not? I have
other recipes that run in /etc/procmailrc that add X-Keywords
successfully. In case my mail client was"hiding" the X-Keywords header
from me, I looked at the raw mail file with vim. I also used vim before
using my e-mail client. I'm using the Dovecot IMAP mail server.
This recipe runs after /etc/procmailrc
I do not see anything in the mail log that tells me what's wrong.
I'll paste the recipe, the mail log, and the resulting mail headers below...
Any suggestions as to why the X-Keywords header is not being added? Have
I done some bone-headed move? :-)
Thank you.
Recipe:
# Split Fedora Update Announcements into messages I need and do not need
# (i.e. based on whether the package is installed or not)
:0 c:
backup
VERBOSE=YES
:0
* ^list-id: fedora package announcements
{
LOG="fedora.rc handling list-id header${EOL}"
:0 :
* ^subject:.*fedora core 6
${TRASH}
:0 :
* ^subject:.*fedora core 5
${TRASH}
# get package name from message body. (Get version and release later
if needed)
:0
* B ?? ^Name[ ]*: \/.+
{ PACKAGE= $MATCH }
# See if this package is installed: rpm -q
# If not (rpm exit code = 1), flag it as 'low priority'.
# If installed (rpm exit code = 0):
# installed same as announced?
# Yes - flag as 'normal priority'
# No - flag as 'high priority'
INSTALLED=`rpm -q ${PACKAGE}`
RPMRC=$?
:0
* RPMRC ?? 0
{
# package is installed, need version and release numbers from
message body now
:0
* B ?? ^Version[ ]*: \/.+
{ VERSION= $MATCH }
:0
* B ?? ^Release[ ]*: \/.+
{ RELEASE= $MATCH }
# compare the installed version/release to the announced
version/release
ANNOUNCED="${PACKAGE}-${VERSION}-${RELEASE}"
:0 fwh
* ANNOUNCED ?? ${INSTALLED}
| formail -I "X-Keywords: \$Label4" -I "X-Priority: 3 (Normal)"
:0 Efwh
| formail -I "X-Keywords: \$Label1" -I "X-Priority: 1 (Highest)"
}
:0 Efwh
| formail -I "X-Keywords: \$Label5" -I "X-Priority: 5 (Lowest)"
:0 :
MailingLists/fedora-package-announce
}
VERBOSE=NO
The mail log showing things seem to be OK...
2007-06-19 06:29:27 --- Filtering (system) mail for don with /etc/procmailrc
Subject: Fedora 7 Update: bygfoot-2.2.0-1.fc7
End of system procmailrc (/etc/procmailrc)
procmail: [23867] Tue Jun 19 06:29:29 2007
procmail: Match on "^list-id: fedora package announcements"
procmail: Assigning "LOG=fedora.rc handling list-id header
"
fedora.rc handling list-id header
procmail: No match on "^subject:.*fedora core 6"
procmail: No match on "^subject:.*fedora core 5"
procmail: Assigning "MATCH="
procmail: Matched "bygfoot"
procmail: Match on "^Name[ ]*: \/.+"
procmail: Assigning "PACKAGE=bygfoot"
procmail: Executing "rpm,-q,bygfoot"
procmail: Assigning "INSTALLED=package bygfoot is not installed"
procmail: Assigning "RPMRC=1"
procmail: No match on "0"
procmail: Executing "formail,-I,X-Keywords: $Label5,-I,X-Priority: 5
(Lowest)"
procmail: Locking "MailingLists/fedora-package-announce.lock"
procmail: Assigning "LASTFOLDER=MailingLists/fedora-package-announce"
procmail: Opening "MailingLists/fedora-package-announce"
procmail: Acquiring kernel-lock
procmail: Unlocking "MailingLists/fedora-package-announce.lock"
procmail: Notified comsat:
"don(_at_)22251:/home/don/mail/MailingLists/fedora-package-announce"
From fedora-package-announce-bounces(_at_)redhat(_dot_)com Tue Jun 19
06:29:27 2007
Subject: Fedora 7 Update: bygfoot-2.2.0-1.fc7
Folder: MailingLists/fedora-package-announce 5613
The final message headers....
From: updates(_at_)fedoraproject(_dot_)org
Date: Mon, 18 Jun 2007 15:29:25 -0700
To: fedora-package-announce(_at_)redhat(_dot_)com
X-Mailer: TurboMail TurboGears Extension v.2.0.3
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from base64 to 8bit by listman.util.phx.redhat.com id
l5IMTVvb028647
X-loop: fedora-package-announce(_at_)redhat(_dot_)com
X-Mailman-Approved-At: Tue, 19 Jun 2007 09:28:59 -0400
X-Topics: Fedora 7
Subject: Fedora 7 Update: bygfoot-2.2.0-1.fc7
X-BeenThere: fedora-package-announce(_at_)redhat(_dot_)com
X-Mailman-Version: 2.1.5
Precedence: junk
List-Id: Fedora Package Announcements <fedora-package-announce.redhat.com>
List-Unsubscribe:
<http://www.redhat.com/mailman/listinfo/fedora-package-announce>,
<mailto:fedora-package-announce-request(_at_)redhat(_dot_)com?subject=unsubscribe>
List-Archive: <https://www.redhat.com/archives/fedora-package-announce>
List-Post: <mailto:fedora-package-announce(_at_)redhat(_dot_)com>
List-Help:
<mailto:fedora-package-announce-request(_at_)redhat(_dot_)com?subject=help>
List-Subscribe:
<http://www.redhat.com/mailman/listinfo/fedora-package-announce>,
<mailto:fedora-package-announce-request(_at_)redhat(_dot_)com?subject=subscribe>
Sender: fedora-package-announce-bounces(_at_)redhat(_dot_)com
Errors-To: fedora-package-announce-bounces(_at_)redhat(_dot_)com
X-Virus-Scanned: ClamAV 0.90.2/3466/Mon Jun 18 23:21:58 2007 on
localhost.localdomain
X-Virus-Status: Clean
X-Priority: 5 (Lowest)
X-UID: 2032
Content-Length: 2436
Status: RO
____________________________________________________________
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