From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.user/9519 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.gnus.user Subject: fs-change-smtp and draft messages Date: Tue, 14 Aug 2007 13:19:49 +0200 Organization: http://en.wikipedia.org/wiki/Quark Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187091627 32647 80.91.229.12 (14 Aug 2007 11:40:27 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Aug 2007 11:40:27 +0000 (UTC) To: info-gnus-english@gnu.org Original-X-From: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Tue Aug 14 13:40:25 2007 Return-path: Envelope-to: gegu-info-gnus-english@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IKul6-0007kS-CF for gegu-info-gnus-english@m.gmane.org; Tue, 14 Aug 2007 13:40:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IKul5-0006bl-VM for gegu-info-gnus-english@m.gmane.org; Tue, 14 Aug 2007 07:40:23 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.gnus Original-Lines: 49 Original-X-Trace: individual.net SNEdha8tnK8O5mfQk9j4oQxGmmVQerWvmxdb7lV98qvjeCCKN/ X-Orig-Path: news.individual.net!news Cancel-Lock: sha1:eJijiLm0rFcNu6Sxplfi8YzuVts= sha1:ejAhBgLOoj+hizwTV2GEwnbk1H4= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEUPDQ1bVEeWcSHosxDD ojimpJ76+vnczqjhNce/AAAACXBIWXMAAABIAAAASABGyWs+AAAB6UlEQVQ4y22UvW4TQRDHf7P2 paG4vSTuDwMlQgJRUfiIEC22gqnT2G/AcySU4AJTX4EfgMI8AMISdRTTEpRdu/MHWYq9r/g8zWr3 d/+Z2ZnZU8PCBv1+uRkqcnOjNB3ZYlsAGQEu1TWwBhB3UQOhXzY1MAZwOL0LcpvXQAQSwbQGhl15 PyiVBQg+CX8+d7E1hUPbv3sUL5Jf7cXBtA6mzZDl4z2K5CeAxu2/h2VbD251dEQQ6t0Yz5wT3dvY i7vALQ5Pj56GzaKMOdgcMMcgGmerQMZvXBQBZzCpghU6T4u1roCxeCAt4EMJNjBHQG5/a1iVwNDS OHASdr2/IqskW6WFD+/BJMhbzVLA5cAhZWVC2OZgSyGApKIwnO0WGQXIpOg0EJe1Wlc95YPls1pQ MwXQ1vruaexBI7r/pTj7MQMBFBJdIasiuo6hMQPF5TcLcf5iBAtPLCi5Ami6cw9urWo/QED5VF28 8c4OtWjNVhfV1dn838wR4Dsqe0KNoAtA6i++nSnJbnoCwD2bpZeof1k61xbk+jyrjlRGNE3Tj1+z xjRPrJIw+8gZA7g50OxYlDx/6YwFS9SLelHkENOxoDDLR6cuNOZdv9Vv9bvW3DzMp8QtXmnz2jsM EoK47AfHg+yXwfHbDgD/AWsIohF8qgD0AAAAGnpUWHRKUEVHLUNvbG9yc3BhY2UAAHjaMwIAADMA MxEWfmMAAAAqelRYdEpQRUctU2FtcGxpbmctZmFjdG9ycwAAeNozqjDSMaww1DGsMAQAEYMC6QbE yigAAAAASUVORK5CYII= User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.91 (gnu/linux) Original-Xref: shelby.stanford.edu gnu.emacs.gnus:79708 X-BeenThere: info-gnus-english@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Announcements and discussions for GNUS, the GNU Emacs Usenet newsreader \(in English\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Errors-To: info-gnus-english-bounces+gegu-info-gnus-english=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.gnus.user:9519 Archived-At: I have a problem with draft messages that I hope someone can help me with. If I save a message to drafts and then edit it at a later date (press "e" - calls function gnus-draft-edit-message) then the call to the hook fs-change-smtp doesn't respect the existing "from" field in the draft. ,---- | (defun fs-change-smtp () | "Change the SMTP server according to the current from line." | (setq smtpmail-starttls-credentials '(("smtp.gmail.com" 587 nil nil))) | (setq message-send-mail-function 'smtpmail-send-it) | (save-excursion | (let ((from | (save-restriction | (message-narrow-to-headers) | (message-fetch-field "from")))) | (message "%s" from) | (message "**** From is `%s', setting `smtpmail-smtp-server' to `%s'" | from | (cond | ((string-match ".*adron.*" from) | (setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "hadronquark" "*******")))) | ((string-match ".*default.*" from) | (setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "otheremails" "********")))) | (t | (setq smtpmail-auth-credentials '(("smtp.gmail.com" 587 "default" "********"))) | ))))) | ) | | (add-hook 'message-setup-hook 'fs-change-smtp) `---- Despite the draft containing a field "From: Hadron " the "from" returned by message-fetch-field is another email address from my address book. It is not getting the "From" field from the draft - or doesn't appear to be. This results in the smtp-auth-credentials being set incorrectly. Any hint/tips on how to correct this? The strange thing is that the from line above is the one displayed in the draft edit buffer. It's only when I actually send the message are the are the wrong smtp credentials used.