Richard Reina | 29 Oct 19:30 2014
Picon

Can anyone help fixing a recipe?

I've been using the recipe below and it does what I want except one thing. If the conditional that begins with
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_subject($ENV{SUBJECT});'
receives a "0" as the exit code of the perl script it executes the formail and ssmtp command which is what I want.  The problem is that the recipe continues executing.  I would like it to stop if the condition is met ( exit code "0"). That is if the test_subject() subroutine exits with a zero, I wan't it to return the email with formail and ssmtp and then STOP. Can anyone tell me what I am doing wrong?

#grab the from
FROM=""
:0
* ^FROM:.*
* ^From:[    ]*\/[^  ].*
{
       FROM=$MATCH
}
#grab the subject
SUBJECT=""
:0
* ^FROM:.*
* ^Subject:[    ]*\/[^  ].*
{
       SUBJECT=$MATCH
}
:0 W # send to test_subject.pl to check for PO no.
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_subject($ENV{SUBJECT});'
|( formail -rI"From: No Reply <fpls545 <at> gmail.com>"; \
  echo "Your mail has been returned."; \
  echo "It was NOT received because it does not contain a valid Load Number in the subject"; \
  echo "Please resubmit with the PO Number (see Rate Confirmation) in the subject line."; \
  ) | /usr/sbin/ssmtp -oi -t;

:0 W # VALID PO NO test it to make sure it was not already processessed and or paid
* ? /usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; test_if_billed($ENV{SUBJECT},$ENV{FROM});'
work # already billed

:0 ifw  # has not been billed rip & save attachements 

|ripmime -i - -d /home/richard/.pmdir/attachments/ &&\
/usr/bin/perl -e 'require "/home/richard/.pmdir/test_subject.pl"; rename_att($ENV{SUBJECT}); exit(0)'

:0 A
invoices

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
LuKreme | 23 Oct 03:43 2014

Duplicate emails

Can anyone tell where in this verbose log the incoming message is becoming two messages? It appears to me
that it happens at the call to spamc which I've highlighted.

:0 fw
| spamc

procmail: [22405] Wed Oct 22 19:29:37 2014
procmail: No match on "Subject.*New List Mail$"
procmail: No match on "^FROM_DEAMON"
procmail: Assigning "READLIST=/home/kremels/.readlist"
procmail: Executing "grep,-i,^dmarkman <at> mac.com,/home/kremels/.readlist"
procmail: Assigning "READIT="
procmail: Assigning "MATCH="
procmail: Matched " bbedit <at> googlegroups.com"
procmail: Match on "^To:(.*\<)?\/.*"
procmail: Assigning "TO= bbedit <at> googlegroups.com"
procmail: No match on "X-spam-status:(.*\<)?\/.*"
procmail: No match on "From:(.*\<)?root <at> (mail)?.covisp.net"
procmail: No match on "^Subject:.*\["
--->> procmail: Executing "spamc"
procmail: [22400] Wed Oct 22 19:29:37 2014
procmail: No match on "Subject.*New List Mail$"
procmail: No match on "^FROM_DEAMON"
procmail: Assigning "READLIST=/home/kremels/.readlist"
procmail: Executing "grep,-i,^dmarkman <at> mac.com,/home/kremels/.readlist"
procmail: Assigning "READIT="
procmail: Assigning "MATCH="
procmail: Matched " bbedit <at> googlegroups.com"
procmail: Match on "^To:(.*\<)?\/.*"
procmail: Assigning "TO= bbedit <at> googlegroups.com"
procmail: No match on "X-spam-status:(.*\<)?\/.*"
procmail: No match on "From:(.*\<)?root <at> (mail)?.covisp.net"
procmail: No match on "^Subject:.*\["
--->> procmail: Executing "spamc"
procmail: [22405] Wed Oct 22 19:29:39 2014
procmail: Executing "echo "$MATCH" | sed 's/[    ]\{1,\}/ /g'"
procmail: [22405] Wed Oct 22 19:29:39 2014
procmail: Assigning "SPAM= bbedit <at> googlegroups.com"
procmail: No match on "^X-Spam-Status:(.*\<)?Yes"
procmail: Assigning "INCLUDERC=/home/kremels/.list_procmail"
procmail: Assigning "LISTNAME"
procmail: Score:       0       0 "^(List-Post:[    ]*(<mailto:)?|List-Owner:[      ]*(<mailto:)?owner-)\/[-A-Z0-9_+]+"
procmail: Assigning "MATCH="
procmail: Matched "bbedit"
procmail: Score: 2147483647 2147483647 "^(List-Id:.*<|X-Mailing-List:[   ]*)\/[-A-z0-9_+]+"
procmail: Assigning "LISTNAME=bbedit"
procmail: No match on "()\/[-A-Z0-9_+]+-(users|user)"
procmail: Assigning "LOG=bbedit
"
bbedit
procmail: Assigning "INCLUDERC=/home/kremels/.list_local"
procmail: Executing "formail,-IX-Covisp-prelocal: bbedit"
procmail: No match on "^List-Post: <mailto:\/[-A-Z0-9_+]+ <at> [-A-Z0-9_+.]+"
procmail: No match on "^^google"
procmail: Match on "^^bbedit"
procmail: Assigning "SWITCHRC"
procmail: Match on ! "LISTNAME ^^^^"
procmail: Executing "formail,-IX-Listname: bbedit"
procmail: No match on "NO"
procmail: Match on ! "^^^^"
procmail: [22400] Wed Oct 22 19:29:39 2014
procmail: Executing "echo "$MATCH" | sed 's/[    ]\{1,\}/ /g'"
procmail: [22400] Wed Oct 22 19:29:39 2014
procmail: Assigning "SPAM= bbedit <at> googlegroups.com"
procmail: No match on "^X-Spam-Status:(.*\<)?Yes"
procmail: Assigning "INCLUDERC=/home/kremels/.list_procmail"
procmail: Assigning "LISTNAME"
procmail: Score:       0       0 "^(List-Post:[    ]*(<mailto:)?|List-Owner:[      ]*(<mailto:)?owner-)\/[-A-Z0-9_+]+"
procmail: Assigning "MATCH="
procmail: Matched "bbedit"
procmail: Score: 2147483647 2147483647 "^(List-Id:.*<|X-Mailing-List:[   ]*)\/[-A-z0-9_+]+"
procmail: Assigning "LISTNAME=bbedit"
procmail: No match on "()\/[-A-Z0-9_+]+-(users|user)"
procmail: Assigning "LOG=bbedit
"
bbedit
procmail: Assigning "INCLUDERC=/home/kremels/.list_local"
procmail: Executing "formail,-IX-Covisp-prelocal: bbedit"
procmail: No match on "^List-Post: <mailto:\/[-A-Z0-9_+]+ <at> [-A-Z0-9_+.]+"
procmail: No match on "^^google"
procmail: Match on "^^bbedit"
procmail: Assigning "SWITCHRC"
procmail: Match on ! "LISTNAME ^^^^"
procmail: Executing "formail,-IX-Listname: bbedit"
procmail: No match on "NO"
procmail: Match on ! "^^^^"
procmail: Assigning "LASTFOLDER=.bbedit/new/1414027779.22405_0.mail.covisp.net"
procmail: Notified comsat: "kremels <at> 0:/home/kremels/Maildir//.bbedit/new/1414027779.22405_0.mail.covisp.net"
From bbedit+bncBD2JVBEQGUIP7M5BUICRUBFKR334A <at> googlegroups.com  Wed Oct 22 19:29:37 2014
 Subject: Re: javascript OSA script component
  Folder: .bbedit/new/1414027779.22405_0.mail.covisp.net                   8025
procmail: Assigning "LASTFOLDER=.bbedit/new/1414027779.22400_0.mail.covisp.net"
procmail: Notified comsat: "kremels <at> 0:/home/kremels/Maildir//.bbedit/new/1414027779.22400_0.mail.covisp.net"
From bbedit+bncBD2JVBEQGUIP7M5BUICRUBFKR334A <at> googlegroups.com  Wed Oct 22 19:29:37 2014
 Subject: Re: javascript OSA script component
  Folder: .bbedit/new/1414027779.22400_0.mail.covisp.net                   8025

--

-- 
The only way of discovering the limits of the possible is to venture a
little way past them into the impossible.
Chris | 21 Oct 04:00 2014

formail recipe that queries asn.routeviews.org

I've a formail recipe embedded in my .procmailrc file that it's purpose
is to parse out the senders ASN and CIDR. The output of looks like this:
X-senderip: 168.244.164.171
X-asn: ASN-21789
X-cidr: 168.244.164.0/24

Here is the recipe:

RAW_ASN=`host -W 6 -R 10 -t txt $REVERSE_SENDERIP.asn.routeviews.org |
sed -e 's/.* text //' -e 's/"//g'`

ASN = `echo $RAW_ASN | cut -d ' ' -f 1`
ASN_CIDR = `echo $RAW_ASN | cut -d ' ' -f 2`/`echo $RAW_ASN | cut -d ' '
-f 3`
LOG = "ASN= $ASN"

Then the procmail recipes that add this to the message header:

------------------------------------------------------------------------ 
# Add X-SenderIP header.
:0 fhw
* ! ^X-SenderIP:
| $FORMAIL -a "X-SenderIP: $SENDERIP"
#
------------------------------------------------------------------------ 

#
------------------------------------------------------------------------ 
# Add X-ASN header.
:0 fhw
* ! ^X-ASN:
| $FORMAIL -a "X-ASN: ASN-$ASN"
#
------------------------------------------------------------------------ 

#
------------------------------------------------------------------------ 
# Add X-CIDR header.
:0 fhw
* ! ^X-CIDR:
| $FORMAIL -a "X-CIDR: $ASN_CIDR"
#
------------------------------------------------------------------------  

The problem I'm having is that in my procmaillog I'm seeing this
periodically:

host: '.asn.routeviews.org' is not a legal name (empty label)
ASN= From cpollock <at> embarqmail.com  Mon Oct 20 11:41:44 2014
 Subject: Cron <chris <at> localhost> fetchmail
--quit; /usr/local/bin/fetchmail -v 
  Folder: /home/chris/Maildir/new/1413823304.2785_1.localhost	

It's not constant as far as what incoming messages it decides to fail
on. I've contacted routeviews.org and they've assured me that the issue
doesn't seem to be there. Since this is a new setup using Ubuntu and
previously in my old Mandriva box I had no issues I'm wondering if it's
a system problem or a problem with the recipes?

Thanks
Chris

--

-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11°N 97.89°W (Elev. 1092 ft)
20:23:04 up 55 min, 2 users, load average: 0.08, 0.21, 0.27
Ubuntu 14.04.1 LTS, kernel 3.13.0-38-generic
Bernard Schoenacker | 7 Jun 16:17 2014
Picon

spamcop and spamhaus with procmail

Hello,

I'm looking for some rules that can be used with
procmail and rbl sbl and lists (spamcop and spamhaus)

thank you for your kind attention

sincerely
bernard
Bernard Schoenacker | 7 Jun 08:24 2014
Picon

rblcheck rule for procmail

hi, 

i seek one procmail rule bether as this :

  :0
    TCPREMOTEIP=`origip || echo 127.0.0.1`
  * ! ? if [ -n "$TCPREMOTEIP" ]; then rblcheck -q "$TCPREMOTEIP"; fi
  {
      # EXITCODE=100
        EXITCODE=75
        LOGABSTRACT=all
        LOG="Filter: RBL-filtered address: \"$TCPREMOTEIP\"
  "
        :0:
        $FILTER_FOLDER
 }

best regard

bernard
Dale R. Worley | 4 Jun 16:50 2014
Picon

Improvement to the manual page for lockfile

lockfile is a program that can "succeed" and "fail" in a number of
distinct ways that the caller may want to distinguish.  As it says in
the manual page, "WARNINGS ... When testing lockfile's return value,
shell script writers should consider carefully whether they want to
use the -!  flag, simply reverse the test, or do a switch on the exact
exit‐code."

Unfortunately, the manual page does not describe the exit status
values, or how to distinguish the two success cases (ordinary success,
and forcing the lock).

So I propose to add this section to the manual page:

    EXIT STATUS

    Success is indicated by an exit status of 0.  Success after a
    timed-out lockfile was removed by force is indicated by an exit
    status of 0 with output to standard error including the text "Forcing
    lock on".  Failure because the number of retries was reached is
    indicated by an exit status of EX_CANTCREAT from sysexits.h (usually
    73).  Other failures are indicated by other non-zero exit statuses.
    All failures produce specific messages to standard error.
    If the -! flag is in effect, success is indicated by EX_CANTCREAT and
    retry failure is indicated by 0.

I believe that this is correct and complete.

Dale
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail <at> lists.RWTH-Aachen.de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail
Bernard Schoenacker | 4 Jun 13:58 2014
Picon

procmail: Lock failure

hello,

i have this error :

procmail: Lock failure on "/var/spool/mail/bernard.lock"

what is the solution for MH ?

kind regard

bernard
Bernard Schoenacker | 3 Jun 18:31 2014
Picon

junkfilter rules for MH

hello,

I have installed junkfilter and it appears to be tagging the headers
in the emails correctly but the recipe in the procmailrc.sample file
doesn't appear to move the message to the corresponding junkmail box
any suggestions?

Below is the recipe...

# Call junkfilter
INCLUDERC=$JFDIR/junkfilter

# Take action if junkfilter caught a junkmail.
:0
* JFEXP ?? .
{
# This is for the whitelist. The message is tagged with an
# X-Spammer: header, but is not filtered away.
:0 f
* JFSTATUS ?? 1
| formail -i "X-junkfilter: $JFVERSION" -i "X-Spammer: $JFEXP"

# Non-whitelist messages are tagged and sent to a junk
mailbox.
:0 E :
| formail -i "X-junkfilter: $JFVERSION" -i "X-Spammer:
$JFEXP" \

    >> junkmail

}
### who is the junkmail folder ?
# Catches everything else.
:0 :
|rcvstore +inbox

# EOF procmailrc.sample

OS: Linux debian

procmail -v
procmail v3.22 2001/09/10
    Copyright (c) 1990-2001, Stephen R. van den Berg
<srb <at> cuci.nl> Copyright (c) 1997-2001, Philip A.
Guenther		<guenther <at> sendmail.com>

Submit questions/answers to the procmail-related mailinglist by sending
to: <procmail-users <at> procmail.org>

And of course, subscription and information requests for this list to:
	<procmail-users-request <at> procmail.org>

Locking strategies:	dotlocking, fcntl()
Default rcfile:		$HOME/.procmailrc
	It may be writable by your primary group
Your system mailbox:	/var/mail/bernard

best regard
bernard
Arthur Dent | 30 May 13:13 2014
Picon

From root to users

Hello all,

For reasons I won't bore you with I am forced to collect mail for all
three members of may family from an unsorted source.

I therefore run procmail as root on this Fedora 20 server and, in
the /etc/procmailrc file I sort the mail into messages for my wife, my
son and for me. (While it's in there I also do some spam / virus
checking).

It then gets delivered (using the dovecot-lda) to each of our mailboxes
such as:

:0 w
* ^TO_some_checks_to_identify_my_wife
| /usr/libexec/dovecot/dovecot-lda -d wife

:0 w
* ^TO_some_checks_to_identify_my_son
| /usr/libexec/dovecot/dovecot-lda -d son

# Anything else falls through to me:
| /usr/libexec/dovecot/dovecot-lda -d mark

I do not currently have $DEFAULT set to anything.

All this is fine for my wife and son - stuff just goes into their
mailbox and they can read or file it as they wish.

I, on the other hand, want to do a lot of filtering first using the
power of Procmail. The trouble is I have to do this in /etc/procmailrc
before that final delivery command (which works fine by the way), but I
think it would be neater for /etc/procmailrc to hand-off to my
~/.procmailrc and do the filtering there.

Is there a way to inform procmail explicitly to pass on from root to
user=mark?

I am using Maildir format (rather than mbox) so /var/spool/mail/mark
does not get used.

Any help or suggestions gratefully received...

Mark
Bernard Schoenacker | 26 May 19:55 2014
Picon

spambouncer

Hello,

	how to user spambouncer with procmailrc ?
	http://www.spambouncer.org/aboutsb/

	kind regard

	bernard

--
Seule une page blanche pourrait dire tout ce qui ne se raconte pas,
ne se peint pas, ne se retient pas.
	-+- Jacques-Henri Lartigue -+-
Christopher P. Lindsey | 14 May 16:42 2014
Picon

procmail.org down?

Does anyone know the status of procmail.org? 

I wanted to download the source last night for a new mail server, but
couldn't get to either the web or FTP version.  Web is trying to redirect
to gustavus.edu but failing.

I ended up getting it from one of the mirrors listed in the Google
cache for the site.

Chris

Gmane