Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Mutt + msmtp] a nice macro I have written...

21 views
Skip to first unread message

Thomas Baruchel

unread,
Jun 15, 2005, 11:03:10 AM6/15/05
to
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).


# 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

Alan Connor

unread,
Jun 15, 2005, 8:01:02 PM6/15/05
to
On comp.mail.mutt, in <42b0432d$0$19119$626a...@news.free.fr>,
"Thomas Baruchel" wrote:

> 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
~

Thomas Baruchel

unread,
Jun 16, 2005, 2:28:36 AM6/16/05
to
Le 16-06-2005, Alan Connor <zzz...@xxx.yyy> a écrit :
> Thanks, Thomas. I've tucked your post away in my Mutt docs.
> looks good.

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

Alan Connor

unread,
Jun 16, 2005, 4:46:21 AM6/16/05
to
On comp.mail.mutt, in <42b11c14$0$16644$626a...@news.free.fr>,
"Thomas Baruchel" wrote:

Thomas,

Thanks again. I'm more interested in templates for macros
than changing servers at this point. I also use ssmtp
rather msmtp.

AC

Michael Tatge

unread,
Jun 20, 2005, 10:21:00 AM6/20/05
to
On 2005-06-15, Thomas Baruchel <archai...@laposte.net> wrote:
> I wrote the following macros for quickly and easely change the current
> msmtp account

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

Thomas Baruchel

unread,
Jun 21, 2005, 4:55:57 AM6/21/05
to
Le 20-06-2005, Michael Tatge <news....@nurfuerspam.de> a écrit :
> On 2005-06-15, Thomas Baruchel <archai...@laposte.net> wrote:
>> I wrote the following macros for quickly and easely change the current
>> msmtp account
> Why not use esmpt which does that automaticly?

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

black.f...@gmail.com

unread,
Nov 14, 2016, 2:55:13 AM11/14/16
to
Thomas,

I have more than 10 accounts in msmtp. The script breaks in mutt if more than nine. Is there a workaround you can suggest?

Thanks.

Eike Rathke

unread,
Nov 17, 2016, 5:09:32 AM11/17/16
to
* black.f...@gmail.com, 2016-11-14 07:55 UTC:
> On Tuesday, June 21, 2005 at 3:55:57 PM UTC+7, Thomas Baruchel wrote:

Note that you followed up on a thread that's more than 10 years old..

> I have more than 10 accounts in msmtp. The script breaks in mutt if more than nine. Is there a workaround you can suggest?

I have more than 10 accounts in ~/.msmtprc and no problem at all. But
I also don't use any macro script with it, which this old news thread
archived at googlegroups seems to be about. Good luck.

Eike

--
OpenPGP/GnuPG encrypted mail preferred in all private communication.
Key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918 630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
Use LibreOffice! https://www.libreoffice.org/
0 new messages