💾 Archived View for librehacker.com › gemlog › starlog › 20230427-1.gmi captured on 2024-05-10 at 11:14:18. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
I recall there were some posts a while back — somebody complaining about there not being enough technical content in geminispace. Or was it too much? I can't remember. Anyway, here are some notes on Mutt configuration.
One of the great things about Mutt is that is can be configured, customized, and reprogrammed with much the same depth and flexibility as you get with other free software packages like Emacs. With Mutt, you don't get a full-fledged lisp environment to write programs on top of it, like in Emacs. But it does have variables, functions, hooks, and programmable keyboard macros. It also has something called "MuttLisp" but it has less than a dozen words, not including any of the usual lisp primitives you would expect for writing programs or building syntax.
The tradeoff is that things are not necessarily set up "out of the box" the way you might expect coming from Gnome Evolution or another pop e-mail client. Here are some things I had to mine out of the info manual over a day or three:
The manual warns you against putting your IMAP/SMTP password(s) in cleartext in your configuration file, which makes sense, but the alternative isn't obvious. The approach I took was to store the password (the same for both) in the external "pass" program. The Mutt configuration system allows you to use bash-style command substitution with backticks, so something like this is easy:
set smtp_url = "smtp://christopher@librehacker.com@smtp.kolabnow.com:587/" set smtp_pass = `pass kolabnow.com/imap/christopher@librehacker.com` set imap_user = "christopher@librehacker.com" set imap_pass = `pass kolabnow.com/imap/christopher@librehacker.com`
See PASS(1) for information on adding the password(s) to pass.
I wanted to use a shorter signature when responding to e-mails, vs. a longer signature otherwise. For this, you just need to create two signature files, and then include
send-hook '! ~Q' 'set signature="~/.mutt/sig"' reply-hook . set signature="~/.mutt/sig-short"
color normal white default color hdrdefault brightwhite default color attachment cyan default color indicator cyan default color quoted brightgreen default color status default cyan color tree red default
This binds Control-b to launch urlscan, an external program.
macro index,pager \cb <pipe-message>"urlscan -d"<enter> "urlscan urls" macro attach,compose \cb <pipe-entry>"urlscan -d"<enter> "urlscan urls"
I use this little macro to Archive stuff quickly. Upon pressing Control-a, it copies the e-mail to the =Archive folder, and then marks the e-mail for deletion.
macro index,pager "\Ca" "C=Archive<enter><enter>d"
Personally, I like MIME forwarding much better than inline.
set mime_forward = "yes"
First of all, you want to add (server-start) to your emacs init file, and become familiar with EMACSCLIENT(1).
Next, add this to your .muttrc:
set editor = "emacsclient -c"
Then, when you go to compose a new e-mail (properly speaking, edit the message content) a new emacs frame will pop up immediately, for writing the message. But it will use emacs-server rather than having to load a new emacs instance, which can be a lot slower.
In my DE (Gnome) the new frame is small on the screen, so I added the following to my emacs init file, to cause new frames to start out maximized.
(add-to-list 'default-frame-alist '(fullscreen . maximized))
By default, if you start an e-mail editing session in Emacs, than mutt will pause until the session is done. This is inconvient when you need to lookup something else in another e-mail before you have finished your session. You just need to add this to your .muttrc:
set background_edit
Then mutt will, when it pauses, give you the option of pressing a key to background the session (which does not close your external editor), and also resuming backgrounded sessiosn with the <background-compose-menu> function (bound by default to 'B).
With the default settings, your e-mail aliases (i.e., address book) will be tacked on to the end of your .muttrc. Instead, move them over to a separate file at "~/.mail_aliases" and then add this to your .muttrc:
source ~/.mail_aliases set alias_file=~/.mail_aliases
I like to have my =Archive folder reverse sorted, but my =Inbox sorted normally. Folder-hooks to the rescue.
# Set sorting behavior for these folders folder-hook =Archive 'set sort=reverse-date-sent' folder-hook =Inbox 'set sort=date-sent' folder-hook =Inbox 'set sort=threads'
See the info manual for more options.
It is sometimes possible to see what e-mail program was used to send an e-mail. To make this visible by default:
unignore x-mailer:
I like to enable autocrypt headers, though to be honest I don't know if I'll ever meet anybody else using them.
set autocrypt