I wrote the following macros for quickly and easely change the current
msmtp account (press <tab> in Compose context until you have selected
the account you want ; press = in order to check which is the current
account).
# Define <tab> and = in order to switch or see the current msmtp account
# Don't forget to put the right path for msmtp binary
macro compose \Cx_ ":set sendmail"
macro compose \Cx| "\Cx_ = \"/usr/local/bin/msmtp"
macro compose \Cx& ":macro compose \\t \\Cx"
macro compose <tab> "\Cx0"
macro compose = "\Cx_\n"
# Put the account in the following lines (here three accounts)
# Don't forget to put the number of the account at the beginning
# of the line, and the number of the next account after the '&'
# you should leave the initial account (default) as it is here.
macro compose \Cx0 "\Cx|\"\n\Cx&1\n\Cx_\n" # default and switch to 1
macro compose \Cx1 "\Cx| -a archaiesteron\"\n\Cx&2\n\Cx_\n" # switch to 2
macro compose \Cx2 "\Cx| -a gmail\"\n\Cx&0\n\Cx_\n" # switch to 0
# End of the accounts
Regards,
--
Thomas Baruchel
> Hi,
>
> I wrote the following macros for quickly and easely change the
> current msmtp account (press <tab> in Compose context until you
> have selected the account you want ; press = in order to check
> which is the current account).
Thanks, Thomas. I've tucked your post away in my Mutt docs.
looks good.
AC
--
alanconnor AT earthlink DOT net
Use your real return address or I'll never know you
even tried to mail me. http://tinyurl.com/2t5kp
~
I wrote an enhanced version of these macros, with an awk-based script
for writing them aumoatically by parsing the ~/.msmtprc.
New features are mainly : description in the help page, support for the
generic context, more robust (no previous binding is assumed, not even ':').
You can find the script at: http://wiki.mutt.org/index.cgi?MuttGuide/Msmtp
I tried it on several machines, and I found it works well. However,
the author of msmtp tells me that he can't make it work on his machine.
I will have a look in order to find why ; since I don't use GNU awk,
I suspect it has to do with some incompatibility in the regex, but
I also tried the script with GNU awk and found it working.
Please, tell me if you encounter the same problem.
--
Thomas Baruchel
Thomas,
Thanks again. I'm more interested in templates for macros
than changing servers at this point. I also use ssmtp
rather msmtp.
AC
Why not use esmpt which does that automaticly?
See http://wiki.mutt.org/index.cgi?MuttGuide/Esmtp
The identity feature rocks.
Michael
--
PGP-Key-ID: 0xDC1A44DD
Jabber: init[0]@amessage.de
Thank you for the link, but now I have installed msmtp and configured
it, I'll keep it ;-) Maybe another time (the point is that when I looked
for a SMTP client for mutt, I found msmtp in the freebsd ports, not
emstp ; further, msmtp is not bad ;-)
--
Thomas Baruchel