procmail
[Top] [All Lists]

Error while code execution

2009-10-22 14:12:33
Hello procmail geeks...

I am subscribed to a RSS feed and use "rss2email" the  get  it  into  my
mailbox.  The messages looks like:

----8<------------------------------------------------------------------
Date: Thu, 22 Oct 2009 07:50:46 -0000
From: Maxim - Data Sheets <info2(_at_)maxim-ic(_dot_)com>
To: foo(_dot_)bar(_at_)mail(_dot_)private(_dot_)tamay-dogan(_dot_)net
Subject: MAX1487, MAX481, MAX483, MAX485, MAX487, MAX488, MAX489, MAX490,
        MAX491 -- Low-Power, Slew-Rate-Limited RS-485/RS-422 Transceivers
User-Agent: rss2email

The MAX481, MAX483, MAX485, MAX487-MAX491, and MAX1487 are low-power 
transceivers for RS-485 and RS-422 communication. Each part contains one driver 
and one receiver. The MAX483, MAX487, MAX488, and MAX489 feature reduced 
slew-rate drivers that minimize EMI and reduce reflections caused by improperly 
terminated cables, thus allowing error-free data transmission up to 250kbps. 
The driver slew rates of the MAX481, MAX485, MAX490, MAX491, and MAX1487 are 
not limited, allowing them to transmit up to 2.5Mbps.

These transceivers draw between 120µA and 500µA of supply current when unloaded 
or fully loaded with disabled drivers. Additionally, the MAX481, MAX483, and 
MAX487 have a low-current shutdown mode in which they consume only 0.1µA. All 
parts operate from a single 5V supply.

Drivers are short-circuit current limited and are protected against excessive 
power dissipation by thermal shutdown circuitry that places the driver outputs 
into a high-impedance state. The receiver input has a fail-safe feature that 
guarantees a logic-high output if the input is open circuit.

The MAX487 and MAX1487 feature quarter-unit-load receiver input impedance, 
allowing up to 128 MAX487/MAX1487 transceivers on the bus. Full-duplex 
communications are obtained using the MAX488-MAX491, while the MAX481, MAX483, 
MAX485, MAX487, and MAX1487 are designed for half-duplex applications.

URL: http://www.maxim-ic.com/quick_view2.cfm/qv_pk/1111

----8<------------------------------------------------------------------

OK, now I have coded a liitle bit to fetch the "URL:", download and  put
the result back into the RSS-Mail, BUT, the  above  message  produce  an
error as:

----8<------------------------------------------------------------------

######################  Thu, 22 Oct 2009 19:50:59 +0200  ######################
Diskspace:   7276576 kByte
-------------------------------------------------------------------------------
From:        info2(_at_)maxim-ic(_dot_)com
To:          foo(_dot_)bar(_at_)mail(_dot_)private(_dot_)tamay-dogan(_dot_)net
Delivered-To: foo(_dot_)bar(_at_)mail(_dot_)private(_dot_)tamay-dogan(_dot_)net
Size:        2363 Bytes
Date:        Thu, 22 Oct 2009 07:50:46 -0000
Date (Recv): Thu, 22 Oct 2009 10:24:20 +0200
===============================================================================
            TOOL_nonet             : Pass [www.o2online.de]
            FLT_whitelist          : Pass [FLT_whitelist.DebianStaff]
            FLT_whitelist          : Whitelisted [FLT_whitelist.Global]
            BUSINESS_firms         : Maxim Integrated Products
procmail: Failed to execute "echo "${TMPVAR5}" |sed 's|<img 
src="http://media.maxim-ic.com/images/clear.gif"; width=[16] height=1>||g' 
|html2text -width 72 -nobs -style pretty |sed 's|\[IMAGE\]|       |g' |sed 
"s|^.*[ ]$||" |sed '$!N; /^\(.*\)\n\1$/!P; D' |sed 's|^                         
                                       ||g' |sed 's|^                           
                                     ||g' |sed 's|^                             
   ||g' |sed 's|^                ||g' ; :"
procmail: Failed to execute "echo -e "${TMPVAR2}" |grep 
"datasheets.maxim-ic.com/en/ds/" |head -n1 |sed 
's|.*http://datasheets|http://datasheets|' |sed 's|\.pdf" .*|.pdf|' ; :"
procmail: Failed to execute ""
From foo(_dot_)bar(_at_)mail(_dot_)private(_dot_)tamay-dogan(_dot_)net  Thu 
Oct 22 19:50:59 2009
 Subject: MAX1487, MAX481, MAX483, MAX485, MAX487, MAX488, MAX489, MAX490,
  Folder: .Business.USA.Maxim.Data_Sheets/new/1256233859.27844_1.samba     2351
----8<------------------------------------------------------------------

Can someone look into the code and maybe know,  where  this  pig  of  an
error is sitting?

----[ '~/.tdtools-procmail/BUSINESS_firms_maxim' ]----------------------
<snip>
  :0
  * ^From:.*(Data Sheets|New Product)
  {
    TMPVAR1=`mimedecode |grep "^URL: " |sed 's|^URL: ||' ; :`
    TMPVAR2=`wget --user-agent="tdtools-procmail v${TDTP_VERSION}" --quiet -O - 
${TMPVAR1} ; :`
    TMPVAR3=`echo -e "${TMPVAR2}" |sed -n '/^<!-- END: SITE HEADER -->/,$p' 
|sed 's|^<!-- END: SITE HEADER -->|<html><head></head><body>|' ; :`
    TMPVAR4=`echo -e "${TMPVAR3}" |sed '/^<!-- END: KEY SPECS -->/,//d' ; :`
    
TMPVAR5="${TMPVAR4}${NL}</table></table></table></table></table></table></table></body></html>"
    TMPVAR6=`echo "${TMPVAR5}" |sed 's|<img 
src="http://media.maxim-ic.com/images/clear.gif"; width=[16] height=1>||g' 
|html2text -width 72 -nobs -style pretty |sed 's|[IMAGE]|       |g' |sed 
"s|^.*[ ]$||" |sed '$!N; /^\(.*\)\n\1$/!P; D' |sed 's|^                         
                                       ||g' |sed 's|^                           
                                     ||g' |sed 's|^                             
   ||g' |sed 's|^                ||g' ; :`
    TMPVAR7=`echo -e "${TMPVAR2}" |grep "datasheets.maxim-ic.com/en/ds/" |head 
-n1 |sed 's|.*http://datasheets|http://datasheets|' |sed 's|\.pdf" .*|.pdf|' ; 
:`

    :0fw
    * ? test -n "${TMPVAR6}"
    | ( mimedecode ; \
        echo -e 
"\n========================================================================" ; \
        echo -e "\nPDF URL: ${TMPVAR7}" ; \
        echo -e 
"\n========================================================================" ; \
        echo -e "${TMPVAR6}" )
  }
  :0
  * ^From:.*Data Sheets
  .Business.USA.Maxim.Data_Sheets/
  :0
  * ^From:.*(Data Sheets|New Product)
  .Business.USA.Maxim.New_Product/
<snip>
----8<------------------------------------------------------------------

Hmmm, this code is working for 98% of all incoming RSS messages.


Thanks, Greetings and nice Day/Evening
    Michelle Konzack
    Systemadministrator
    Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
<http://www.tamay-dogan.net/>                 Michelle Konzack
<http://www.can4linux.org/>                   Apt. 917
<http://www.flexray4linux.org/>               50, rue de Soultz
Jabber linux4michelle(_at_)jabber(_dot_)ccc(_dot_)de           67100 
Strabourg/France
IRC    #Debian (irc.icq.com)                  Tel. DE: +49 177 9351947
ICQ    #328449886                             Tel. FR: +33  6  61925193

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>
  • Error while code execution, Michelle Konzack <=