From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57030 Path: main.gmane.org!not-for-mail From: Wes Hardaker Newsgroups: gmane.emacs.gnus.general Subject: message-send-mail-function, agent, and a day of work Date: Thu, 15 Apr 2004 09:05:25 -0700 Organization: Sparta Sender: ding-owner@lists.math.uh.edu Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082045193 31402 80.91.224.253 (15 Apr 2004 16:06:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2004 16:06:33 +0000 (UTC) Cc: Michael Baer Original-X-From: ding-owner+M5570@lists.math.uh.edu Thu Apr 15 18:06:19 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BE9Na-0002NG-00 for ; Thu, 15 Apr 2004 18:06:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1BE9My-0000Hz-00; Thu, 15 Apr 2004 11:05:40 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BE9Mq-0000Hr-00 for ding@lists.math.uh.edu; Thu, 15 Apr 2004 11:05:32 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BE9Mo-0002Ee-1y for ding@lists.math.uh.edu; Thu, 15 Apr 2004 11:05:30 -0500 Original-Received: from wes.hardakers.net (adsl-66-127-127-227.dsl.scrm01.pacbell.net [66.127.127.227]) by justine.libertine.org (Postfix) with ESMTP id 8BC113A0058 for ; Thu, 15 Apr 2004 11:05:28 -0500 (CDT) Original-Received: by wes.hardakers.net (Postfix, from userid 274) id 7864611D811; Thu, 15 Apr 2004 09:05:25 -0700 (PDT) Original-To: ding@gnus.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAGFBMVEXotKX87e8eDA4GAQbQgmlzNycHAwizYkruzul2AAACaUlEQVR4nFXUTW/jIBAGYFI56jWutuq1S9b2dddW6dWtQFxbq4jzwq73Glmg+fv7DiT9QJGS+GEGhiER67TWEQ5CtOeh21ZcIIbmOPq5QvMZYlyV6u+/gsJLTSrGIL/CxEPxQuPAcP0JYlQsq3x5B3UJmUaEyB6yZ+CQ+pwXCzKsbXtbIhg4KtZypPz+AVGtlxH69c87qAqRY6Rc5QUmZMGeAj+TfVjjUwE1lflKys5JGXpM+V0hltqCJ0qL7Plkft4wRM6lxi5p3Wyy7O7fB8TgtdZivxy5rvAB6wSYhbA9vn+GOCaOEGJRPO2mHgk+q1Chyf0Up3AG0NjhOXI19ogEFziq6M+ZtN3kUZ13NW4qUCprC3CW668C06M5jihON1Vsjq8F1CPJB8LINNeQfscwxUEvAwM5Xghvsq2pBr3hnKhbDIrMS3cBRDx70uS9JW2dy667gM0AbZFFmyvn3GOBGB8wG9kppaSNz357LaCmUdtSny5LU9qeCrglvJmyH20TwkjnXQE0usscIWayCWZJ7OpZ4QbUVGRnhuTub3cMYRk99oSplDIfibzfn0FyXyk7z8XThuvC0P/dGCwee7O8aZJBmh0vPixy0NrYhDaR02aR3W0BbyT6h23OB5Hzybj+DOm5w6XCOZG13p5Oh/bursJVh9S+bBiFnPCDuntpcTH080AO+7GlW1i3bRphBM04dZ2dI6yMLjmGFqnIok/cB1YU8sJAACTeuHOd5+lumQHfDM6KyLqEm4aWkkcc1m4PqBewZxBZOg44lT+aJiexDteewb oiVhxAjSHxQwhiYJEdCR6tMN1/uckirDRNbsgAAAAASUVORK5CYII= User-Agent: Gnus/5.110002 (No Gnus v0.2) XEmacs/21.5 (celeriac, linux) Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57030 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57030 I spent way too much time the other day figuring out why my simple code to switch smtp servers was not working and all. I was properly setting every variable I could find documented, but the effect seemed to be nothing. The end result was because I was running with the agent turned on, I was missing a variable that is not documented with the rest of them (which makes some sense, as all the agents stuff is in one place). The problem is essentially this: 1) when you read about sending mail, the documentation says that the variable 'message-send-mail-function is consulted to figure out how to send mail. This is what I was trying to modify. 2) However, the agent has his own variable for what to do when sending anything: gnus-agent-send-mail-function. The problem is twofold: first, there is no reference to the second variable in least a warning in the documentation related to sending mail. Since the agent is turned on by default now, this will likely confuse a lot of people. Second, the second variable is independent of the first. This is part of the confusion. I think the most simple solution would be to make the second variable point to a different function which checks the value of the first variable and uses that at runtime. By default they both point at the same value, however, if the first one changes the second one never picks up that change in value. The gnus-agent-send-mail-function variable is set in gnus-agentize as follows: (unless gnus-agent-send-mail-function (setq gnus-agent-send-mail-function (or message-send-mail-real-function message-send-mail-function) message-send-mail-real-function 'gnus-agent-send-mail)) I'm suggesting this would be better: (defun gnus-agent-use-current-send-mail-function () (funcall (or message-send-mail-real-function message-send-mail-function))) (unless gnus-agent-send-mail-function (setq gnus-agent-send-mail-function 'gnus-agent-use-current-send-mail-function)) This way dynamic changes to the message-send-mail-function are picked up, but it still allows for customization of the agent specifically if desired. Thoughts? -- "In the bathtub of history the truth is harder to hold than the soap, and much more difficult to find." -- Terry Pratchett