procmail
[Top] [All Lists]

Re: base64-decoding (v.1.00) with 'just' procmail (enhanced)

2004-03-11 06:00:46
Toen ik Ruud H.G. van Tol kietelde, kwam er dit uit:

# Filename: base64.rc.inc
[...]
#---calculate b64_3 DIV 4
  b64_3_div4 = 0

That should've been:
  b64_3_div_4 = 0


*_N_*_E_*_W_*_S_*

I reshaped b64 to make it handy for decoding things like
  Subject: =?iso-8859-1?b?ewqfhwqfksd=?=

I now called it bq, because I also want it to decode qp.


# Filename: bq_Test.rc
# --------------------

  SHELLMETAS

  NL    = "
" SPACE = " "
  TAB   = "     "
  WS    = "$SPACE$TAB"

#  VERBOSE=on

  bq_Input  =\
"=?iso-8859-1?b?TmV3cyBMaW5lOiBSZXZvbHV0aW9uYXJ5IEhHSCBQaWxscw==?="

  LOG       = "$NL(${bq_Input})$NL"
  INCLUDERC = bq.inc
  LOG       = "$NL(${bq_Return})$NL$NL"

  :0
  /dev/null


# Filename: bq.inc
# --------------------

  bq_Return  # unset

  :0
  * bq_Input ?? ^^=\?[a-z0-9-]+\?b\?\/[^?]+
  {
    b64_Input  = $MATCH
    INCLUDERC  = b64.inc
    bq_Return  = $b64_Return
    b64_Input  # unset
    b64_Return # unset
  }

  :0E    # non-functional yet
  * !
  * bq_Input ?? ^^=\?[a-z0-9-]+\?q\?\/[^?]+
  {
    qpr_Input  = $MATCH
    INCLUDERC  = qpr.inc
    bq_Return  = $qpr_Return
    qpr_Input  # unset
    qpr_Return # unset
  }

  :0E
  { LOG = "bq:${TAB}Don't know how to handle: ${bq_Input}${NL}" }


# Filename: b64.inc
# ------------------
See http://www.xs4all.nl/~rvtol/procmail/bq

# Filename: b64.inc.inc
# ---------------------
See http://www.xs4all.nl/~rvtol/procmail/bq


-- 
Affijn, Ruud

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>