Share Pastebin
Guest
Public paste!

mailextract_py-patchtxt

By: a guest | Sep 19th, 2009 | Syntax: None | Size: 0.82 KB | Hits: 649 | Expires: Never
Copy text to clipboard
  1. --- mailextract.py.1    2006-04-26 23:56:34.000000000 +0200
  2. +++ mailextract.py      2009-09-19 11:30:38.000000000 +0200
  3.  -64,6 +64,14 @@
  4.          if namedonly and not name:
  5.              src.read()  # Read to next boundary.
  6.              continue
  7. +        type = headers.gettype()
  8. +        if type == "text/plain" :
  9. +            continue
  10. +        if type == "multipart/digest" :
  11. +            boundary = headers.getparam("boundary")
  12. +            src.push(boundary)
  13. +            src.read()
  14. +            continue
  15.          encoding = headers.getencoding()
  16.          if not encoding:
  17.              raise error, "unknown message encoding"
  18.  -80,6 +88,7 @@
  19.              mimetools.decode(src, dstfile, encoding)
  20.          if dstdir:
  21.              dstfile.close()
  22. +        print
  23.  
  24.  def usage():
  25.      cmd = os.path.basename(sys.argv[0])