Pegasus Mail & Mercury

Welcome to the Community for Pegasus Mail and
The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
Welcome to Pegasus Mail & Mercury Sign in | Join | Help
in
Home Blogs Forums Downloads Pegasus Mail Overview Mercury Overview Wiki

Extract message Content-Transfer-Encoding: base64

Last post 01-21-2020, 19:53 by Pierre. 14 replies.
Sort Posts: Previous Next
  •  01-19-2020, 15:07

    • Pierre is not online. Last active: 22 Jan 2020, 19:54 Pierre
    • Not Ranked
    • Joined on 05-13-2007
    • UK
    • Member
    • Points 100

    Extract message Content-Transfer-Encoding: base64

    I have a rule to extract the content of a message for further processing by auto-it. That message is Content-Transfer-Encoding: base64
    and shows perfectly fine in Pmail but the content of the extracted file is not decoded.

    The idea was to avoid to manually copy and past into a file.

     Is is possible to save the message after decoding?

     Thanks 



    - Pierre -
  •  01-19-2020, 20:45

    Re: Extract message Content-Transfer-Encoding: base64

    Hi,

    Look in your Pegasus Mail Help index after "Saving messages as text files (2)". It might be what you're looking for.

    I've being able to save messages, both plain-text and HTML, as well as extract attachments (PDF, ODF, XLSX, etc) using rule actions.


    Best,

    euler f german
    sete lagoas, mg, brazil
    Pegasus Mail 4.73.639 Standalone - Windows 7 Ultimate
    BearHTML 4.9.9.6 IERenderer 2.6.3.2
    Binaries: C:\PMAIL\Programs
    Mailboxes: C:\PMAIL\MAIL

    InsPMDic — Dictionary Handler Add-on (link on profile)
  •  01-20-2020, 1:19

    • irelam is not online. Last active: 02-19-2020, 19:36 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,385
    • BetaTeam Moderator

    Re: Extract message Content-Transfer-Encoding: base64

    With the message just opened, go to Windows Explorer and navigate to your TEMP directory. Scroll down to the last entries. You should find a file that is of the form WPM*.PM$  which is timestamped when you opened the message.  You will find that the message file contains the Html version of the message, decoded. You can then save that file somewhere, and finally close the message in Pegasus Mail.

    What you have got is the BASE64 decoded version of your message.  Open it in a browser, and the content will be formatted and contain any remote images

  •  01-20-2020, 10:23

    • Pierre is not online. Last active: 22 Jan 2020, 19:54 Pierre
    • Not Ranked
    • Joined on 05-13-2007
    • UK
    • Member
    • Points 100

    Re: Extract message Content-Transfer-Encoding: base64

    Thank you for your suggestions but I as I mentioned I am looking for an automated solution. 

    Currently I have a "New mail filtering rule" to "extract" to a file which saves the raw encoded message. I would like a rule that saves the decoded message.

    It looks like this is not possible, pity.

    Every week I receive a new set of data and I need to be sure the files is always the latest set. A manual save or copy & paste could be forgotten and the file out of date.

    As an aside, "extract" should be renamed "raw save"



    - Pierre -
  •  01-20-2020, 10:26

    • Pierre is not online. Last active: 22 Jan 2020, 19:54 Pierre
    • Not Ranked
    • Joined on 05-13-2007
    • UK
    • Member
    • Points 100

    Re: Extract message Content-Transfer-Encoding: base64

    Thank you for your suggestion, please see my reply to Euler.

    - Pierre -
  •  01-20-2020, 20:05

    Re: Extract message Content-Transfer-Encoding: base64

    Pierre:

    Thank you for your suggestions but I as I mentioned I am looking for an automated solution. 

    Currently I have a "New mail filtering rule" to "extract" to a file which saves the raw encoded message. I would like a rule that saves the decoded message.

    It looks like this is not possible, pity.

    Every week I receive a new set of data and I need to be sure the files is always the latest set. A manual save or copy & paste could be forgotten and the file out of date.

    As an aside, "extract" should be renamed "raw save"

    I got your point. The "Extract" rule action was meant to plain-text messages only. Strangely Pegasus Mail does have a routine to save encoded content and maybe David H. could make it available as a rule action too. For example, if you mouse right-click your target message and pick "Save message data to file (Ctrl+S)" from the menu, it will save the decode body to the chosen file.

    As mentioned behind, Pegasus Mail can save encoded attachments as decoded files. It would be a matter to extend this capability to the message body, I think.


    Best,

    euler f german
    sete lagoas, mg, brazil
    Pegasus Mail 4.73.639 Standalone - Windows 7 Ultimate
    BearHTML 4.9.9.6 IERenderer 2.6.3.2
    Binaries: C:\PMAIL\Programs
    Mailboxes: C:\PMAIL\MAIL

    InsPMDic — Dictionary Handler Add-on (link on profile)
  •  01-20-2020, 20:25

    • irelam is not online. Last active: 02-19-2020, 19:36 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,385
    • BetaTeam Moderator

    Re: Extract message Content-Transfer-Encoding: base64


    You can use my base64decode utility which is in http://community.pmail.com/files/folders/utils/entry51898.aspx.  You would use any base64 encoded file, and the result would be same filename with file extension set to txt.  So in Pegasus Mail your rule would extract and then run base64decode on whatever file has been saved.

    Martin


  •  01-20-2020, 20:51

    Re: Extract message Content-Transfer-Encoding: base64

    irelam:


    You can use my base64decode utility which is in http://community.pmail.com/files/folders/utils/entry51898.aspx.  You would use any base64 encoded file, and the result would be same filename with file extension set to txt.  So in Pegasus Mail your rule would extract and then run base64decode on whatever file has been saved.

    Martin


    Martin, if it is used within "Run a program" action I think Pegasus Mail passes message content to it automatically. Am I right?


    Best,

    euler f german
    sete lagoas, mg, brazil
    Pegasus Mail 4.73.639 Standalone - Windows 7 Ultimate
    BearHTML 4.9.9.6 IERenderer 2.6.3.2
    Binaries: C:\PMAIL\Programs
    Mailboxes: C:\PMAIL\MAIL

    InsPMDic — Dictionary Handler Add-on (link on profile)
  •  01-20-2020, 22:04

    Re: Extract message Content-Transfer-Encoding: base64

    Martin, did a test with an encoded body of the email and it's fooled by the headers (I think). OTOH if you extract ONLY the encoded body into a file it decodes fine to file.txt.

    Anyway, I think a workaround  to this "problem" would be using the rule action "Print" and print the message to a PDF printer set as the Pegasus Mail default printer.


    Best,

    euler f german
    sete lagoas, mg, brazil
    Pegasus Mail 4.73.639 Standalone - Windows 7 Ultimate
    BearHTML 4.9.9.6 IERenderer 2.6.3.2
    Binaries: C:\PMAIL\Programs
    Mailboxes: C:\PMAIL\MAIL

    InsPMDic — Dictionary Handler Add-on (link on profile)
  •  01-20-2020, 22:17

    Re: Extract message Content-Transfer-Encoding: base64

    Euler GERMAN:
    Anyway, I think a workaround  to this "problem" would be using the rule action "Print" and print the message to a PDF printer set as the Pegasus Mail default printer.

    No joy.Sad The Print rule action is plain-text only. It doesn't render the HTML code, just print it. Maybe using a macro runner like TinyTask could do if we had an action to "Open" the message.

    The OP said he uses an AutoIt script already, so I think he could add some lines to his code to locate the encoded text and decode it. There are some UDF's at AutoIt forum do decode Base64. Just my tuppence.


    Best,

    euler f german
    sete lagoas, mg, brazil
    Pegasus Mail 4.73.639 Standalone - Windows 7 Ultimate
    BearHTML 4.9.9.6 IERenderer 2.6.3.2
    Binaries: C:\PMAIL\Programs
    Mailboxes: C:\PMAIL\MAIL

    InsPMDic — Dictionary Handler Add-on (link on profile)
  •  01-21-2020, 0:30

    • irelam is not online. Last active: 02-19-2020, 19:36 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,385
    • BetaTeam Moderator

    Re: Extract message Content-Transfer-Encoding: base64

    yes if there is a rule that detects the base64 headers
  •  01-21-2020, 14:09

    • Pierre is not online. Last active: 22 Jan 2020, 19:54 Pierre
    • Not Ranked
    • Joined on 05-13-2007
    • UK
    • Member
    • Points 100

    Re: Extract message Content-Transfer-Encoding: base64

    Ah I think I can made this work with auto-it help, thank you.

    I'll experiment with "Run a program" 

    Incidentally, how do I make base64code Form1 close on its own?

    I was going to post a screen shot but cant see how to do it on this BB



    - Pierre -
  •  01-21-2020, 17:51

    • irelam is not online. Last active: 02-19-2020, 19:36 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,385
    • BetaTeam Moderator

    Re: Extract message Content-Transfer-Encoding: base64

    I will update it to auto-close, today

    Martin 

  •  01-21-2020, 18:04

    • irelam is not online. Last active: 02-19-2020, 19:36 irelam
    • Top 10 Contributor
    • Joined on 03-23-2007
    • Edmonton, Alberta, Canada
    • SuperStar
    • Points 22,385
    • BetaTeam Moderator

    Re: Extract message Content-Transfer-Encoding: base64

    Updated.

    Martin 

  •  01-21-2020, 19:53

    • Pierre is not online. Last active: 22 Jan 2020, 19:54 Pierre
    • Not Ranked
    • Joined on 05-13-2007
    • UK
    • Member
    • Points 100

    Re: Extract message Content-Transfer-Encoding: base64

    Brilliant, all working as I wanted.

     

    Thank you so much to all contributors 



    - Pierre -
View as RSS news feed in XML

Contact | Advertise | Host provider: PraktIT | Terms of Use | Privacy Statement
Copyright © 2007-2011 David Harris / Peter Strömblad. | Pegasus Mail Home Page