Discussion:
Setting up X-Message-SMTP-Method with Posting-Styles
Aric Gregson
2015-08-29 23:39:09 UTC
Permalink
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.

Here is my present set-up:

(setq gnus-posting-styles
'(("***mail" (address "aorchid@***.com")
(reply-to "aorchid@***.com")
(eval (setq mml2015-signers '("aorchid@***.com")))
(X-Message-SMTP-Method "smtp ***.com 587 aorchid")
(body "\nThanks, Aric\n"))
("***2"
(address "aorchid@***2.com")
(signature-file "~/.signature_bike")
(eval (setq mml2015-signers '("aorchid@***2.com")))
(X-Message-SMTP-Method "smtp outbound.mailhop.org 465 xochitl")
(body "\nThanks, Aric\n")
...))

(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it)

When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?

Thanks,
Eric Abrahamsen
2015-08-30 03:06:52 UTC
Permalink
Post by Aric Gregson
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.
You may have already given up on msmtp, but what went wrong with the
password situation? I use msmtp with the passwordeval option, like this:

passwordeval "/usr/bin/pass email/ea"

And it works well. You could do the same thing with plain gpg, using (I
think, I've forgotten how exactly it goes) the --for-your-eyes-only
option.
Post by Aric Gregson
(setq gnus-posting-styles
(X-Message-SMTP-Method "smtp ***.com 587 aorchid")
(body "\nThanks, Aric\n"))
("***2"
(signature-file "~/.signature_bike")
(X-Message-SMTP-Method "smtp outbound.mailhop.org 465 xochitl")
(body "\nThanks, Aric\n")
...))
(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it)
When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?
Maybe put the credentials in ~/.authinfo.gpg instead? Gnus should
automatically look there.

Eric
Clemens Schüller
2015-08-30 08:35:20 UTC
Permalink
Hello!
Post by Aric Gregson
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.
[ ... ]
Post by Aric Gregson
When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?
Take a look at http://exal.0x2.org/conf/gnus.html and search for the
exal-change-smtp function:

I've running this config to handle multiple SMTP Servers and its working
perfectly.
--
Best Regards, Clemens Schüller
Vincent Bernat
2015-08-30 11:34:26 UTC
Permalink
Post by Aric Gregson
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.
(setq gnus-posting-styles
(X-Message-SMTP-Method "smtp ***.com 587 aorchid")
(body "\nThanks, Aric\n"))
("***2"
(signature-file "~/.signature_bike")
(X-Message-SMTP-Method "smtp outbound.mailhop.org 465 xochitl")
(body "\nThanks, Aric\n")
...))
(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it)
When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?
I didn't know about this X-Message-SMTP-Method. Does it appear when
composing the message?

I am using something similar:
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/identities.conf.el#L40
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/init.conf.el#L22-L42
--
Make your program read from top to bottom.
- The Elements of Programming Style (Kernighan & Plauger)
Vincent Bernat
2015-08-30 11:44:28 UTC
Permalink
Post by Vincent Bernat
Post by Aric Gregson
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.
(setq gnus-posting-styles
(X-Message-SMTP-Method "smtp ***.com 587 aorchid")
(body "\nThanks, Aric\n"))
("***2"
(signature-file "~/.signature_bike")
(X-Message-SMTP-Method "smtp outbound.mailhop.org 465 xochitl")
(body "\nThanks, Aric\n")
...))
(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it)
When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?
I didn't know about this X-Message-SMTP-Method. Does it appear when
composing the message?
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/identities.conf.el#L40
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/init.conf.el#L22-L42
I just tried myself with X-Message-SMTP-Method and it works fine for
me. I did quote "X-Message-SMTP-Method". You should see it in when
composing your message.
--
Program defensively.
- The Elements of Programming Style (Kernighan & Plauger)
Aric Gregson
2015-08-30 21:00:42 UTC
Permalink
Post by Vincent Bernat
Post by Vincent Bernat
Post by Aric Gregson
I am not able to successfully set up multiple smtp servers using the
X-Message-SMTP-Method in posting styles. I am trying to migrate away
from msmtp, which works great, but I'd like to keep all my passwords in
an encrypted file, which is not working with msmtp.
(setq gnus-posting-styles
(X-Message-SMTP-Method "smtp ***.com 587 aorchid")
(body "\nThanks, Aric\n"))
("***2"
(signature-file "~/.signature_bike")
(X-Message-SMTP-Method "smtp outbound.mailhop.org 465 xochitl")
(body "\nThanks, Aric\n")
...))
(require 'smtpmail)
(setq message-send-mail-function 'smtpmail-send-it)
When I try to send the message, Gnus asks me for the smtp server name
and the credentials and then tries to write them to my .emacs file.
What am I doing wrong here?
I didn't know about this X-Message-SMTP-Method. Does it appear when
composing the message?
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/identities.conf.el#L40
https://github.com/vincentbernat/dot.emacs/blob/358463b056b08529f7ee3e5f0e3d58dc63a3ff25/gnus/init.conf.el#L22-L42
I just tried myself with X-Message-SMTP-Method and it works fine for
me. I did quote "X-Message-SMTP-Method". You should see it in when
composing your message.
OK, I can get it generate the headers now. I made a clean .gnus file to
test. There is probably too much older stuff in my gnus file that is
blocking this.

I have finally figured how to get it to change with group that I am in.
I just need to keep working with it and make it work to change based on
the 'To' of the email and figure out how to get default gpg keys used.

Thanks very much, aric

Loading...