4

Suppose a student is two hours late in returning an assignment. Now the assignment needs to travel a long way in internet so there is a good excuse that it got lost in somewhere or got jammed (well ok, fails but one always needs to find good reasons to return things a bit late in a funny way). Now is there some way you can make it look like the email was sent much earlier than it was actually sent?

Look I have strict timelines like 23.59, I am uncertain which clocks they use the measure that -- sending or arrival time and in which time-zone. Could I change the time-zone so my email becomes "on time"?

6
  • Why Mutt specifically?
    – cjm
    Apr 18 '12 at 23:58
  • 1
    Come on, you have a question about the time of an email sent by Mutt, and you pick some nonsensical tags instead of the obvious ones? You should engage your brain when asking questions. You've been here long enough to know how the site works. Apr 19 '12 at 0:05
  • @Gilles: let's think positively, one good failure! Perhaps there is something here -- I cannot yet understand, thinking. I mean about making things more practical.
    – user2362
    Apr 19 '12 at 1:13
  • The professor should not accept the time that the email was sent, but the time the email arrived in his/hers mailbox. It is up to the student to deliver the information in time; maybe email is not the best medium in this case. I think tampering with email headers is called 'fraud'.
    – jippie
    Apr 19 '12 at 6:35
  • 1
    @jippie: I hope that is not the case, a bit grey area here, I think this is more like joke -- there is something good-looking to return papers 777 -time... well, have to return papers then on time or perhaps in two copies :)
    – user2362
    Apr 19 '12 at 10:17
6

If you set the edit_headers option to yes, you can edit all the headers of a mail before sending, and you can set your own Date header. A legitimate use for this is choosing your own timezone, or your own calendar.

Each server that your email passes through will add a Received header containing the date at which it received the mail (or the date at which it deigned to process it). You can't fake these unless you have control of the server. More precisely, from the recipient's point of view, the headers are reliable starting with the last machine on the path that the recipient trusts.

A common reason for email delays is greylisting. It can be hard to predict whether a specific email will be greylisted, because the decision is partly based on a server's recent history with each sender. However, not all servers do greylisting, and the greylisting could add to your lateness anyway.

Of course, email can be delayed because of malfunction, ordinary maintenance, or general network flakiness. Email was designed to be extremely reliable but not necessarily fast (when it was invented, a lot of sites had no permanent network connection; email might be downloaded and uploaded once a day in some places). Nowadays, email isn't as reliable as it used to be, but it's often near-instantaneous. A delay can happen, but it's unusual.

If you don't know when your assignment is due, ask your instructor.

6
  • 1
    When I tried for example Date: Mon, 13 Feb 2012 07:07:07 +0700 just below the From: -field, the mail header with the Date was cleared with the current date...
    – user2362
    Apr 19 '12 at 3:15
  • @user2362 is right: edit_headers can not be used to set the Date header. Also it can not be used to set the User-Agent header. Jul 10 '15 at 17:27
  • Instead, you can use faketime. Jul 10 '15 at 17:33
  • @IngoBlechschmidt I tried adding set edit_headers = yes in .muttrc in my home directory but my header Date: Mon, 21 Feb 2016 13:37:42 +0100 was ignored. I also tried faketime -f "2016-02-21 13:37:42" mutt but it was freezing and mutt did not respond to any actions after displaying "Sending message...". I use Postfix for the mail server but it doesn't help if I try to use faketime with postfix start. A working solution is to change the system date with date -s "2016-02-21 13:37:42", then send a mail echo "hi" | mail -s test user@domain.tld (restore date with ntpdate pool.ntp.org).
    – baptx
    Feb 22 '16 at 18:23
  • @baptx Weird, it works for me. You could diagnose what mutt does when hanging by attaching strace to the running mutt process (strace -f -p PID_OF_MUTT). Changing the system date works, of course, but could be considered a bit brutal as some programs and services rely on the system time being approximately correct. Feb 22 '16 at 21:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy