From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Roche Newsgroups: gmane.emacs.help Subject: problem using .authinfo.gpg with smtpmail Date: Wed, 17 Aug 2011 12:21:06 -0400 Message-ID: <87d3g41025.fsf@pobox.com> References: <87vctwg13y.fsf@gmail.com> <87liusrh3h.fsf@pobox.com> Reply-To: help-gnu-emacs@gnu.org, Tom Roche NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1313598089 25785 80.91.229.12 (17 Aug 2011 16:21:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 17 Aug 2011 16:21:29 +0000 (UTC) To: help-gnu-emacs@gnu.org, Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 17 18:21:25 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Qtirn-0007Ap-Rs for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 18:21:20 +0200 Original-Received: from localhost ([::1]:35032 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtirn-00062G-0I for geh-help-gnu-emacs@m.gmane.org; Wed, 17 Aug 2011 12:21:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:42799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtiri-000600-KZ for help-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:21:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qtirh-00024l-7z for help-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:21:14 -0400 Original-Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:59068 helo=smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qtirh-00024g-1h for help-gnu-emacs@gnu.org; Wed, 17 Aug 2011 12:21:13 -0400 Original-Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 13D223EA6; Wed, 17 Aug 2011 12:21:12 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to :subject:references:reply-to:date:message-id:mime-version :content-type; s=sasl; bh=lGy5VxUJd2reBhyRz3G5kID45rc=; b=s9Roid HU7kHSXHu1i8xz1ucu5n4MLFdSBVLJrotBey3uM/Fx+LBDODlEWz/KJaSVcUhOCL kYVZYIjW8SNFb2uU+mBMhu5W6ob43v6HQQyIq94rUNQpz8xIdBR7gBQZY1xDQKIh xkZtAyLZ5PvPRHpADt/87KSF+AO/0iKGYCE2c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:subject :references:reply-to:date:message-id:mime-version:content-type; q=dns; s=sasl; b=ZFA+eGMcT5IrH4w7xPTtE7sHG87prbw5DJ3smBriBdVorr SPmmcAj4R4f8zDQPz7NT6UkhRz/2VOcEgZqseR6cgw+JuGj4v9ZS1a8QDZFS9VPK lqwDmtsJRAjVFrkbtVOJ7bRyYle47KtDh6WMjCX8mdEuNhqyayEFaQGFNIe4k= Original-Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 0B2333EA5; Wed, 17 Aug 2011 12:21:12 -0400 (EDT) Original-Received: from tlrPanP5.pobox.com (unknown [75.177.137.62]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 701BD3EA4; Wed, 17 Aug 2011 12:21:11 -0400 (EDT) User-Agent: GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.4) X-Pobox-Relay-ID: EBE15EAA-C8EC-11E0-BE25-1DC62E706CDE-07218935!b-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 208.72.237.35 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81968 Archived-At: summary: I believe I am properly configured to use .authinfo.gpg with sendmail.el. However, when I try to send mail, I get the usual messages, followed by 2 requests for passphrase, followed by failure: > (error "Sending failed; SMTP protocol error") I also observe a problem reading .authinfo.gpg from emacs (details below), though it looks fine in bash. How to fix? details: Vijay Lakshminarayanan Wed, 17 Aug 2011 09:07:05 +0530 > As long as you have gnupg in your PATH, Just for the benefit of the next literal-minded newbie: me@it:~$ which gnupg # `C-h i`, then me@it:~$ which gpg /usr/bin/gpg me@it:~$ gpg --version gpg (GnuPG) 1.4.11 I also have me@it:~$ lsb_release -ds Linux Mint Debian Edition me@it:~$ uname -rv 2.6.39-2-amd64 #1 SMP Tue Jul 5 02:51:22 UTC 2011 me@it:~$ emacs --version GNU Emacs 23.3.1 init.el > (if (>= emacs-major-version 23) > (progn > (require 'auth-source) > (if (file-exists-p "~/.authinfo.gpg") > (setq auth-sources '((:source "~/.authinfo.gpg" :host t :protocol t))) > (setq auth-sources '((:source "~/.authinfo" :host t :protocol t))) > ) > ) > ) ... > (load "tlrMail") tlrMail.el > (setq user-full-name "Tom Roche") > (setq message-send-mail-function 'smtpmail-send-it) > ;;; throw this in, anyway > (setq send-mail-function 'smtpmail-send-it) modified for mail (works in original) > (setq foo-smtp-server-port 26) > (setq foo-smtp-server-hostname "smtp.foo.com") > (setq foo-user-mail-id "me") > (setq foo-starttls-credentials > (list (list foo-smtp-server-hostname foo-smtp-server-port 'nil 'nil))) ... > (setq smtpmail-local-domain pobox-domain-name) > (setq smtpmail-sendto-domain pobox-domain-name) > (setq smtpmail-smtp-server pobox-smtp-server-hostname) > (setq smtpmail-smtp-service pobox-smtp-server-port) > (setq user-mail-address pobox-user-mail-address) > (setq smtpmail-starttls-credentials pobox-starttls-credentials) ... > (setq starttls-use-gnutls t) > (setq starttls-gnutls-program "gnutls-cli") > (setq starttls-extra-arguments nil) > (require 'smtpmail) Vijay Lakshminarayanan Wed, 17 Aug 2011 09:07:05 +0530 > Open your .authinfo, C-x w .authinfo.gpg and Emacs will ask you for a > password for the file. So I did 1 C-x f ~/.authinfo 2 C-x w ~/.authinfo.gpg and got dialog=*Keys* > Select recipents for encryption. > If no one is selected, symmetric encryption will be performed. > - `m' to mark a key on the line > - `u' to unmark a key on the line > [Cancel][OK] 3 OK, then got 2 GnuPG passphrase prompts. I set a passphrase different from my SMTP server passwords. 4 I sent email, which succeeded normally, i.e., emacs prompted me for the SMTP server password, but I did not get a GnuPG prompt for passphrase. 5 rm ~/.authinfo 6 I tried to send email, but failed with *Backtrace* > Debugger entered--Lisp error: (error "Sending failed; SMTP protocol error") 7 Just to be sure, I did `C-x f ~/.authinfo.gpg` and got the GnuPG passphrase prompt followed by seeing the correct file contents in buffer. 8 Confused, I restarted emacs (normally), then tried to send email, I * loaded the *Mail* buffer * `C-c C-c` * got 2 GnuPG passphrase prompts (why 2?) * failed with *Backtrace* > Debugger entered--Lisp error: (error "Sending failed; SMTP protocol error") 9 More confused, I restarted the OS, then repeated the previous step: no change. 10 `C-x f ~/.authinfo.gpg` gets GnuPG passphrase prompt, followed by *Messages* > File exists, but cannot be read But I was able to open it before restarting emacs and the OS! Furthermore me@it:~$ ls -al .authinfo.gpg -rw-r--r-- 1 me me 183 Aug 17 10:29 .authinfo.gpg 11 .authinfo.gpg -> .authinfo *`C-x f ~/.authinfo~` * restore old contents * `C-x w ~/.authinfo` * `chmod 600 ~/.authinfo` * verify: me@it:~$ ls -al ~/.authinfo.gpg ls: cannot access /home/me/.authinfo.gpg: No such file or directory me@it:~$ ls -al ~/.authinfo -rw------- 1 me me 260 Aug 17 11:56 /home/me/.authinfo * try resending message (without restarting emacs): success! How to fix (or further debug)? Feel free to reply directly to me as well as the list, and TIA, Tom Roche