Problems getting formail to work...

Francesco Peeters francesco at fampeeters.com
Thu Sep 18 22:21:18 CST 2014


Since there doesn't seem to be any (semi)formal Procmail support lists
left, I'm trying my luck here...

I am having issues getting formail to work in procmail on my Ubuntu
server...

My original recipe was:
:0HB
* !^X-Loop: francesco at fampeeters\.com
* ^Subject: Failed Authentication
* Client IP: \/.*
| formail -rk \
-A "X-Address: 1.2.3.4" \
-A "X-Loop: francesco at fampeeters.com"

(I want to replace the address in X-Address with the info from $MATCH,
but not gotten there yet!!!)

But when matching email comes in I get this in the procmail log:
procmail: Match on ! "^X-Loop: francesco at fampeeters\.com"
procmail: Match on "^Subject: Failed Authentication"
procmail: Assigning "MATCH="
procmail: Matched "195.99.200.13"
procmail: Match on "Client IP: \/.*"
procmail: Assigning "LASTFOLDER=formail -rk  "
procmail: Notified comsat: "fpeeters@:/home/fpeeters/Maildir//formail -rk  "
>From francesco at fampeeters.com  Thu Sep 18 12:16:59 2014
procmail: Executing "formail,-rk, "
 Subject: Failed Authentication - 195.99.200.13
  Folder: formail
-rk                                                      1819
Usage: formail [-vbczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]
        [-xXaAiIuU field] [-R ofield nfield]
   Or: formail [+nnn] [-nnn] [-bczfrktedqBY] [-D nnn idcache] [-p prefix]
        [-n [nnn]] [-m nnn] [-l folder] [-xXaAiIuU field] [-R ofield nfield]
        -s [prg [arg ...]]


I've scoured the web, but I just cannot find it...

So I tried a different approach, which I also found on the web, and
comes close to what I want to achieve in the end:
:0HB
* !^X-Loop: francesco at fampeeters\.com
* ^Subject: Failed Authentication
* Client IP: \/.*
| ( formail -rk \
-A "X-Address: 1.2.3.4" \
-A "X-Loop: francesco at fampeeters.com"; \
echo "Please don't send me any more mail";\
echo "This is an automated response";\
echo "I'll never see your message";\
echo "So, GO AWAY" ) | $SENDMAIL -t -oi

(I'll adjust the text later, this was just for testing!)

But then I get:
procmail: Match on ! "^X-Loop: francesco at fampeeters\.com"
procmail: Match on "^Subject: Failed Authentication"
procmail: Assigning "MATCH="
procmail: Matched "195.99.200.13"
procmail: Match on "Client IP: \/.*"
procmail: Assigning "LASTFOLDER=( formail -rk  "
procmail: Executing "(,formail,-rk, "
procmail: Notified comsat: "fpeeters@:/home/fpeeters/Maildir//( formail
-rk  "
>From francesco at fampeeters.com  Thu Sep 18 12:24:29 2014
 Subject: Failed Authentication - 195.99.200.13
  Folder: ( formail
-rk                                                    1819
/bin/sh: 0: procmail: Executing
"/etc/webmin/virtual-server/procmail-logger.pl"
Can't open (
Time:1411032281 From:francesco at fampeeters.com To:fpeeters at fampeeters.com
User:fpeeters.fampeeters Size:1819 Dest:( formail -rk   Mode:None

I'm just not certain where it breaks, since both commands that follow
the (working!) recipes are copied from different tutorials!

Any suggestions appreciated!
-- 
Francesco



More information about the linuxsa mailing list