procmail
[Top] [All Lists]

[SOLVED] Re: How to let procmail use mre memory?

2010-01-31 17:33:22
Hello *,

Now it is solved using following script:

----[ '~/.tdtools-procmail/BUSINESS_firms_maxim' ]----------------------
<snip>
  :0
  * ^From:.*Application Notes
  {
    # Eliminate any encodings
    TMPVAR1=`mimedecode |grep --max-count=1 "^URL: " |sed 's|^URL: ||' ; :`

    # Get the number of the AppNote
    TMPVAR2=`echo "${TMPVAR1}" |sed 's|.*an_pk/||' |tr -d ' ' ; :`

    # Download the AppNote
    TMPVAR3=`wget --user-agent="tdtools-procmail v${TDTP_VERSION}" --quiet -O - 
${TMPVAR1} ; :`
    :0
    * ? test -n "${TMPVAR3}"
    {
      # Get the link to the PDF
      TMPVAR4=`echo -e "${TMPVAR3}" |grep 'pdfserv' |head -n1 |sed 
's|.*http://pdfserv|http://pdfserv|' |sed 's|\.pdf.*|.pdf|' ; :`

      :0fw
      | ( formail -i "Subject: [${TMPVAR2}] ${MSG_SUBJECT}" ; \
          echo 
"========================================================================${NL}" 
; \
          echo "PDF URL: ${TMPVAR4}${NL}" ; \
          echo 
"========================================================================${NL}" 
; \
          echo "####_BEGIN_HTML_2_####" ; \
          echo "####_BEGIN_HTML_H_####" ; \
          echo "####_BEGIN_HTML_1_####" ; \
          echo "${TMPVAR3}" ;  \
          echo "####_END_HTML_1_####" ; \
          echo "####_END_HTML_2_####" )

      TMPVAR3=""

      :0fw
      * B ?? APPLICATION NOTE&nbsp;
      | sed '/####_BEGIN_HTML_1_####/,/APPLICATION NOTE&nbsp/d' |sed 
's|.*APPLICATION NOTE&nbsp;|<html><head></head><body><table><tr><td>APPLICATION 
NOTE |'
      :0fw
      * B ?? ! \<html\>
      | sed 
's|####_BEGIN_HTML_H_####|<html><head></head><body><table><tr><td>APPLICATION 
NOTE |'

      :0fw
      * B ?? REFERENCE DESIGN&nbsp;
      | sed '/####_BEGIN_HTML_1_####/,/REFERENCE DESIGN&nbsp/d' |sed 
's|.*REFERENCE DESIGN&nbsp;|<html><head></head><body><table><tr><td>APPLICATION 
NOTE |'
      :0fw
      * B ?? ! \<html\>
      | sed 
's|####_BEGIN_HTML_H_####|<html><head></head><body><table><tr><td>REFERENCE 
DESIGN |'

      # Eleminate the unused FOOTER
      :0fw
      * B ?? \<\!\-\-\ BEGIN:\ EE\-MAIL\ \-\->
      | sed '/<\!\-\- BEGIN:\ EE\-MAIL \-\->/,/####_END_HTML_1_####/d'

      # Attach a footer if there is no one
      :0fw
      * B ?? ! \</html\>
      | sed  -e 
"s|####_END_HTML_2_####|\n</table></body></html>\n####_END_HTML_2_####|"

      TMPVAR9=`sed '/####_BEGIN_HTML_2_####/,/####_END_HTML_2_####/!d' |grep -v 
'HTML_2_####' |html2text -width 72 -nobs -style pretty |sed '$!N; 
/^\(.*\)\n\1$/!P; D' ; :`

      :0fw
      * ? test -n "${TMPVAR9}"
      | ( sed "/####_BEGIN_HTML_2_####/,/####_END_HTML_2_####/d" ; \
          echo "${TMPVAR9}" )
    }
    :0
    .Business.USA.Maxim.App_Notes/
  }
<snip>
------------------------------------------------------------------------

It is tested on my own Mail-Server and the Backup

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