EarthIsHome
EarthIsHome

Reputation: 735

Show if a message in the mutt index has an attachment

Is there a way to have Mutt's index show if a message has an attachment?

This would be similar to how Gmail shows a paperclip next to messages with an attachment.

I can limit the messages with attachments using ~X 1-15, but it's nice to see whether messages have an attachment in the index.

Upvotes: 6

Views: 2509

Answers (2)

user3236841
user3236841

Reputation: 1258

To put a paper clip for an attachment, the following works for me (and also puts blanks correctly).

set index_format="%Z %?X?📎&  ? %{!%a %b%d'%y %I:%M:%S%p%Z}  %-12.12L  %?M?(#%03M)&(%4c)?  %?y?(%.20Y) ?%s"

I made it a bit more concise to save on screenspace...

Upvotes: 3

Juancho
Juancho

Reputation: 7372

You can add the number of attachments (%X) to the index format setting.

For example, this shows the number of attachments after the status flags:

set index_format="%4C %Z %X %{%y%m%d} %-12.12L %?M?(#%03M)&(%4c)? %?y?(%.20Y) ?%s"

Or, if you only want an indicator, you can use conditionals. If instead of %X you put %?X?A&-?, you'll get A for messages with attachments, and - for messages without.

Search for the chapter Format strings in the supplied documentation.

Upvotes: 11

Related Questions