[neomutt-users] *-hook settings. I'm confused

Andrew Sullivan ajs at anvilwalrusden.com
Tue Aug 6 03:47:30 CEST 2019


Hi,

Just to set the level of expectation so that people don't think I'm
some sort of code-spelunking person who knows what to do because I
read the source: I was still studying _philosophy_ when I decided to
use mutt.  I have managed to make something work using the docs and
stuff posted online.  I fully grant the hook system is hard to
understand.  But it's enormously flexible once you understand it.
Think of it as the emacs lisp of MUAs ;-) (And no, I haven't mastered
that either.)  Some stuff inline.  I shorten neomutt to mutt below,
because it's easier to type.

On Sun, Aug 04, 2019 at 09:10:54AM -0700, Chris Bennett wrote:

> Right now, I am using Maildir on OpenBSD with OpenSMTPD.
> I am going to setup Dovecot.

So, you have one mailbox there (which later might be IMAP, but is now
just a mailspool)?

> With several different users, I've got different configs, with or
> without extra mailboxes. I can't get anything to go into INBOX.

I totally don't understand the above, so I'm sorry to ask stupid
questions:

	1.  Do you have different users of the same mutt installation?

	2.  Are you using one mutt for multiple mail accounts?

	3.  What is the "extra mailboxes" bit of which you speak?

Sorry about the hip replacement.

What I have is a .mailboxes file that says something like this:

mailboxes imaps://server.example/INBOX imaps://server.other.example
set spoolfile=imaps://server.other.example

Then I have a file with credentials in it that reads something like this:

account-hook . 'unset imap_user; unset imap_pass; unset tunnel;'
account-hook imaps://server.example/ 'set imap_user=[login] imap_pass=[pass]'
account-hook imaps://outlook.office365.com 'set imap_user=[login] imap_pass=[pass]'

folder-hook 'imaps://server.example/*' 'set hostname=[]; set smtp_url=[]; set reverse_name; set from=[]; set folder=[]; set record="=sent-mail-`date +%Y-%m`"

Now, mote the record thing above.  It allows every mail sent to go to
sent-mail-[current date here].  This is an old trick that's in an old
mutt faq I saw -- I've been using it at least since the late 90s.
This is part of why the hook system is so cool.

Do something similar with folder-hook for all your accounts.

Similarly, for sending:

send-hook '~f [yourregexhere]' 'set signature=~/.mutt/.somesig; set smtp_url="smtp://user@place:[pass]@server/"; set folder="imaps://server.com/"'

HTH!

A


-- 
Andrew Sullivan
ajs at anvilwalrusden.com


More information about the neomutt-users mailing list