From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: separate smtps for my accounts
Date: Wed, 24 Sep 2014 11:24:56 -0400 [thread overview]
Message-ID: <874mvxm46v.fsf@lifelogs.com> (raw)
In-Reply-To: <87iokn0z4t.fsf@ericabrahamsen.net>
On Wed, 17 Sep 2014 10:17:06 +0800 Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
EA> A unified or built-in solution for this would be pretty nice...
1) in my ~/.authinfo.gpg
#+begin_src text
machine smtp.gmail.com login ted@px.com port 587 password "pass1"
machine smtp.gmail.com login ted@lifelogs.com password "pass2"
#+end_src
2) I use this function, original author unknown:
#+begin_src lisp
(defun tzz-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(save-restriction
(message-narrow-to-headers)
(let* ((from (message-fetch-field "from"))
(from-px (string-match "px" from))
)
(cond
(from-px
(setq smtpmail-smtp-service 587
smtpmail-smtp-user "ted@px.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-default-smtp-server smtpmail-smtp-server))
(t
(setq smtpmail-smtp-service 587
smtpmail-smtp-user "ted@lifelogs.com"
smtpmail-smtp-server "smtp.gmail.com"
smtpmail-default-smtp-server smtpmail-smtp-server)))))))
(add-hook 'message-send-hook 'tzz-change-smtp)
#+end_src
So basically the `smtpmail-smtp-user' and `smtpmail-smtp-server' are
matched against ~/.authinfo.gpg.
This is essentially what posting-styles is designed for. Does it look
robust enough to add support for it to the posting styles? Or is it
already supported? Sorry, I'm a bit out of date on this stuff :)
If we find a solution that works out of the box, we can add it to the
auth-source manual and tell people about it: (info "(auth) Help for users")
Ted
next prev parent reply other threads:[~2014-09-24 15:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 0:58 Sharon Kimble
2014-09-12 2:08 ` Eric Abrahamsen
2014-09-12 15:05 ` Jorge A. Alfaro-Murillo
2014-09-13 22:03 ` Sharon Kimble
2014-09-14 2:01 ` Eric Abrahamsen
2014-09-16 18:57 ` Sharon Kimble
2014-09-17 2:17 ` Eric Abrahamsen
2014-09-24 15:24 ` Ted Zlatanov [this message]
2014-09-17 12:32 ` Rasmus
2014-09-17 8:37 ` Eric S Fraga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874mvxm46v.fsf@lifelogs.com \
--to=tzz@lifelogs.com \
--cc=ding@gnus.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).