Gnus development mailing list
 help / color / mirror / Atom feed
* smtpmail authentication again
@ 2011-11-17 16:06 Richard Riley
  2012-01-03 22:25 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 32+ messages in thread
From: Richard Riley @ 2011-11-17 16:06 UTC (permalink / raw)
  To: ding


I have more than one gmail account. I want to use smtpmail but with
account specific authinfo details. As usual I have something of the form

,----
|    (add-to-list 'gnus-secondary-select-methods
|                 '(nnimap "acc1"
|                          (nnir-search-engine imap)
|                          (nnimap-address "imap.gmail.com")
|                          ))
|    (add-to-list 'gnus-secondary-select-methods
|                 '(nnimap "acc2"
|                          (nnir-search-engine imap)
|                          (nnimap-address "imap.gmail.com")
|                          ))
`----

reading mail isnt an issue: a .authinfo.gpg extract is:

,----
| machine acc1 login id1 password ****
| machine acc2 login id2 password ****
`----

There are numerous complex hacks/howtos out there which swap smtp
authinfo based on from address etc, but with all the recent changes I am
wondering if its now built in somehow?

Any example of using smtp from gnus directly using more than  one smtp
server appreciated. One working but horrendously complicated way is
using something like:-

,----
|  ;; (defun set-smtp (mech server port user password)
|  ;;   "Set related SMTP variables for supplied parameters."
|  ;;   (setq smtpmail-smtp-server server
|  ;;         smtpmail-smtp-service port
|  ;;         smtpmail-auth-credentials (list (list server port user password))
|  ;;         smtpmail-auth-supported (list mech)
|  ;;         smtpmail-starttls-credentials nil)
|  ;;   (message "Setting SMTP server to `%s:%s' for user `%s'."
|  ;;            server port user))
|  
|  ;; (defun set-smtp-ssl (server port user password &optional key cert)
|  ;;   "Set related SMTP and SSL variables for supplied parameters."
|  ;;   (setq starttls-use-gnutls t
|  ;;         starttls-gnutls-program "gnutls-cli"
|  ;;         ;; TODO: Add this to the server parameters
|  ;;         ;; starttls-extra-arguments nil
|  ;;         smtpmail-smtp-server server
|  ;;         smtpmail-smtp-service port
|  ;;         smtpmail-auth-credentials (list (list server port user password))
|  ;;         smtpmail-starttls-credentials (list (list server port key cert)))
|  ;;   (message
|  ;;    "Setting SMTP server to `%s:%s' for user `%s'. (SSL enabled.)"
|  ;;    server port user))
|  
|  ;; (defun change-smtp ()
|  ;;   "Change the SMTP server according to the current from line."
|  ;;   (interactive)
|  ;;   (save-excursion
|  ;;     (loop with from = (save-restriction
|  ;;                         (message-narrow-to-headers)
|  ;;                         (message-fetch-field "from"))
|  ;;           for (auth-mech address . auth-spec) in smtp-accounts
|  ;;           when (string-match address from)
|  ;;           do (cond
|  ;;               ((memq auth-mech '(cram-md5 plain login))
|  ;;                (return (apply 'set-smtp (cons auth-mech auth-spec))))
|  ;;               ((eql auth-mech 'ssl)
|  ;;                (return (apply 'set-smtp-ssl auth-spec)))
|  ;;               (t (error "Unrecognized SMTP auth. mechanism: `%s'." auth-mech)))
|  ;;           finally (error "Cannot infer SMTP information."))))
|  
|  ;; (setq message-sendmail-envelope-from 'header)
|  ;; (add-hook 'message-send-hook 'change-smtp)
|  
|  ;; (setq smtp-accounts '(
|  ;;                       (ssl "riley" "smtp.gmail.com" "587"
|  ;;                            "rileyrg@gmail.com" nil)
|  ;;                       (ssl "shamrock" "smtp.gmail.com" "587"
|  ;;                            "shamrockirishbar@gmail.com" nil)
|  ;; ))
`----

Could it be a lot easier now. Im using the gnus what comes
with bzr emacs 24.

regards

r.







^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2012-02-02  7:44 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-17 16:06 smtpmail authentication again Richard Riley
2012-01-03 22:25 ` Lars Magne Ingebrigtsen
2012-01-05  8:03   ` Kostas Zorbadelos
2012-01-05 19:00     ` Richard Riley
2012-01-05  9:29   ` Leo
2012-01-05 19:02     ` Richard Riley
2012-01-07  2:07   ` Ted Zlatanov
2012-01-07  2:16     ` Ted Zlatanov
2012-01-07  2:28       ` Lars Magne Ingebrigtsen
2012-01-07  2:43         ` Ted Zlatanov
2012-01-26 18:58           ` Lars Ingebrigtsen
2012-01-26 22:44             ` Ted Zlatanov
2012-01-27 17:59               ` Lars Ingebrigtsen
2012-01-27 19:17                 ` Ted Zlatanov
2012-01-27 18:25                   ` Lars Ingebrigtsen
2012-01-28 11:30                     ` Steinar Bang
2012-02-01 18:48                     ` Ted Zlatanov
2012-02-01 18:53                       ` Johann 'Myrkraverk' Oskarsson
2012-02-01 19:02                         ` Ted Zlatanov
2012-02-02  7:44                           ` Richard Riley
2012-01-07  5:33         ` Richard Riley
2012-01-07 13:10           ` Ted Zlatanov
2012-01-07 14:45             ` Richard Riley
2012-01-08 19:36               ` Ted Zlatanov
2012-01-10  2:34                 ` Richard Riley
2012-01-10 14:37                   ` Ted Zlatanov
2012-01-10 14:47                     ` Ted Zlatanov
2012-01-11  5:45                       ` Richard Riley
2012-01-11 13:39                         ` Ted Zlatanov
2012-01-12 23:47                           ` Richard Riley
2012-01-11 22:59                       ` Eric S Fraga
2012-01-10 16:26                     ` Richard Riley

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).