Menu

Date-Format in From_ Lines

Help
2005-06-16
2013-05-01
  • Thomas Kock

    Thomas Kock - 2005-06-16

    Hello Ben!
    First of all, many thanks for mstor!

    (The following is based on 0.9.4 and Linux)
    As a test on the mstor-files, I copied a mstor-file to the var/spool/mail directory where the pop3 deamon would open it. Then I connected to the POP3 Server and tried to load messages from there.
    The Pop3 Server did not provide the messages out of the mstor file and complained about the From_ lines. After digging around I found:
    - mstor saves the From_ lines with a date formatted in the current locale. ("Do Jun 9 10:11:12 2005") (German locale)
    - when manually changing the Dates in the mstor-files, the Linux-Pop3-Server did not complain. ("Do" ->"Thu")
    - Ive applied the following changes to the sources:
      in MboxFile.java and in MetaDateFormat.java:
      from:
      SimpleDateFormat(<DATE_FORMAT>)
      to:
      SimpleDateFormat(<DATE_FORMAT>, Locale.US)
    - after those changes, mstor saves the received-Date in the From_ line in the US-Format ("Thu Jun 9 10:11:12 2005")
    - now I can copy the mstor file to the POP3 Server and it wont complain.

    Another thing Id like to mention (but the pop Server doesnt complain about it):
    If I open an mstor File on Linux with vi, all lines except the From_ lines end with "^M". (I cannot tell, which format would be right, I just notized it...)

    my 2 cents
    Thomas

     
    • Ben Fortuna

      Ben Fortuna - 2005-06-16

      Hi Thomas,

      Thanks for the feedback, I've now updated the date formats to be US-specific as you suggested.

      With the "^M" characters, these are actually carriage return (CR) characters present in Windows-centric ascii files. I think their presence in the mbox file may be a symptom of the file encoding I am using: "ISO-8859-1". I had changed this to use the default file encoding for the operating system, however this seemed to cause problems for some Linux users so I changed it back.

      I'm sure there must be some file encoding that is most appropriate for an mbox file (UTF8 perhaps?) but I haven't come across any definitive answer yet.

      If you want to experiment with different file encodings you can specify the system property:

      mstor.mbox.encoding=<some_encoding>

      regards,
      ben

       
    • Thomas Kock

      Thomas Kock - 2005-06-16

      HI Ben,

      Many thanks, that was a quick reply.

      Regarding the ^M:
      It usually comes up, when a file from Windows is copied over to a Linux box and doesnt get converted. (Win uses CRLF as End of Line, where Linux/Unix just uses LF - so the unwanted CR aka ^M ist displayed).
      What happens inside mstor I currently dont know. But when the need arises, we could still dig into it...

      Thomas

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.