20

I'd like to see the mail's date in the list that appears when I start mutt.

How can I do that?

Mat
  • 52,586

1 Answers1

22

You can set the index_format variable to include all manner of different details about each message. In particular, you probably want the %d format string, which inserts the date formatted according to the value of date_format, or one of the other date format strings, such as %{fmt}, %[fmt], etc. As an example, here is my default index_format setting:

set 'index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s"'

Take a look at the documentation for more details on what you can configure, and what the extended date format strings represent.


config file

  • ~/.muttrc or ~/.mutt/muttrc
    User configuration file.

  • /etc/Muttrc
    System-wide configuration file.

#set date_format="%d %b %R"   # 06 May 07:55
set date_format="%F %T"       # 2021-05-06 09:20:03
set index_format="%4C %Z %D %-15.15L (%4l) %s"
yurenchen
  • 266
D_Bye
  • 13,977
  • 3
  • 44
  • 31
  • 12
    Note that if you used %d (sender's timezone) or %D (your timezone) in index_format, don't enclose it in the curly brackets. For example, if in .muttrc, you have set date_format="%d %b %R", you need to use set index_format="%4C %Z %D %-15.15L (%4l) %s" rather than "%4C %Z %{%D} %-15.15L (%4l) %s". Otherwise you'll get the strftime interpretation of %d or %D. As the man page for strftime says: "Yecch." (-: – Steve HHH Jan 25 '13 at 05:37
  • Perhaps of some use, if you use NeoMutt (a more featureful mutt), conditional dates are a built in feature: https://neomutt.org/feature/cond-date – Kyle Barbour Feb 01 '24 at 22:50