procmail
[Top] [All Lists]

Re: A recipe does not work for one list only

2005-04-18 01:16:28


    Dear Kreme and Ross
    Hi'
    Many thanks for your suggestions and hints which were too
useful for me as a beginner. I applied all of them and tested
the following versions of RCFILEs:

### The first one
LISTS_DIR=/dos/f/Lists
MSG_FILE=/ext3/home/tmp/procmail.msg
LOGFILE=/ext3/home/tmp/procmail.from
VERBOSE=on
LOGABSTRACT=all

:0
* ^TO_.*farsitex-user@
{
   :0
   | echo "Mail received from: Ftex-user" >> $MSG_FILE

   :0:
   $LISTS_DIR/.NEW_Ftex-user
}

### The second one
LISTS_DIR=/dos/f/Lists
LOG_FILE=/ext3/home/tmp/procmail.msg
LOGFILE=/ext3/home/tmp/procmail.from
VERBOSE=on
LOGABSTRACT=all

:0
* ^TO_.*farsitex-user@
{
   OLDLOG=$LOGFILE
   LOGFILE=$LOG_FILE
   LOG="Mail Received from ftext-user$NL"
   LOGFILE=$OLDLOG

   :0:
   $LISTS_DIR/.NEW_Ftex-user
}

But still they don't work and while $LOGFILE and $MSG_FILE are
created with other lists, nothing is created with `farsitex-user'
list. I don't know if the header is plain text version or not,
so for your more information I have copied the whole mail form
my Inbox folder.

##### Beginning of Mail:
From MAILER-DAEMON Mon Apr 18 07:27:08 2005
Date: 18 Apr 2005 07:27:08 +0430
From: Mail System Internal Data 
<MAILER-DAEMON(_at_)Rakhsh(_dot_)Rostam(_dot_)Dastan>
Subject: DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA
Message-ID: <1113793028(_at_)Rakhsh(_dot_)Rostam(_dot_)Dastan>
X-IMAP: 1113792977 0000000001
Status: RO

This text is part of the internal format of your mail folder, and is not
a real message.  It is created automatically by the mail system software.
If deleted, important folder data will be lost, and it will be re-created
with the data reset to initial values.

From n_haghgoo(_at_)yahoo(_dot_)com Sun Apr 17 16:04:48 2005
X-Apparently-To: dma8hm1956(_at_)yahoo(_dot_)com via 206.190.38.201; Sun, 17 
Apr 2005 01:34:07 -0700
Authentication-Results: mta129.mail.re2.yahoo.com  from=lists.sourceforge.net; 
domainkeys=fail (bad syntax)
X-Originating-IP: [66.35.250.225]
Return-Path: <farsitex-user-admin(_at_)lists(_dot_)sourceforge(_dot_)net>
Received: from 66.35.250.225  (EHLO lists-outbound.sourceforge.net) 
(66.35.250.225)  by mta129.mail.re2.yahoo.com with SMTP; Sun, 17 Apr 2005 
01:34:06 -0700
Received: from projects.sourceforge.net (sc8-sf-list2-b.sourceforge.net 
[10.3.1.8])     by sc8-sf-spam1.sourceforge.net (Postfix) with ESMTP    id 
BC5758857A; Sun, 17 Apr 2005 01:34:05 -0700 (PDT)
Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.12] 
helo=sc8-sf-mx2.sourceforge.net)       by sc8-sf-list2.sourceforge.net with 
esmtp (Exim 4.30)  id 1DN5CX-0003mh-R1     for 
farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net; Sun, 17 Apr 2005 01:32:21 
-0700
Received: from web31810.mail.mud.yahoo.com ([68.142.207.73])    by 
sc8-sf-mx2.sourceforge.net with smtp (Exim 4.41)     id 1DN5CV-0001C5-CX     
for farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net; Sun, 17 Apr 2005 
01:32:21 -0700
Received: (qmail 92847 invoked by uid 60001); 17 Apr 2005 08:32:10 -0000
Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;  s=s1024; d=yahoo.com;  
b=jszneQc9ok6ATOEZJAmqlGoMV18wxBb6BYmu3YU7F4mR4q4pUWXdIO0/GtH9Gg+ghDnP2ydVQBGBPq3XDyHuxV6oByBJpaxYTc7/eoR938BuOOFDqZhJlRejdM0Pi+osGxjuFIao+qGXfkjqfqOvX8Ti9IdJkR2HRaGX/OnSNos=
  ;
Message-ID: 
<20050417083210(_dot_)92845(_dot_)qmail(_at_)web31810(_dot_)mail(_dot_)mud(_dot_)yahoo(_dot_)com>
Received: from [62.220.96.234] by web31810.mail.mud.yahoo.com via HTTP; Sun, 17 
Apr 2005 01:32:10 PDT
From: Nosrat Haghgoo <n_haghgoo(_at_)yahoo(_dot_)com>
Reply-To: n_haghgoo(_at_)yahoo(_dot_)com
To: farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="0-115487747-1113726730=:89109"
X-Spam-Score: 2.3 (++)
X-Spam-Report: Spam Filtering performed by sourceforge.net.     See 
http://spamassassin.org/tag/ for more details.      Report problems to 
http://sf.net/tracker/?func=add&group_id=1&atid=200001       2.2 
FORGED_YAHOO_RCVD      'From' yahoo.com does not match 'Received' headers   0.0 
HTML_MESSAGE           BODY: HTML included in message       0.1 HTML_50_60      
       BODY: Message is 50% to 60% HTML
Subject: [ftex-user]Error in  Farsitex 1.0 pre1
Sender: farsitex-user-admin(_at_)lists(_dot_)sourceforge(_dot_)net
Errors-To: farsitex-user-admin(_at_)lists(_dot_)sourceforge(_dot_)net
X-BeenThere: farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net
X-Mailman-Version: 2.0.9-sf.net
Precedence: bulk
List-Unsubscribe: <https://lists.sourceforge.net/lists/listinfo/farsitex-user>, 
<mailto:farsitex-user-request(_at_)lists(_dot_)sourceforge(_dot_)net?subject=unsubscribe>
List-Id: A mailing list for users of FarsiTeX 
<farsitex-user.lists.sourceforge.net>
List-Post: <mailto:farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net>
List-Help: 
<mailto:farsitex-user-request(_at_)lists(_dot_)sourceforge(_dot_)net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/farsitex-user>,   
<mailto:farsitex-user-request(_at_)lists(_dot_)sourceforge(_dot_)net?subject=subscribe>
List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=farsitex-user>
X-Original-Date: Sun, 17 Apr 2005 01:32:10 -0700 (PDT)
Date: Sun, 17 Apr 2005 01:32:10 -0700 (PDT)
X-FetchYahoo: version 2.8.6 MsgId 918_19809_1553_3509_745_0_4130_1596_4291074743
Status: RO
X-Status:
X-Keywords:
X-UID: 1

--0-115487747-1113726730=:89109
Content-Type: text/plain; charset=us-ascii

Hello,
After installing Farsitex 1.0 pre1, when I compile this error apperar"Cannot 
convert X.ftx to X.tex"
Please help me to correct this problem.
Thanks alot.


Nosrat Haghgoo
 ä��� �ááå ���æ



---------------------------------
Yahoo! Mail Mobile
 Take Yahoo! Mail with you! Check email on your mobile phone.
--0-115487747-1113726730=:89109
Content-Type: text/html; charset=us-ascii

<DIV>Hello,</DIV>
<DIV>After installing Farsitex 1.0 pre1, when I compile this error 
apperar"Cannot convert X.ftx to X.tex"</DIV>
<DIV>Please help me to&nbsp;correct this problem.</DIV>
<DIV>Thanks alot.</DIV><BR><BR><DIV>
<DIV><FONT face="comic sans ms" color=#ff7f00 size=1><STRONG>Nosrat 
Haghgoo</STRONG></FONT></DIV>
<DIV><STRONG><FONT face="Comic Sans MS" color=#8000ff>&nbsp;ä��� �ááå 
���æ</FONT></STRONG></DIV></DIV><p>
                <hr size=1>Yahoo! Mail Mobile<br>
<a 
href="http://us.rd.yahoo.com/mail_us/taglines/mobile/*http://mobile.yahoo.com/learn/mail";>Take
 Yahoo! Mail with you!</a> Check email on your mobile phone.
--0-115487747-1113726730=:89109--


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
FarsiTeX-user mailing list
FarsiTeX-user(_at_)lists(_dot_)sourceforge(_dot_)net
https://lists.sourceforge.net/lists/listinfo/farsitex-user


### End of Mail

Thanks,
Hossein

On Sun, 17 Apr 2005, Google Kreme <gkreme(_at_)gmail(_dot_)com> wrote:

On 17 Apr 2005, at 09:23 :02, Hossein Movahhedian wrote:
:0 H

There is a bug with the 'H' flag and it should not be used.

* 
^(From|CC|To)(_dot_)*farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net(_dot_)*

you don't need the final .*

FTR, I would simply write

* ^TO_:.*farsitex-user@

{
   :0 c:
   | echo "Mail received from: Ftex-user" >> $LOG_FILE

you don't ned a lock file, or a c flag, and I would use LOG instead
of echo, but that's personal taste, I think:

:0
* ^TO_:.*farsitex-user@
{
     OLDLOG=$LOGFILE
     LOGFILE=$LOG_FILE
     LOG="Mail Received from ftext-user$NL"
     LOGFILE=$OLDLOG

then this
   :0:
   $LISTS_DIR/.NEW_Ftex-user
}

And the header of an email from this list is:
...
Subject: Re: [ftex-user]FarsiTeX on teTeX
From: "S.M.H. Hamidi" <hamidi(_at_)ce(_dot_)sharif(_dot_)edu>
To: farsitex-user(_at_)lists(_dot_)sourceforge(_dot_)net

the only thing I can think of is are you SURE you're looking at a
plain text version of the headers?  None of the issues I addressed
should prevent the recipe from working.  You're going to need to give
us a VERBOSE=ON log, although I can guess we'll see a "No Match" line
for this list in that log.


There are better ways to do this, btw.  Here's my slightly modified
version of Sean's sorter:

# Unset LISTNAME, [  ]'s contain a space and tab
LISTNAME
:0
* 9876543210^0 ^(List-Post:[    ]*(<mailto:)?|List-Owner:[      ]*
(<mailto:)?owner-)\/[-A-Z0-9_+]+
* 9876543210^0 ^(List-Id:.*<|X-Mailing-List:[   ]*)\/[-A-z0-9_+]+
* 9876543210^0 ^(Sender:[       ]*owner-|X-BeenThere:[  ]*|Delivered-
To:[       ]*mailing list )\/[-A-Za-z0-9_+]+
* 9876543210^0 ^Sender:.* List"? <(mailto:)?\/[-A-Z0-9_+]+
{ LISTNAME=$MATCH
}

:0E
* ^Sender:[     ]*\/[-A-Z0-9_+]+-owner
{ LISTNAME=`echo $MATCH | sed -e s/-owner//i`
}

# You can change the following to log however you want.
:0
* ! LISTNAME ?? ^^^^
    LOG="List: $LISTNAME$NL"

    :0fw
    | formail -i "X-my-Listname: $LISTNAME"

    :0: $HOME/lock
    $MLDIR/$LISTNAME/$MYDATE.$LISTNAME

    # if the action failed, probably the directory does not
    # exist, so create it
    :0eW
    {
      LOG="FAILED WRITE$NL"
      MAKENEWDIR=`test -d $MLDIR/$LISTNAME || mkdir -p $MLDIR/
$LISTNAME/`

    }

    # Now save the message again
    :0a:
    $MLDIR/$LISTNAME/$MYDATE.$LISTNAME

    # If we get this far, something is quite wrong.
    # Still failed?  Better save the message somewhere we can check it
    :0
    {
      LOG="FAILED WRITE NEW DIRECTORY$NL"
      :0: $HOME/lock
      $MLDIR/FAILED_LIST_SORT

    }
}

This recipe set has the advantage of catching pretty much ANY list
message and sorting it.  very useful.

--
Try to realize it's all within yourself/No one else can make you change


____________________________________________________________
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



____________________________________________________________
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