I've successfully configured fetchmail and I'm able to download messages from the mail server but I'm not sure how to get the date on which a particular email was received. I need this date for reporting purposes.

  • 2
    Define "received". Do you mean the date it was sent from the sender's mail server, the date it was received by your mail server or the date it was downloaded by fetchmail? – Jenny D Apr 21 '14 at 14:00
  • The date it was received by my mail server. – user1711845 Apr 21 '14 at 14:10

That date is found inside the email headers. They look a bit like this:

Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [])
        by mailserver.example.com (Postfix) with ESMTP id DCFEE3983D
        for <someaddress@example.com>; Tue, 23 Jul 2013 20:32:34 +0200 (CEST)
Received: by mail-pd0-f170.google.com with SMTP id x11so8452192pdj.29

Every mail server that the email passes by will add its own received-line on top of the preceding ones. Look for the one containing the host name of your mailserver and get the date from there.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.