mutt-expires-editor.sh
Last modified: Monday, 04-Feb-2002 11:18:36 PST
This shell script needs to be set as the expires_editor:
set expires_editor = "~/bin/mutt-expires-editor.sh"
This is a patch I wrote a couple years ago to be able to add and edit expires headers. I found this is the only way I can control the size of my inbox. When a thread arrives I decided how long it will be before I deem that information irrelevant, and then set the message to expire after that amount of time. Occasionally I go through my mailbox and delete all threads that have expired.
Note: Gary Johnson wrote a more elaborate shell script that is able to edit expires without the patch to mutt. It is available here.
The messages I sent for announcement to mutt-dev:
A summary:
I always liked the idea of auto-expiring messages, but there was never a way to add an expires header from within mutt. This patch adds a command 'expires', bound to 'E' in the index and the pager. If an expires header already exists in the message then it lets you edit the existing value. The patch leverages the existing edit message code and doesn't actually add the header itself, but rather passes the old message to a external program that adds the header. This seemed like the least invasive method to me.
I have included the shell script I use for adding the header. To use it, set the variable expires_editor to the location of this script. It uses formail and the GNU date command, but a similar script could be written in perl. The nice thing about using the GNU date command is that you can pass it arguments like: 'friday', '2 weeks', '1 month', etc and it returns an RFC-822 date string.
~X has been bound to 'message that will expire in the future'. Ideally I would liked to have used ~e, but that is already taken by sender and I doubt people want to retrain their fingers.
The index display has been tweaked to add a 'e' (will expire, the same meaning as ~X) in the same field that the PGP info is in. The order of precedence, from low to high is 'eSPsKE'. Thus, 'e' is the least important and 'E' is the most important.
I have started working on a version of the above expires editor that works entirely internally without the need for the external programs. This version is incomplete and does not fully work yet. It can add, edit, and view Expires: headers, but they do not get written to disk. I put out a plea for help on mutt-dev. If anyone has any ideas I would love to hear them.
This was a quick and dirty hack to allow multiple mailboxes to be specified in the Fcc: header. It expects mailboxes to be separated by a comma.
If someone has a cleaner implementation I would love to see it.
When I started playing with S/MIME support in conjunction with the Sympa mailing list software I discovered that messaged encrypted by me and sent to a mailing list, where they are reencrypted to each recipient, could not be read by me. This patch makes mutt check the sender when trying to decrypt S/MIME messages.
This patch adds support for encrypting to the key in
$smime_default_key
in addition the the recipients.
This allows you to send encrypted S/MIME email and still read the
message you have sent.
Updated Sep 25, 2002 Fixed a major thinko in the design. Changed the option to a quad option.
Updated July, 2009 Updated for mutt 1.5.19. Fixed an error when freeing new_keylist.
This is an adaptation of a patch named patch-1.2.xtitles.1 (original author unknown). This patch is used to set the title or icon of the X terminal mutt is run under. I have taken out the code that checked to make sure the TERM was xterm. Instead I source a config file based on my current terminal.
In my muttrc:
In ~/.mutt/muttrc-{rxvt,xterm}:
source ~/.mutt/muttrc-$TERM
The only real drawback to this method is that when I start mutt
under a TERM when I don't have a corresponding muttrc-$TERM file I
get an error about a missing file.
# xterm_icon = "M%?n?AIL&ail?"
set xterm_icon = "mutt: %f %?n?N:%n&? %?b?B:%b?"
# xterm_set_titles = no
set xterm_set_titles = yes
# xterm_title = "Mutt with %?m?%m messages&no messages?%?n? [%n NEW]?"
#set xterm_title = "%f:%r (%?V?%L/?%l) %?M?'%V' ?[Total:%?M?%M/?%m%?n? New:%n?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?b? Buf:%b?%?p? Post:%p?] %> (%s)(%P)"
set xterm_title = "mutt: %f%?n? N:%n&?%?b? B:%b?"
FIXME: The right fix to this would be to use curses to check to see if the terminal supports the capability of setting the X title and icon.
This file last modified Thursday, May 5, 2016.