Menu

Regex Multiline Searches on Received Headers

2023-04-30
2023-04-30
  • visualperception

    Question for Pete Maclean or other developers who may have an answer.

    I would like to do a regex search of Received headers, There are a couple of problems I have with doing this.
    Firstly: When the mail arrives into Eudora the received headers have been split into one two or three or more lines each with its end of paragraph marker.
    As far as I can tell this makes it is impossible to do a multiline search on the Received headers.
    Would it be possible to split the lines with a newline character instead of an end of paragraph marker except the last split line which should have an end of paragraph marker?
    I think this would make a multiline search possible.
    And Secondly: how do I invoke a multiline search in regex? I see that we are using the Posix version of regex but not sure how I go about it. There are loads of different recommendations on the web depending on exactly which app you are running but I haven't found anything on doing this in Eudora.

    Thanks

    Rob C

     
    • DJonsson

      DJonsson - 2023-04-30

      Hi VP,

      Per concatenation of lines broken by
      CR/LR

      "...split into one two or three or more lines each with its end of
      paragraph marker."

      In data translation processes we come across this often.

      Looking at Eudora headers

      • Lines that do not break have no leading indentation, spaces, tabs or
        dashes.

      • Lines that break always with CR/LF followed by indentations using
        spaces, tabs or dashes.

      Using sed, python, msword, notepad++
      or other text processing tool
      its an easy task to

      • Find the lines that end in CR/LF followed by a space, tab or dash

      • then
        Replace "paragraph marker" and what tabs, dashes and spaces that follow
        it on the broken line...
        ...with paragraph marker + single space.

      Once lines are concatenated in this manner
      finding entire specific lines would be much easier.

      Curious to know if Eudora MBXs would be agnostic to this re-formatting
      of the
      header lines. This of course would not
      be an issue if this is being done to a
      copy of an MBX file for the purpose of
      some external process.

      Best regards

      Darrell

      On 4/30/2023 4:17 PM, visualperception wrote:

      Question for Pete Maclean or other developers who may have an answer.

      I would like to do a regex search of Received headers, There are a
      couple of problems I have with doing this.
      Firstly: When the mail arrives into Eudora the received headers have
      been split into one two or three or more lines each with its end of
      paragraph marker.
      As far as I can tell this makes it is impossible to do a multiline
      search on the Received headers.
      Would it be possible to split the lines with a newline character
      instead of an end of paragraph marker except the last split line which
      should have an end of paragraph marker?
      I think this would make a multiline search possible.
      And Secondly: how do I invoke a multiline search in regex? I see that
      we are using the Posix version of regex but not sure how I go about
      it. There are loads of different recommendations on the web depending
      on exactly which app you are running but I haven't found anything on
      doing this in Eudora.

      Thanks

      Rob C


      Regex Multiline Searches on Received Headers
      https://sourceforge.net/p/hermesmail/discussion/general/thread/6085b35f85/?limit=25#b2d4


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/hermesmail/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • visualperception

    Thanks Darrell,
    In a couple of emails with multi line Received headers I concatenated the multi lines of each Received header into a single line and saved the mbx file, deleted toc file and restarted Eudora. Eudora seems to have no problem handling the longer record lengths. So a mod to eudora to conactenate its multiline Recieved headers into one line would work as far as i can tell. This would make using a regex filter on Received headers much easier to handle.

    Rob C

     
    • visualperception

      Is that something that could be done to Eudora as the messages are fetched from the mail host or are you suggesting that I perform this after messages have been fetched which is not what I was looking for. i.e. I wanted to use a filter when fetching new emails?

      Rob C

       

Log in to post a comment.