In mutt, if want you use multiple sending profiles, you typically create different config files for each profile, and then switch between them by a macro, some program like muttprofile or based on recipient (send-hook) or current folder (folder-hook).
I had different problems with these approaches (mostly due to my laziness):
That's why I wrote the small python program muttlearn, which scans mailboxes that contain outgoing mail, and automatically generates send-hooks. There aren't distinct profiles anymore, but it is learned how you want to write mails based on your prior written emails. Currently, these properties can be learned/generated for a recipient or a group of recipients:
$from
and $realname
or my_hdr
$signature
$send_charset
$attribution
and $date_format
.Hey Bob, Regards, Alice
$crypt_autoencrypt
, $smime_is_default
,
$smime_default_key
, $pgp_sign_as
.Of course, all this behavior can be customized / switched off partly in the configuration file! Also, muttlearn and the config-file based profiles are not mutually exclusive, they can be used concurrently!
Just get the source from the git repository on github:
git clone https://github.com/weisslj/muttlearn.git
optional (but recommended) dependencies: guess_language, PyMe
for python >= 2.6
python setup.py install --user
export PATH=$PATH:~/.local/bin
You can also use --prefix
but you may need to adapt
PYTHONPATH
in this case.
for python 2.5:
python setup.py install --prefix ~/.local
export PYTHONPATH=~/.local/lib/python2.5/site-packages
export PATH=$PATH:~/.local/bin
For removal, just delete all installed files, e.g.:
rm -rvf ~/.local/bin/muttlearn ~/.local/lib/python*/*-packages/muttlearn*
doc/
to
~/.muttlearnrc
.
The most important settings are mailboxes
and
$output_file
.muttlearn --verbose --progress
~/.muttrc
,
for example by appending this line at the bottom:
source ~/.mutt/automatic-send-hooks
$editor
during runtime, change $my_default_editor
instead!$weight_formula
or $max_age
variables.~/.muttrc
for some variables. All
these variables (mutt_defaults
in config.py
) can
also be set in the muttlearn config!