From: "Clemens Schüller" <cs.mlists+gnus@mailbox.org>
To: Harry Putnam <reader@newsguy.com>
Cc: ding@gnus.org
Subject: Re: howto have nnimap setup for smtp out
Date: Mon, 25 Jan 2021 23:42:41 +0100 [thread overview]
Message-ID: <m2y2ggprj2.fsf@cmschueller.my-fqdn.de> (raw)
In-Reply-To: <87zh0w7j70.fsf@local.lan> (Harry Putnam's message of "Mon, 25 Jan 2021 17:20:03 -0500")
Hello!
Harry Putnam wrote:
> I tried that out with these changes:
>
> (setq send-mail-function smtpmail-send-it
> smtpmail-smtp-server "smtp.gmail.com"
> smtpmail-stream-type tls
> smtpmail-smtp-service 465
> user-mail-address "hputnam3@gmail.com")
My SMTP out Setup has the dependency of the from header:
#+begin_src emacs-lisp
(defun exal-change-smtp ()
"Change the SMTP server according to the current from line."
(save-excursion
(let ((from
(save-restriction
(message-narrow-to-headers)
(message-fetch-field "from"))))
(message "From is `%s', setting `smtpmail-smtp-server' to `%s'"
from
(cond
((string-match "gmx.at" from)
;; Use stmp-auth
(message "Using smtp-auth for GMX account")
;; Sending mail
(setq smtpmail-starttls-credentials '(("mail.gmx.net" 587 nil nil))
;; smtpmail-smtp-server "mail.gmx.net"
smtpmail-default-smtp-server "mail.gmx.net"
send-mail-function 'smtpmail-send-it
message-send-mail-function 'smtpmail-send-it
smtpmail-smtp-service 587
smtpmail-auth-credentials (expand-file-name "~/.authinfo")
smtpmail-smtp-server "mail.gmx.net"))
((string-match "mailbox.org" from)
;; Use SMTP for mailbox.org account
(message "Using smtp-auth for mailbox.org account")
(setq message-send-mail-function 'smtpmail-send-it
smtpmail-starttls-credentials '(("barnburner.local" 25 nil nil))
smtpmail-auth-credentials '(("barnburner.local" 25 "mente" nil))
smtpmail-default-smtp-server "barnburner.local"
smtpmail-smtp-service 25
smtpmail-smtp-server "barnburner.local"))
(t
(message
(concat "Sending via nntp... "
from))))))))
(add-hook 'message-setup-hook 'exal-change-smtp)
#+end_src
--
Best Regards, Clemens Schüller
next prev parent reply other threads:[~2021-01-25 22:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-20 15:21 Harry Putnam
2021-01-20 16:03 ` Robert Pluim
2021-01-25 22:20 ` Harry Putnam
2021-01-25 22:42 ` Clemens Schüller [this message]
2021-01-25 23:37 ` Malcolm Purvis
2021-01-25 23:47 ` Harry Putnam
2021-01-26 17:49 ` Clemens Schüller
2021-01-25 23:37 ` Harry Putnam
2021-01-26 2:53 ` Harry Putnam
2021-01-26 10:10 ` Robert Pluim
2021-01-20 16:04 ` Adam Sjøgren
2021-01-20 16:12 ` dick.r.chiang
2021-01-26 17:05 ` Harry Putnam
2021-01-26 17:48 ` Robert Pluim
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=m2y2ggprj2.fsf@cmschueller.my-fqdn.de \
--to=cs.mlists+gnus@mailbox.org \
--cc=cs.mlists@mailbox.org \
--cc=ding@gnus.org \
--cc=reader@newsguy.com \
/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).