From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/44295 Path: main.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: smtpmail-auth-credentials from authinfo Date: Fri, 19 Apr 2002 10:21:29 -0400 Organization: =?koi8-r?q?=F4=C5=CF=C4=CF=D2=20=FA=CC=C1=D4=C1=CE=CF=D7?= @ Cienfuegos Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1019226233 892 127.0.0.1 (19 Apr 2002 14:23:53 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 19 Apr 2002 14:23:53 +0000 (UTC) Cc: scranefield@infoscience.otago.ac.nz Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16yZIn-0000EH-00 for ; Fri, 19 Apr 2002 16:23:53 +0200 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16yZHB-0003IG-00; Fri, 19 Apr 2002 09:22:13 -0500 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Fri, 19 Apr 2002 09:22:26 -0500 (CDT) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id JAA03896 for ; Fri, 19 Apr 2002 09:22:14 -0500 (CDT) Original-Received: (qmail 22426 invoked by alias); 19 Apr 2002 14:21:57 -0000 Original-Received: (qmail 22421 invoked from network); 19 Apr 2002 14:21:57 -0000 Original-Received: from liilmtlssm01.mailtask.com (208.203.59.25) by gnus.org with SMTP; 19 Apr 2002 14:21:57 -0000 Original-Received: from onyx.nimbus.northernlight.com ([10.128.22.65]) by LIILMTLSSM01.mailtask.com with Microsoft SMTPSVC(5.0.2195.3779); Fri, 19 Apr 2002 09:21:30 -0500 Original-To: ding X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Followup-To: ding , scranefield@infoscience.otago.ac.nz Original-Lines: 43 User-Agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-redhat-linux-gnu) X-OriginalArrivalTime: 19 Apr 2002 14:21:30.0088 (UTC) FILETIME=[7FB2FE80:01C1E7AD] Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:44295 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:44295 (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)