Loading ...
Sorry, an error occurred while loading the content.

Re: Significantly different date observed in Received and Date fields

Expand Messages
  • Mike Seda
    It s possible to modify the Date field on MUA side, if one were so inclined, right? If so, how would that be accomplished? Mike ... the user s computer
    Message 1 of 8 , Aug 25, 2013
    • 0 Attachment
      It's possible to modify the Date field on MUA side, if one were so inclined, right?

      If so, how would that be accomplished?

      Mike


      On Sunday, August 25, 2013, LuKreme <kremels@...> wrote:
      >
      > On 25 Aug 2013, at 10:15 , Mike Seda <mike@...> wrote:
      >
      >> Receiving such emails makes it very hard to follow certain conversations.
      >>
      >> One such example looked like this...
      >> Received: Sat, 24 Aug 2013 18:16:40 -0700 (PDT)
      >> Date: Thu, 01 Aug 2013 17:52:46 +0200
      >>
      >> What would cause such a thing?
      >
      > Almost always it is the user's computer with a bad clock. Sometimes it is the user's computer intentionally set back because of some shareware software check. Very rarely it is their mailserver not getting messages out. Very very rarely.
      >
      > Long time ago I had a check in header_checks that looked for mail that was of the wrong year, but it rejected so little that I disabled it last time I forgot to deal with the end of the year correctly.
      >
      > The only thing I do in headers now is a mime_headers.pcre check, and even that rarely fires.
      >
      > In fact, it hasn't fired in the last 7 days.
      >
      > /^\s*Content-(Disposition|Type).*name\s*=\s*"?(.*\.(ade|adp|bas|bat|chm|cmd|com|cpl|crt|dll|exe|hlp|hta|inf|ins|isp|js|jse|lnk|mdb|mde|mdt|mdw|msc|msi|msp|mst|nws|ops|pcd|pif|prf|reg|scf|scr\??|sct|shb|shs|shm|swf|vb[esx]?|vxd|wsc|wsf|wsh))(\?=)?"?\s*(;|$)/x REJECT Attachment name "$2" may not end with ".$3"
      >
      > The last time that triggered was 30 Jul, which was before I installed 2.10
      >
      > Jul 30 08:11:23 mail postfix/cleanup[85134]: 70DB4118AE62: reject: header Content-Type: application/octet-stream; name="invoice9DK0GMQWRDMCRCP8LT.PDF.exe" from local; from=<no-replay@...>: 5.7.1 Attachment name "invoice9DK0GMQWRDMCRCP8LT.PDF.exe" may not end with ".exe"
      >
      > Frankly, postscreen does such a good job that many of the checks I used to do are now useless.
      >
      > --
      > Windle shook his head sadly. Five exclamation marks, the sure sign of an
      > insane mind. --Reaper Man
      >
      >
    • LuKreme
      ... Yes, but I am having trouble thinking of a case where it is really actually truly a good idea. ... I d use procmail and formail? You could add a header
      Message 2 of 8 , Aug 26, 2013
      • 0 Attachment
        On 25 Aug 2013, at 22:41 , Mike Seda <mike@...> wrote:
        > It's possible to modify the Date field on MUA side, if one were so inclined, right?

        Yes, but I am having trouble thinking of a case where it is really actually truly a good idea.

        > If so, how would that be accomplished?

        I'd use procmail and formail? You could add a header X-Date-Received or simply overwrite the header, or even do something like put the contents of Date: into X-Old-Date and write the current date into a new Date:

        It's not as trivial as you might think to do it right. For example, you would need to account for pesky things like time zones.

        Also, if you use Maildir, the 'header' date is not really that important; it is the date stamp when the file was written that determines sorting, for example.

        I did this long ago in procmail to 'repair' some mbox files (so it rewrote the FROM_ header), but when I had to reprocess a bunch of mail that was munged, I had to grab the date out of the received header for my server and parse it to reformat it for the FROM_ header. The idea should be basically the same for rewriting the Date header, but is probably easier as I think, generally, Received dates and Date: headers are the same format?

        Received: Sun, 25 Aug 2013 22:42:02 -0600 (MDT)
        Date: Mon, 26 Aug 2013 00:41:35 -0400

        Almost the same. Almost.

        If I were doing it now I would probably do something like feed the Received date into gnu date with a timezone change, and use the output to set the new header; that should work pretty easily.

        $ gdate --date='TZ="-0600" Mon, 26 Aug 2013 00:41:35 -0400'
        Sun Aug 25 22:41:35 MDT 2013

        Put in a comma and the timezone offset -0600 and Robert is your mother's brother.

        I may write something to rename the Maildir files (which use an epoch timestamp) to the correct epoch time for their Date: headers. I have a few thousand messages from 2009 that sort incorrectly because their names are wrong in the maildir.

        --
        Nihil est--in vita priore ego imperator Romanus fui.
      • John Levine
        ... The easiest way is to change the clock in your computer, then send the message, then change it back.
        Message 3 of 8 , Aug 26, 2013
        • 0 Attachment
          In article <CAHb6j2NJd-Vzhw_rEjNDNMnWyv5Yv2GvyPw3UCPTi7yoD3Fu2Q@...> you write:
          >-=-=-=-=-=-
          >
          >It's possible to modify the Date field on MUA side, if one were so
          >inclined, right?
          >
          >If so, how would that be accomplished?

          The easiest way is to change the clock in your computer, then send the
          message, then change it back.
        Your message has been successfully submitted and would be delivered to recipients shortly.