From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/57038 Path: main.gmane.org!not-for-mail From: Kevin Greiner Newsgroups: gmane.emacs.gnus.general Subject: Re: message-send-mail-function, agent, and a day of work Date: Thu, 15 Apr 2004 15:28:28 -0500 Sender: ding-owner@lists.math.uh.edu Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1082060969 27040 80.91.224.253 (15 Apr 2004 20:29:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 15 Apr 2004 20:29:29 +0000 (UTC) Original-X-From: ding-owner+M5578@lists.math.uh.edu Thu Apr 15 22:29:18 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 1BEDU5-0006r9-00 for ; Thu, 15 Apr 2004 22:29:17 +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 1BEDTj-0001Bi-00; Thu, 15 Apr 2004 15:28:55 -0500 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1BEDTb-0001Bc-00 for ding@lists.math.uh.edu; Thu, 15 Apr 2004 15:28:47 -0500 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1BEDTa-0005iC-Jx for ding@lists.math.uh.edu; Thu, 15 Apr 2004 15:28:46 -0500 Original-Received: from quimby.gnus.org (quimby.gnus.org [80.91.224.244]) by justine.libertine.org (Postfix) with ESMTP id 91E213A0035 for ; Thu, 15 Apr 2004 15:28:45 -0500 (CDT) Original-Received: from news by quimby.gnus.org with local (Exim 3.35 #1 (Debian)) id 1BEDTY-00019F-00 for ; Thu, 15 Apr 2004 22:28:44 +0200 Original-To: ding@gnus.org Original-Path: not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 50 Original-NNTP-Posting-Host: h-66-134-21-51.hstqtx02.covad.net Original-X-Trace: quimby.gnus.org 1082060924 4416 66.134.21.51 (15 Apr 2004 20:28:44 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Thu, 15 Apr 2004 20:28:44 +0000 (UTC) User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (windows-nt) Cancel-Lock: sha1:KdDdRwqaSGXh8EbBKg53eBsQPf8= Precedence: bulk Xref: main.gmane.org gmane.emacs.gnus.general:57038 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:57038 Wes Hardaker writes: >>>>>> On Thu, 15 Apr 2004 12:20:31 -0500, Kevin Greiner said: > > Kevin> Now, one question, are you writing your smtp switch logic into > Kevin> the function called by message-send-mail-function? I believe > Kevin> that you must, if you want offline mail to also be send via > Kevin> multiple smtp servers. > > Currently its written into a hook call at message-send-hook. It > decides, based on the contents of the buffer, what to set the > gnus-agent-send-mail-function to (it used to change > message-send-mail-function, which didn't work as previously > discussed). > > I haven't tried it off line yet. > > My suggestion previously was how to fix the problem of my original > assumption which didn't hold true. What I'm actually doing now works > just fine, but I'd rather that people not have to spend a day thinking > about it like I did. Your original assumption should have been valid. The fact that I objected to your patch does not mean that the agent is implemented correctly. It has a bug that needs to be fixed. In fact, since I threw a wrench into your plans, I'll take a stab at patching it for you. If you are truely changing your code to set gnus-agent-send-mail-function then you going down the wrong path. Your code will now break for those users who have turned the agent off as gnus-agent-send-mail-function will never be called. I think that you should really consider how you want to handle offline and delayed (message drafts) mail before proceeding with implementation. When offline, your messages are going to be copied into the queue group. When you go online, you have an option to mail every message in queue. The message-send-hook will, I believe, be called twice. The first time will be as the message is added to queue then again when the message is actually mailed. I'm going to assume that the mail in queue should be dispatched to multiple smtp servers so that being offline is transparent to the actual delivery. If that is the case, I believe that you'll need to have the first message-send-hook put the selected smtp server into the message as a header. The second message-send-hook could then decode, and remove, the custom header. Kevin