Danny | 4 Dec 12:35 2014
Picon

Mail forward question

Hi Guys,

I have a working procmail setup that has been running for some time. When I
first did the configuration I had some mail being forwarded to another user on
the same system (Debian Weezy). However, now and then I would do some
maintenance. I noticed that the mail never got forwarded to user "shotgun".

Here is the recipe:

:0:
* ^(From|Cc|To|X-Loop|Sender|Bcc|X-BeenThere):.*newsletter <at> list\.rockauto\.com
#* ^TO_admin <at> iaftercare\.com
! shotgun <at> fever.havannah.local
$MAILDIR/incoming/offroading/rockauto

As you can see the mail is supposed to be placed in the folder "rockauto" which
is done, but it is not being forwarded to the user
"shotgun <at> fever.havannah.local" ...

Any particular reason why?

I am running Debian Weezy (or is it Wheezy?) ... Postfix 2.something ... fetchmail
something.something ... 

Thank You

Danny
Zhiliang Hu | 2 Dec 15:56 2014

help with a procmailrc recipe

To fight against increasingly aggressive spam mails, besides spam-assassin and 
a couple dozen filters I use to trash sure-spams, there still remain some mixed 
mails where I have to manually fish out good from bad or bad from good mails.

For this "small" portion of mails, I wrote a recipe to send automated inquery 
mails to verify if a suspecious mail is from a human-being: if it gets a human 
reply to confirm, the saved mail gets further delivered; if the inquery mail 
gets bounced, the saved mail gets deleted.  So far everything works fine except 
this last recipe to process bounce/delete:

:0
* ^FROM_DAEMON|^FROM_MAILER
{
    :0 w:bb.lock
    * B ?? Subject: verify mail you sent: ([0-9\.]{15}[A-Z]{9})
    THEMATCH = $MATCH

      :0 a
      | rm -f /var/mail/QUARRENTEEN/$THEMATCH

    :0 E:
    Mailerrors
}

The problem is that the saved file name is not caught by regular expression 
match. My auto-inquery mail "Subject:" line is like:

  Subject: verify mail you sent: 20141127.120132MUUNJUEDC

(Note this line is placed in the mail body in a bounce). I suspect if my regex 
(Continue reading)

Zhiliang Hu | 29 Nov 07:19 2014

help with a procmailrc recipe

To fight against increasingly aggressive spam mails, besides 
spam-assassin and a couple dozen filters I use to trash sure-spams, there 
still remain some mixed mails where I have to manually fish out good from 
bad or bad from good mails.

For this "small" portion of mails, I wrote a recipe to send automated 
inquery mails to verify if a suspecious mail is from a human-being: if it 
gets a human reply to confirm, the saved mail gets further delivered; if 
the inquery mail gets bounced, the saved mail gets deleted.  So far 
everything works fine except this last recipe to process bounce/delete:

:0
* ^FROM_DAEMON|^FROM_MAILER
{
    :0 w:bb.lock
    * B ?? Subject: verify mail you sent: ([0-9\.]{15}[A-Z]{9})
    THEMATCH = $MATCH

      :0 a
      | rm -f /var/mail/QUARRENTEEN/$THEMATCH

    :0 E:
    Mailerrors
}

The problem is that the saved file name is not caught by regular 
expression match. My auto-inquery mail "Subject:" line is like:

  Subject: verify mail you sent: 20141127.120132MUUNJUEDC

(Continue reading)

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

Gmane