Gnus development mailing list
 help / color / mirror / Atom feed
* smtpmail-auth-credentials from authinfo
@ 2002-04-19 14:21 Ted Zlatanov
  2002-04-19 14:47 ` Simon Josefsson
  2002-04-19 15:33 ` Kai Großjohann
  0 siblings, 2 replies; 9+ messages in thread
From: Ted Zlatanov @ 2002-04-19 14:21 UTC (permalink / raw)
  Cc: scranefield

(this is regarding the smtpmail.el with authentication, which is not
yet in the mainstream Emacs but will be, I understand.  I cc-ed the
AUTH author)

I had to write this for my own authentication (so I could share my
.gnus.el).  I didn't want my smtpmail-auth-credentials to be in the
clear, and it seemed like a better idea to do it through authinfo.

I don't like the double setq statement, but I don't know enough Lisp
to eval the function in place, so I could have one setq only.

Has anyone else done something similar?  The solution below requires
.authinfo lines formatted "machine xyz port 25 login abc password ijk"
which is, perhaps, too inflexible.  Suggestions are welcome.
.authinfo support should probably go into the next smtpmail.el as
well, at least as an option.

Thanks
Ted

--------------------------------------------------------------------

(defun tzz-get-authinfo (authinfo-file)
  (interactive "Ffilename: ")
  (setq retlist nil)
  (if (file-exists-p authinfo-file)
      (with-temp-buffer
      (insert-file-contents authinfo-file)
      (goto-char (point-min))
      (while (re-search-forward
       "machine[ \t]+\\(\\S +\\)\\s +port[ \t]+\\(\\S +\\)\\s +login[ \t]+\\(\\S +\\)\\s +password[ \t]+\\(\\S +\\)"
   nil t)
   (let ((machine (match-string 1))
         (port (string-to-number (match-string 2)))
               (login (match-string 3))
                     (passwd (match-string 4)))
                           (setq l (list machine port login passwd))
                             (push l retlist)))))
  retlist)

(setq authinfo-list (tzz-get-authinfo "~/.authinfo"))
(setq smtpmail-auth-credentials authinfo-list)





^ permalink raw reply	[flat|nested] 9+ messages in thread
* RE: smtpmail-auth-credentials from authinfo
@ 2002-04-23 21:51 Stephen Cranefield
  0 siblings, 0 replies; 9+ messages in thread
From: Stephen Cranefield @ 2002-04-23 21:51 UTC (permalink / raw)
  Cc: ding

Ted Zlatanov wrote:
>                                                  I would appreciate
> comments from Stephen Cranefield, who's noted in the smtpmail.el
> credits as the AUTH support author.

Hi Ted,

I can't make any intelligent comment on your proposal because I only
ever became a reluctant emacs hacker when the mail server I used
had its configuration changed to require authentication.  I haven't
touched any emacs lisp since then and I have to confess that I have
never heard of authinfo.el and netrc.el before.

However, in general terms I think it is a good idea to allow users
to set their password once and have it stored for future sessions -
but not in plain text.  I have just been setting my password when
prompted each time I send my first mail message for the session,
but I'd certainly like to have a better way, so I'm all for any
enhancements that support this.

Regards,
Stephen



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

end of thread, other threads:[~2002-04-25 19:25 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 14:21 smtpmail-auth-credentials from authinfo Ted Zlatanov
2002-04-19 14:47 ` Simon Josefsson
2002-04-19 15:41   ` Ted Zlatanov
2002-04-19 15:55     ` Simon Josefsson
2002-04-23 15:53       ` Ted Zlatanov
2002-04-23 17:23         ` Simon Josefsson
2002-04-25 19:25           ` Ted Zlatanov
2002-04-19 15:33 ` Kai Großjohann
2002-04-23 21:51 Stephen Cranefield

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