Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus Agent and mail
@ 2003-01-24  8:33 Sean Neakums
  2003-01-24 12:52 ` Kai Großjohann
  2003-04-13 21:10 ` Kevin Greiner
  0 siblings, 2 replies; 32+ messages in thread
From: Sean Neakums @ 2003-01-24  8:33 UTC (permalink / raw)


What is the current method to prevent sent mail from being queued when
the Agent is active?  My mail select method is not covered by the
Agent, and both message-send-mail-function and
gnus-agent-send-mail-function are set to
message-send-mail-with-sendmail, but when I send mail, it is queued.

-- 
 /                          |
[|] Sean Neakums            | Size *does* matter.
[|] <sneakums@zork.net>     | That's why I use Emacs.
 \                          |



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-01-24  8:33 Gnus Agent and mail Sean Neakums
@ 2003-01-24 12:52 ` Kai Großjohann
  2003-01-24 13:49   ` Sean Neakums
  2003-04-13 21:10 ` Kevin Greiner
  1 sibling, 1 reply; 32+ messages in thread
From: Kai Großjohann @ 2003-01-24 12:52 UTC (permalink / raw)


Sean Neakums <sneakums@zork.net> writes:

> What is the current method to prevent sent mail from being queued when
> the Agent is active?  My mail select method is not covered by the
> Agent, and both message-send-mail-function and
> gnus-agent-send-mail-function are set to
> message-send-mail-with-sendmail, but when I send mail, it is queued.

There is a recent variable message-send-mail-real-function.
-- 
Ambibibentists unite!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-01-24 12:52 ` Kai Großjohann
@ 2003-01-24 13:49   ` Sean Neakums
  2003-01-24 22:00     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 32+ messages in thread
From: Sean Neakums @ 2003-01-24 13:49 UTC (permalink / raw)


commence  Kai Großjohann quotation:

> Sean Neakums <sneakums@zork.net> writes:
>
>> What is the current method to prevent sent mail from being queued
>> when the Agent is active?  My mail select method is not covered by
>> the Agent, and both message-send-mail-function and
>> gnus-agent-send-mail-function are set to
>> message-send-mail-with-sendmail, but when I send mail, it is
>> queued.
>
> There is a recent variable message-send-mail-real-function.

Aha, so there is.  It would be nice if the Agent could be told
directly whether to queue mail or not.  Here is a small patch that
adds and uses a customization for this.  There may be issues I haven't
considered, though.

Index: gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.134
diff -u -r6.134 gnus-agent.el
--- gnus-agent.el	22 Jan 2003 05:30:47 -0000	6.134
+++ gnus-agent.el	24 Jan 2003 13:47:40 -0000
@@ -146,6 +146,11 @@
   :group 'gnus-agent
   :type 'integer)
 
+(defcustom gnus-agent-queue-mail-when-unplugged t
+  "Set to nil to prevent the Agent from queueing sent mail."
+  :group 'gnus-agent
+  :type 'boolean)
+
 ;;; Internal variables
 
 (defvar gnus-agent-history-buffers nil)
@@ -438,10 +443,11 @@
   (gnus-open-agent)
   (add-hook 'gnus-setup-news-hook 'gnus-agent-queue-setup)
   (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))
+    (if gnus-agent-queue-mail-when-unplugged
+	(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)))
   (unless gnus-agent-covered-methods
     (mapcar
      (lambda (server)

-- 
 /                          |
[|] Sean Neakums            | Size *does* matter.
[|] <sneakums@zork.net>     | That's why I use Emacs.
 \                          |



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-01-24 13:49   ` Sean Neakums
@ 2003-01-24 22:00     ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 32+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-24 22:00 UTC (permalink / raw)


Sean Neakums <sneakums@zork.net> writes:

> Aha, so there is.  It would be nice if the Agent could be told
> directly whether to queue mail or not.  Here is a small patch that
> adds and uses a customization for this. 

It seems like it's duplicating the functionality of
`gnus-agent-send-mail-function'.  If you could add a customization
that would allow people to select `message-send-mail-with-sendmail'
as a value to that variable, I think that might be better...

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-01-24  8:33 Gnus Agent and mail Sean Neakums
  2003-01-24 12:52 ` Kai Großjohann
@ 2003-04-13 21:10 ` Kevin Greiner
  2003-04-13 21:18   ` Sean Neakums
  2003-04-14  6:15   ` Kai Großjohann
  1 sibling, 2 replies; 32+ messages in thread
From: Kevin Greiner @ 2003-04-13 21:10 UTC (permalink / raw)


Sean Neakums <sneakums@zork.net> writes:

> What is the current method to prevent sent mail from being queued when
> the Agent is active?  My mail select method is not covered by the
> Agent, and both message-send-mail-function and
> gnus-agent-send-mail-function are set to
> message-send-mail-with-sendmail, but when I send mail, it is queued.

Sean,

I've been looking at your proposed patch.  The code seems
reasonable yet I'm having trouble with your description of the
problem.

I searched on gnus-agent-send-mail-function and found that the
gnus-agentize function binds gnus-agent-send-mail-function to
message-send-mail-with-sendmail (the original value of
message-send-mail-real-function) and message-send-mail-real-function
to gnus-agent-send-mail.  This appears to support your statement that
activating the agent results in your mail being queued.

I then took a look at gnus-agent-send-mail and found this
   (if gnus-plugged
      (funcall gnus-agent-send-mail-function)
   ...)

Since gnus-agent-send-mail-function is
message-send-mail-with-sendmail, it appears that your message is only
queued when you are unplugged.  In your patch, the new variable
gnus-agent-queue-mail-when-unplugged appears to support this
statement.

Now, here's my problem.  The definition of "unplugged" in the manual
is as follows:

  The Gnus Agent is said to be "unplugged" when you have severed the
  connection to the net (and notified the Agent that this is the case).
  When the connection to the net is up again (and Gnus knows this), the
  Agent is "plugged".

Now then, if you've severed your connection to the net, how do you
intend to send your mail?

It would seem that you want to use the agent while plugged.  If that's
actually the case, you won't need your patch.  What you will need to
to check is that gnus-agent-cache is set (so that the agent is active
while plugged).

Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-13 21:10 ` Kevin Greiner
@ 2003-04-13 21:18   ` Sean Neakums
  2003-04-13 23:32     ` Kevin Greiner
  2003-04-14  6:15   ` Kai Großjohann
  1 sibling, 1 reply; 32+ messages in thread
From: Sean Neakums @ 2003-04-13 21:18 UTC (permalink / raw)


Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> Now, here's my problem.  The definition of "unplugged" in the manual
> is as follows:
>
>   The Gnus Agent is said to be "unplugged" when you have severed the
>   connection to the net (and notified the Agent that this is the case).
>   When the connection to the net is up again (and Gnus knows this), the
>   Agent is "plugged".
>
> Now then, if you've severed your connection to the net, how do you
> intend to send your mail?

I hadn't, but I had set the agent unplugged so that it wouldn't poll
the covered servers when I hit 'g', just my mail (I have ':plugged t'
set on my mail sources).  At least, that is my recollection of the
situation; I switched to noffle a while ago and no longer use the
Agent.

-- 
Sean Neakums - <sneakums@zork.net>



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-13 21:18   ` Sean Neakums
@ 2003-04-13 23:32     ` Kevin Greiner
  0 siblings, 0 replies; 32+ messages in thread
From: Kevin Greiner @ 2003-04-13 23:32 UTC (permalink / raw)


Sean Neakums <sneakums@zork.net> writes:

> Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>
>> Now, here's my problem.  The definition of "unplugged" in the manual
>> is as follows:
>>
>>   The Gnus Agent is said to be "unplugged" when you have severed the
>>   connection to the net (and notified the Agent that this is the case).
>>   When the connection to the net is up again (and Gnus knows this), the
>>   Agent is "plugged".
>>
>> Now then, if you've severed your connection to the net, how do you
>> intend to send your mail?
>
> I hadn't, but I had set the agent unplugged so that it wouldn't poll
> the covered servers when I hit 'g', just my mail (I have ':plugged t'
> set on my mail sources).  At least, that is my recollection of the
> situation; I switched to noffle a while ago and no longer use the
> Agent.

OK, thanks for the info.

In case anyone else is following this thread, I believe that you could
have gotten the behavior that you desired by subscribing to your
servers at different levels.  The 'g' command would then ignore those
groups whose level was higher than your default level.  Sorry that I
can't explain better, it's not a feature that I personally use.

Kevin




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-13 21:10 ` Kevin Greiner
  2003-04-13 21:18   ` Sean Neakums
@ 2003-04-14  6:15   ` Kai Großjohann
  2003-04-18  6:31     ` Gaute B Strokkenes
  1 sibling, 1 reply; 32+ messages in thread
From: Kai Großjohann @ 2003-04-14  6:15 UTC (permalink / raw)


Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> Now then, if you've severed your connection to the net, how do you
> intend to send your mail?

Some people have an MTA on their machine which is able to queue mail
while offline.  Then the dialup script (or something like this) sends
the queued mails when connecting to the net.

(That's how my Postfix setup works -- I use laptop-net to find out
whether there is a net connection.  But I still use the Agent to
queue mails inside Gnus -- that seemed to be easier to do.)
-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-14  6:15   ` Kai Großjohann
@ 2003-04-18  6:31     ` Gaute B Strokkenes
  2003-04-29  5:40       ` Kevin Greiner
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-04-18  6:31 UTC (permalink / raw)


On 14 apr 2003, kai.grossjohann@gmx.net wrote:
>Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>
>>Now then, if you've severed your connection to the net, how do you
>>intend to send your mail?
>
>Some people have an MTA on their machine which is able to queue mail
>while offline.  Then the dialup script (or something like this) sends
>the queued mails when connecting to the net.

This is the default setup on Debian machines.  (It's not hard; if you
have a reasonable MTA then it will deal with not being able to contact
remote hosts right away.  The only `special' handling you need is to
flush the mail queue from your ip-up script.)

I used to have exactly this problem; I got some advice a couple of
years ago from Kai (I think) which solved it for me.  Unfortunately I
stopped using the Agent in the meanwhile so I can't work out what the
solution was.

>(That's how my Postfix setup works -- I use laptop-net to find out
>whether there is a net connection.  But I still use the Agent to
>queue mails inside Gnus -- that seemed to be easier to do.)

I think there ought to be an option to control whether or not the
agent should queue mail--it seems easy to add, and it's clearly
useful.

-- 
Gaute Strokkenes                        http://www.srcf.ucam.org/~gs234/
HOW could a GLASS be YELLING??




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-18  6:31     ` Gaute B Strokkenes
@ 2003-04-29  5:40       ` Kevin Greiner
  2003-04-29 15:28         ` Kai Großjohann
  2003-05-08 23:36         ` Gaute B Strokkenes
  0 siblings, 2 replies; 32+ messages in thread
From: Kevin Greiner @ 2003-04-29  5:40 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> On 14 apr 2003, kai.grossjohann@gmx.net wrote:
>>Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>>
>>>Now then, if you've severed your connection to the net, how do you
>>>intend to send your mail?
>>
>>Some people have an MTA on their machine which is able to queue mail
>>while offline.  Then the dialup script (or something like this) sends
>>the queued mails when connecting to the net.
>
> This is the default setup on Debian machines.  (It's not hard; if you
> have a reasonable MTA then it will deal with not being able to contact
> remote hosts right away.  The only `special' handling you need is to
> flush the mail queue from your ip-up script.)
>
> I used to have exactly this problem; I got some advice a couple of
> years ago from Kai (I think) which solved it for me.  Unfortunately I
> stopped using the Agent in the meanwhile so I can't work out what the
> solution was.
>
>>(That's how my Postfix setup works -- I use laptop-net to find out
>>whether there is a net connection.  But I still use the Agent to
>>queue mails inside Gnus -- that seemed to be easier to do.)
>
> I think there ought to be an option to control whether or not the
> agent should queue mail--it seems easy to add, and it's clearly
> useful.

While I agree with the intent, I don't like the idea of changing the
definition of gnus-plugged to cover every back-end EXCEPT imap.

I think that it would be better to change the code such that the
plugged status per server can be configured to either 1) always
plugged, 2) never plugged , or 3) plugged when gnus-plugged is t.

We're in the middle of a feature freeze right now.  I'll hang on to
this to consider later.

Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-29  5:40       ` Kevin Greiner
@ 2003-04-29 15:28         ` Kai Großjohann
  2003-04-30  2:12           ` Kevin Greiner
  2003-05-08 23:36         ` Gaute B Strokkenes
  1 sibling, 1 reply; 32+ messages in thread
From: Kai Großjohann @ 2003-04-29 15:28 UTC (permalink / raw)


Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>
>> I think there ought to be an option to control whether or not the
>> agent should queue mail--it seems easy to add, and it's clearly
>> useful.
>
> While I agree with the intent, I don't like the idea of changing the
> definition of gnus-plugged to cover every back-end EXCEPT imap.

Hm?

Gaute's suggestion wasn't to frob the IMAP behavior.  Just that
message-send-mail-function be different.

At least that's my understanding.
-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-29 15:28         ` Kai Großjohann
@ 2003-04-30  2:12           ` Kevin Greiner
  2003-05-01 10:57             ` Kai Großjohann
  0 siblings, 1 reply; 32+ messages in thread
From: Kevin Greiner @ 2003-04-30  2:12 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>
>> Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>>
>>> I think there ought to be an option to control whether or not the
>>> agent should queue mail--it seems easy to add, and it's clearly
>>> useful.
>>
>> While I agree with the intent, I don't like the idea of changing the
>> definition of gnus-plugged to cover every back-end EXCEPT imap.
>
> Hm?
>
> Gaute's suggestion wasn't to frob the IMAP behavior.  Just that
> message-send-mail-function be different.
>
> At least that's my understanding.

Actually, Sean's original description was of setting a server
parameter to always plug his mail server.  I'm not certain that that
works but he certainly expected it to.

Gaute did ask specifically about mail.  I checked and the agent
controls mail queuing/sending in the function gnus-agent-send-mail.
In that function gnus-plugged is the controlling variable.

Now then, some unasked questions.

First, if a mail backend is configured (by some as yet unspecified
mechanism) to post messages while unplugged.  How does it handle
fetching?  Should it act like it's unplugged or plugged?

Second, if I have multiple mail servers, should I be able to configure
each individually?

My answers were such that individual mail servers could be configured
to act as if they were always plugged.  At that point, I was one small
step from ANY server can be configured to be permanently plugged.


Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-30  2:12           ` Kevin Greiner
@ 2003-05-01 10:57             ` Kai Großjohann
  0 siblings, 0 replies; 32+ messages in thread
From: Kai Großjohann @ 2003-05-01 10:57 UTC (permalink / raw)


Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> kai.grossjohann@gmx.net (Kai Großjohann) writes:
>
>> Gaute's suggestion wasn't to frob the IMAP behavior.  Just that
>> message-send-mail-function be different.
>>
>> At least that's my understanding.
>
> Actually, Sean's original description was of setting a server
> parameter to always plug his mail server.  I'm not certain that that
> works but he certainly expected it to.

Okay, I know nothing about what Sean said -- that message seems
inaccessible at the moment.  I was responding to Gaute...

> Gaute did ask specifically about mail.  I checked and the agent
> controls mail queuing/sending in the function gnus-agent-send-mail.
> In that function gnus-plugged is the controlling variable.

Well, message-send-mail-function could be set to
message-send-mail-with-sendmail or the like, then the Agent wouldn't
be involved in sending mail at all.

> Now then, some unasked questions.
>
> First, if a mail backend is configured (by some as yet unspecified
> mechanism) to post messages while unplugged.  How does it handle
> fetching?  Should it act like it's unplugged or plugged?

Well, posting appears to be different from sending mail.  Hm.

Anyhow, you can configure the unplugged behavior for each mail-sources
entry -- see the :plugged keyword.  So I think it's not necessary to
configure this on a per-server basis.

> Second, if I have multiple mail servers, should I be able to configure
> each individually?

For outgoing mail, such things seem to be difficult.  AFAIK, there is
no builtin functionality in Gnus that allows you to choose different
outgoing mail servers.  You'd have to kludge it somehow.  And while
you're at it (at kludging, I mean), you can also kludge the value of
message-send-mail-function in the same manner.

> My answers were such that individual mail servers could be configured
> to act as if they were always plugged.  At that point, I was one small
> step from ANY server can be configured to be permanently plugged.

Well, if a backend is not under Agent control, then it behaves like
it is always plugged.

Hm.  So what would be the advantage of enrolling a server in the
agent but at the same time configuring it to be always plugged?  Hm.
It would use the agent cache features.  Yeah, that might actually
make sense.

Hm.

I thought that most of the necessary functionality was there already,
but it seems you have a point -- even more functionality may be
desirable.


***


It seems that we were talking cross-purposes a bit.  I was talking
about sending mail, whereas you seemed to have been talking about
fetching mail.  Also, you spoke of posting messages (to nnimap, I
guess), which I didn't address at all.
-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-04-29  5:40       ` Kevin Greiner
  2003-04-29 15:28         ` Kai Großjohann
@ 2003-05-08 23:36         ` Gaute B Strokkenes
  2003-05-10 14:43           ` Kevin Greiner
  1 sibling, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-08 23:36 UTC (permalink / raw)


[It's a bit late to reply to this now, but I've been offline for quite
some time, so...]

On 29 apr 2003, kgreiner@xpediantsolutions.com wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>
>>On 14 apr 2003, kai.grossjohann@gmx.net wrote:
>>I think there ought to be an option to control whether or not the
>>agent should queue mail--it seems easy to add, and it's clearly
>>useful.
>
>While I agree with the intent, I don't like the idea of changing the
>definition of gnus-plugged to cover every back-end EXCEPT imap.

Hmm, where did IMAP get into this?

As far as I know, for mail the machinery for sending mail is totally
decoupled from that for receiving it (unlike news).  For instance, I
have both nnimap and nnml groups, but when I send email it is always
sent with whatever message-send-mail-function specifies.

What I would like is a variable gnus-agent-queue-mail such that:

  always -> always queue mail that is sent, regardless of plugged status.
  nil -> never queue mail that is sent, regardless of plugged status.
  otherwise, queue mail that is sent if and only if gnus is unplugged.

Or at least that is what I would have liked; I now have a permanent
internet connection so don't use the agent much anymore.

>I think that it would be better to change the code such that the
>plugged status per server can be configured to either 1) always
>plugged, 2) never plugged , or 3) plugged when gnus-plugged is t.

That might be useful too.

>We're in the middle of a feature freeze right now.  I'll hang on to
>this to consider later.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Eisenhower!!  Your mimeograph machine upsets my stomach!!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-08 23:36         ` Gaute B Strokkenes
@ 2003-05-10 14:43           ` Kevin Greiner
  2003-05-10 16:08             ` Gaute B Strokkenes
  2003-05-10 17:35             ` Kai Großjohann
  0 siblings, 2 replies; 32+ messages in thread
From: Kevin Greiner @ 2003-05-10 14:43 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> [It's a bit late to reply to this now, but I've been offline for quite
> some time, so...]
>
> On 29 apr 2003, kgreiner@xpediantsolutions.com wrote:
>>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>>
>>>On 14 apr 2003, kai.grossjohann@gmx.net wrote:
>>>I think there ought to be an option to control whether or not the
>>>agent should queue mail--it seems easy to add, and it's clearly
>>>useful.
>>
>>While I agree with the intent, I don't like the idea of changing the
>>definition of gnus-plugged to cover every back-end EXCEPT imap.
>
> Hmm, where did IMAP get into this?

I meant nnimap.

> As far as I know, for mail the machinery for sending mail is totally
> decoupled from that for receiving it (unlike news).  For instance, I
> have both nnimap and nnml groups, but when I send email it is always
> sent with whatever message-send-mail-function specifies.

True.  I personally don't use gnus with my mail so I'm coming up to
speed by making foolish statements :).

> What I would like is a variable gnus-agent-queue-mail such that:
>
>   always -> always queue mail that is sent, regardless of plugged status.
>   nil -> never queue mail that is sent, regardless of plugged status.
>   otherwise, queue mail that is sent if and only if gnus is unplugged.

Yes. Sounds perfectly reasonable.  My concerns are:
1) If I do this for mail sending, will someone else have an equally
   valid argument for why backend X should also have its own "obey
   gnus-plugged" configuration setting?
2) Just how more complex must the configuration get before it is sufficient?

BTW, I'm actually convincing myself that gnus-agent-queue-mail is the
reasonable thing to do.

> Or at least that is what I would have liked; I now have a permanent
> internet connection so don't use the agent much anymore.
>
>>I think that it would be better to change the code such that the
>>plugged status per server can be configured to either 1) always
>>plugged, 2) never plugged , or 3) plugged when gnus-plugged is t.
>
> That might be useful too.

Already voted done.  My interpretation of the gnus-plugged
documentation was incorrect.




^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 14:43           ` Kevin Greiner
@ 2003-05-10 16:08             ` Gaute B Strokkenes
  2003-05-10 22:21               ` Gaute B Strokkenes
  2003-05-10 17:35             ` Kai Großjohann
  1 sibling, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-10 16:08 UTC (permalink / raw)


On 10 mai 2003, kgreiner@xpediantsolutions.com wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>True.  I personally don't use gnus with my mail so I'm coming up to
>speed by making foolish statements :).
>
>>What I would like is a variable gnus-agent-queue-mail such that:
>>
>>always -> always queue mail that is sent, regardless of plugged
>>status.  nil -> never queue mail that is sent, regardless of plugged
>>status.  otherwise, queue mail that is sent if and only if gnus is
>>unplugged.
>
>Yes. Sounds perfectly reasonable.  My concerns are: 1) If I do this
>for mail sending, will someone else have an equally valid argument
>for why backend X should also have its own "obey gnus-plugged"
>configuration setting?

Well, I suppose it should really.  But as you say below, "already
voted done".

>2) Just how more complex must the configuration get before it is
>sufficient?

Buwahaha, it is never enough.

There are certainly a few things that can be simplified and
streamlined, but they're out of reach of my comptence for now,
unfortunately.

>BTW, I'm actually convincing myself that gnus-agent-queue-mail is the
>reasonable thing to do.

Well, I'm having a stab at implementing it now...

>>>I think that it would be better to change the code such that the
>>>plugged status per server can be configured to either 1) always
>>>plugged, 2) never plugged , or 3) plugged when gnus-plugged is t.
>>
>>That might be useful too.
>
>Already voted done.  My interpretation of the gnus-plugged
>documentation was incorrect.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
As President I have to go vacuum my coin collection!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 14:43           ` Kevin Greiner
  2003-05-10 16:08             ` Gaute B Strokkenes
@ 2003-05-10 17:35             ` Kai Großjohann
  2003-05-10 20:54               ` Gaute B Strokkenes
  1 sibling, 1 reply; 32+ messages in thread
From: Kai Großjohann @ 2003-05-10 17:35 UTC (permalink / raw)


Kevin Greiner <kgreiner@xpediantsolutions.com> writes:

> 2) Just how more complex must the configuration get before it is sufficient?
>
> BTW, I'm actually convincing myself that gnus-agent-queue-mail is the
> reasonable thing to do.

I believe it's sufficient to frob message-send-mail-function or
similar variables.

That way, people can queue messages that contain a prime number of
`e' characters if they like.
-- 
This line is not blank,



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 17:35             ` Kai Großjohann
@ 2003-05-10 20:54               ` Gaute B Strokkenes
  2003-05-12 15:49                 ` Kai Großjohann
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-10 20:54 UTC (permalink / raw)


On 10 mai 2003, kai.grossjohann@gmx.net wrote:
>Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>
>>2) Just how more complex must the configuration get before it is
>>   sufficient?
>>
>>BTW, I'm actually convincing myself that gnus-agent-queue-mail is
>>the reasonable thing to do.
>
>I believe it's sufficient to frob message-send-mail-function or
>similar variables.

Yes, but it's kind of hacky and semi-undocumented.

>That way, people can queue messages that contain a prime number of
>`e' characters if they like.

Indeed.  Hmm, perhaps it should be possible to set
gnus-agent-queue-mail to a function...

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
And furthermore, my bowling average is unimpeachable!!!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 16:08             ` Gaute B Strokkenes
@ 2003-05-10 22:21               ` Gaute B Strokkenes
  2003-05-11 23:20                 ` Kevin Greiner
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-10 22:21 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

On 10 mai 2003, gs234@cam.ac.uk wrote:
>On 10 mai 2003, kgreiner@xpediantsolutions.com wrote:
>>BTW, I'm actually convincing myself that gnus-agent-queue-mail is
>>the reasonable thing to do.
>
>Well, I'm having a stab at implementing it now...

And here it is.

2003-05-10  Gaute B Strokkenes <gs234@srcf.ucam.org>

	* gnus-agent.el (gnus-agent-queue-mail): New variable.
	(gnus-agent-send-mail): Use it.

	* gnus-draft.el (gnus-group-send-queue): Bind
	message-send-mail-real-function to the value of
	gnus-agent-send-mail-function when sending queued mail.

If you find this approach at all acceptable, I will start work on the
documentation.

AFAICT there is only one change in behaviour when using the default
configuration: if you hit J S in the Group buffer when unplugged, Gnus
will actually try to send any queued email rather than just rewriting
them to the queue folder.  This is arguably an improvement; if not it
is probably better to have a "are you sure" nag message anyway.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gaqm.diff --]
[-- Type: text/x-patch, Size: 1973 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.170
diff -u -r6.170 gnus-agent.el
--- lisp/gnus-agent.el	30 Apr 2003 15:04:37 -0000	6.170
+++ lisp/gnus-agent.el	10 May 2003 21:40:07 -0000
@@ -169,6 +169,15 @@
   :type '(radio (const :format "Enable " ENABLE)
                 (const :format "Disable " DISABLE)))
 
+(defcustom gnus-agent-queue-mail t
+  "Whether and when outgoing mail should be queued by the agent.  When
+`always', always queue outgoing mail.  When `nil', never queue.
+Otherwise, queue if and only if unplugged."
+  :group 'gnus-agent
+  :type '(radio (const :format "Always" always)
+		(const :format "Never" nil)
+		(const :format "When plugged" t)))
+ 
 (defcustom gnus-agent-expire-unagentized-dirs t
 "Have gnus-agent-expire scan the directories under
 \(gnus-agent-directory) for groups that are no longer agentized.  When
@@ -623,7 +632,8 @@
      'gnus-dummy '((gnus-draft-mode)))))
 
 (defun gnus-agent-send-mail ()
-  (if gnus-plugged
+  (if (or (not gnus-agent-queue-mail)
+	  (and gnus-plugged (not (eq gnus-agent-queue-mail 'always))))
       (funcall gnus-agent-send-mail-function)
     (goto-char (point-min))
     (re-search-forward
Index: lisp/gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-draft.el
--- lisp/gnus-draft.el	12 Apr 2003 23:09:52 -0000	6.21
+++ lisp/gnus-draft.el	10 May 2003 21:40:07 -0000
@@ -203,7 +203,8 @@
 	   article)
       (while (setq article (pop articles))
 	(unless (memq article unsendable)
-	  (let ((message-sending-message
+	  (let ((message-send-mail-real-function gnus-agent-send-mail-function)
+		(message-sending-message
 		 (format "Sending message %d of %d..."
 			 (- total (length articles)) total)))
 	    (gnus-draft-send article)))))))

[-- Attachment #3: Type: text/plain, Size: 156 bytes --]

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Hand me a pair of leather pants and a CASIO keyboard
 -- I'm living for today!

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 22:21               ` Gaute B Strokkenes
@ 2003-05-11 23:20                 ` Kevin Greiner
  2003-05-12  5:52                   ` Gaute B Strokkenes
  0 siblings, 1 reply; 32+ messages in thread
From: Kevin Greiner @ 2003-05-11 23:20 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> On 10 mai 2003, gs234@cam.ac.uk wrote:
>>On 10 mai 2003, kgreiner@xpediantsolutions.com wrote:
>>>BTW, I'm actually convincing myself that gnus-agent-queue-mail is
>>>the reasonable thing to do.
>>
>>Well, I'm having a stab at implementing it now...
>
> And here it is.
>
> 2003-05-10  Gaute B Strokkenes <gs234@srcf.ucam.org>
>
> 	* gnus-agent.el (gnus-agent-queue-mail): New variable.
> 	(gnus-agent-send-mail): Use it.

This part seems fine.


> 	* gnus-draft.el (gnus-group-send-queue): Bind
> 	message-send-mail-real-function to the value of
> 	gnus-agent-send-mail-function when sending queued mail.

I don't like the idea of messing with
message-send-mail-real-function. What happens to someone who is not
using the agent (i.e. gnus-agent-send-mail-function is nil)?

What issue are you trying to resolve by adding this binding?

> If you find this approach at all acceptable, I will start work on the
> documentation.
>
> AFAICT there is only one change in behaviour when using the default
> configuration: if you hit J S in the Group buffer when unplugged, Gnus
> will actually try to send any queued email rather than just rewriting
> them to the queue folder.  This is arguably an improvement; if not it
> is probably better to have a "are you sure" nag message anyway.

We will have to wait until the code is checked in to see what is
arguable.  I've learned that some people find any behavior changes to
be objectable.


Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-11 23:20                 ` Kevin Greiner
@ 2003-05-12  5:52                   ` Gaute B Strokkenes
  2003-05-12 13:47                     ` Kevin Greiner
  2003-05-12 15:51                     ` Kai Großjohann
  0 siblings, 2 replies; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-12  5:52 UTC (permalink / raw)


On 12 mai 2003, kgreiner@xpediantsolutions.com wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>>	* gnus-draft.el (gnus-group-send-queue): Bind
>>	message-send-mail-real-function to the value of
>>	gnus-agent-send-mail-function when sending queued mail.
>
>I don't like the idea of messing with
>message-send-mail-real-function. What happens to someone who is not
>using the agent (i.e. gnus-agent-send-mail-function is nil)?

The sole purpose of that function is to send queued mail (it is the
one that `J S' in the group buffer is bound to.)  So if you're not
using the agent, you're not using this function.

>What issue are you trying to resolve by adding this binding?

Mail is sent by this function pretty much like any other mail.
Therefore, before my patch it would be rewritten back to the queue
folder if gnus were unplugged.  (Some people might like to be
protected from hitting `J S' by mistake while unplugged, by I think
it's a misfeature.  But I digress.)  With my patch, if
gnus-agent-queue-mail is set to always, mail would always be rewritten
to the queue folder if this hunk were not present.  Then there would
be no way to send mail without temporarily setting
gnus-agent-queue-mail to t or nil.

Hmm.  Actually, is is possible to enter the queue group and send
messages with `D s' and `D S'.  I need to take care of those cases as
well.

>We will have to wait until the code is checked in to see what is
>arguable.  I've learned that some people find any behavior changes to
>be objectable.

Well, life is not supposed to be easy ;-)

-- 
Gaute Strokkenes                        http://www.srcf.ucam.org/~gs234/
Let's all show human CONCERN for REVEREND MOON's legal difficulties!!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12  5:52                   ` Gaute B Strokkenes
@ 2003-05-12 13:47                     ` Kevin Greiner
  2003-05-12 18:46                       ` Gaute B Strokkenes
  2003-05-12 15:51                     ` Kai Großjohann
  1 sibling, 1 reply; 32+ messages in thread
From: Kevin Greiner @ 2003-05-12 13:47 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> On 12 mai 2003, kgreiner@xpediantsolutions.com wrote:
>>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>>>	* gnus-draft.el (gnus-group-send-queue): Bind
>>>	message-send-mail-real-function to the value of
>>>	gnus-agent-send-mail-function when sending queued mail.
>>
>>I don't like the idea of messing with
>>message-send-mail-real-function. What happens to someone who is not
>>using the agent (i.e. gnus-agent-send-mail-function is nil)?
>
> The sole purpose of that function is to send queued mail (it is the
> one that `J S' in the group buffer is bound to.)  So if you're not
> using the agent, you're not using this function.
>
>>What issue are you trying to resolve by adding this binding?
>
> Mail is sent by this function pretty much like any other mail.
> Therefore, before my patch it would be rewritten back to the queue
> folder if gnus were unplugged.  (Some people might like to be
> protected from hitting `J S' by mistake while unplugged, by I think
> it's a misfeature.  But I digress.)  With my patch, if
> gnus-agent-queue-mail is set to always, mail would always be rewritten
> to the queue folder if this hunk were not present.  Then there would
> be no way to send mail without temporarily setting
> gnus-agent-queue-mail to t or nil.

That last part was what I was hoping to here.  Wouldn't your patch
work just as well if you bound gnus-agent-queue-mail to nil as your
original bind of message-send-mail-real-function?  

> Hmm.  Actually, is is possible to enter the queue group and send
> messages with `D s' and `D S'.  I need to take care of those cases as
> well.

Hmmm... I'm glad you thought of that now.

Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-10 20:54               ` Gaute B Strokkenes
@ 2003-05-12 15:49                 ` Kai Großjohann
  0 siblings, 0 replies; 32+ messages in thread
From: Kai Großjohann @ 2003-05-12 15:49 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> On 10 mai 2003, kai.grossjohann@gmx.net wrote:
>>Kevin Greiner <kgreiner@xpediantsolutions.com> writes:
>>
>>>2) Just how more complex must the configuration get before it is
>>>   sufficient?
>>>
>>>BTW, I'm actually convincing myself that gnus-agent-queue-mail is
>>>the reasonable thing to do.
>>
>>I believe it's sufficient to frob message-send-mail-function or
>>similar variables.
>
> Yes, but it's kind of hacky and semi-undocumented.

Not sure about the hacky part, but patches for documentation are
appreciated, I'm sure :-)

Maybe Customize could provide some useful options for this variable.
-- 
This line is not blank.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12  5:52                   ` Gaute B Strokkenes
  2003-05-12 13:47                     ` Kevin Greiner
@ 2003-05-12 15:51                     ` Kai Großjohann
  2003-05-12 18:49                       ` Gaute B Strokkenes
  1 sibling, 1 reply; 32+ messages in thread
From: Kai Großjohann @ 2003-05-12 15:51 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> Mail is sent by this function pretty much like any other mail.
> Therefore, before my patch it would be rewritten back to the queue
> folder if gnus were unplugged.  (Some people might like to be
> protected from hitting `J S' by mistake while unplugged, by I think
> it's a misfeature.  But I digress.)

In fact, that misfeature has saved my butt a number of times.

I'm not objecting to the change in general, but please give me a way
to have Gnus continue to save my butt ;-)
-- 
This line is not blank.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12 13:47                     ` Kevin Greiner
@ 2003-05-12 18:46                       ` Gaute B Strokkenes
  2003-05-12 20:37                         ` Gaute B Strokkenes
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-12 18:46 UTC (permalink / raw)


On 12 mai 2003, kgreiner@xpediantsolutions.com wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>
>>Then there would be no way to send mail without temporarily setting
>>gnus-agent-queue-mail to t or nil.
>
>That last part was what I was hoping to here.  Wouldn't your patch
>work just as well if you bound gnus-agent-queue-mail to nil as your
>original bind of message-send-mail-real-function?  

You're quite right; that is a better way to do it.

>>Hmm.  Actually, is is possible to enter the queue group and send
>>messages with `D s' and `D S'.  I need to take care of those cases
>>as well.
>
>Hmmm... I'm glad you thought of that now.

I'll move the rebinding down to gnus-draft-send, suitably guarded.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
I'm EMOTIONAL now because I have MERCHANDISING CLOUT!!



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12 15:51                     ` Kai Großjohann
@ 2003-05-12 18:49                       ` Gaute B Strokkenes
  2003-05-13 12:31                         ` Kai Großjohann
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-12 18:49 UTC (permalink / raw)


On 12 mai 2003, kai.grossjohann@gmx.net wrote:
>Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>
>>Mail is sent by this function pretty much like any other mail.
>>Therefore, before my patch it would be rewritten back to the queue
>>folder if gnus were unplugged.  (Some people might like to be
>>protected from hitting `J S' by mistake while unplugged, by I think
>>it's a misfeature.  But I digress.)
>
>In fact, that misfeature has saved my butt a number of times.
>
>I'm not objecting to the change in general, but please give me a way
>to have Gnus continue to save my butt ;-)

Would it be all right to have a variable which when set causes `J S'
to give an 'are you sure' message when unplugged?

We could call it gnus-agent-save-kais-butt or something ;-)

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Zippy's brain cells are straining to bridge synapses...



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12 18:46                       ` Gaute B Strokkenes
@ 2003-05-12 20:37                         ` Gaute B Strokkenes
  2003-05-14 11:07                           ` Gaute B Strokkenes
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-12 20:37 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1560 bytes --]

On 12 mai 2003, gs234@cam.ac.uk wrote:
> On 12 mai 2003, kgreiner@xpediantsolutions.com wrote:
> >Gaute B Strokkenes <gs234@cam.ac.uk> writes:
> >
> >>Then there would be no way to send mail without temporarily setting
> >>gnus-agent-queue-mail to t or nil.
> >
> >That last part was what I was hoping to here.  Wouldn't your patch
> >work just as well if you bound gnus-agent-queue-mail to nil as your
> >original bind of message-send-mail-real-function?  
> 
> You're quite right; that is a better way to do it.
> 
> >>Hmm.  Actually, is is possible to enter the queue group and send
> >>messages with `D s' and `D S'.  I need to take care of those cases
> >>as well.
> >
> >Hmmm... I'm glad you thought of that now.
> 
> I'll move the rebinding down to gnus-draft-send, suitably guarded.

Here is an improved version:

2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>

	* gnus-agent.el (gnus-agent-queue-mail): New variable.
	(gnus-agent-send-mail): Use it.

	* gnus-draft.el (gnus-group-send-queue): Pass the group name
	"nndraft:queue" along to gnus-draft-send.
	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
	group is "nndraft:queue".

I was slightly unsure about passing "nndraft:queue" down to
gnus-draft-send.  The reason for this is that gnus-draft-send seems to
use this argument in non-obvious ways to set several message-related
variables.  However it already special-cases "nndraft:queue" and I
made sure the behaviour is not actually changed.

I haven't implemented a butt-saver for Kai, though.  I'll have to find
out how...


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gaqm.diff --]
[-- Type: text/x-patch, Size: 2265 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.172
diff -u -r6.172 gnus-agent.el
--- lisp/gnus-agent.el	12 May 2003 18:43:29 -0000	6.172
+++ lisp/gnus-agent.el	12 May 2003 20:30:11 -0000
@@ -169,6 +169,15 @@
   :type '(radio (const :format "Enable " ENABLE)
                 (const :format "Disable " DISABLE)))
 
+(defcustom gnus-agent-queue-mail t
+  "Whether and when outgoing mail should be queued by the agent.  When
+`always', always queue outgoing mail.  When `nil', never queue.
+Otherwise, queue if and only if unplugged."
+  :group 'gnus-agent
+  :type '(radio (const :format "Always" always)
+		(const :format "Never" nil)
+		(const :format "When plugged" t)))
+ 
 (defcustom gnus-agent-expire-unagentized-dirs t
 "Have gnus-agent-expire scan the directories under
 \(gnus-agent-directory) for groups that are no longer agentized.  When
@@ -625,7 +634,8 @@
      'gnus-dummy '((gnus-draft-mode)))))
 
 (defun gnus-agent-send-mail ()
-  (if gnus-plugged
+  (if (or (not gnus-agent-queue-mail)
+	  (and gnus-plugged (not (eq gnus-agent-queue-mail 'always))))
       (funcall gnus-agent-send-mail-function)
     (goto-char (point-min))
     (re-search-forward
Index: lisp/gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-draft.el
--- lisp/gnus-draft.el	12 Apr 2003 23:09:52 -0000	6.21
+++ lisp/gnus-draft.el	12 May 2003 20:30:11 -0000
@@ -141,6 +141,9 @@
 				message-send-hook))
 	(message-setup-hook (and group (not (equal group "nndraft:queue"))
 				 message-setup-hook))
+	(gnus-agent-queue-mail (if (equal group "nndraft:queue")
+				   nil
+				 gnus-agent-queue-mail))
 	type method move-to)
     (gnus-draft-setup article (or group "nndraft:queue"))
     ;; We read the meta-information that says how and where
@@ -206,7 +209,7 @@
 	  (let ((message-sending-message
 		 (format "Sending message %d of %d..."
 			 (- total (length articles)) total)))
-	    (gnus-draft-send article)))))))
+	    (gnus-draft-send article "nndraft:queue")))))))
 
 ;;;###autoload
 (defun gnus-draft-reminder ()

[-- Attachment #3: Type: text/plain, Size: 147 bytes --]

-- 
Gaute Strokkenes                        http://www.srcf.ucam.org/~gs234/
While I'm in LEVITTOWN I thought I'd like to see the NUCLEAR FAMILY!!

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12 18:49                       ` Gaute B Strokkenes
@ 2003-05-13 12:31                         ` Kai Großjohann
  0 siblings, 0 replies; 32+ messages in thread
From: Kai Großjohann @ 2003-05-13 12:31 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> Would it be all right to have a variable which when set causes `J S'
> to give an 'are you sure' message when unplugged?

I could agree both with this suggested behavior and the current
behavior.

-- 
This line is not blank.



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-12 20:37                         ` Gaute B Strokkenes
@ 2003-05-14 11:07                           ` Gaute B Strokkenes
  2003-05-14 17:15                             ` Kevin Greiner
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-14 11:07 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 884 bytes --]

On 12 mai 2003, gs234@cam.ac.uk wrote:
>I was slightly unsure about passing "nndraft:queue" down to
>gnus-draft-send.  The reason for this is that gnus-draft-send seems
>to use this argument in non-obvious ways to set several
>message-related variables.  However it already special-cases
>"nndraft:queue" and I made sure the behaviour is not actually
>changed.
>
>I haven't implemented a butt-saver for Kai, though.  I'll have to
>find out how...

Now done.

2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>

	* gnus-agent.el (gnus-agent-queue-mail,
	gnus-agent-prompt-send-queue): New variables.
	(gnus-agent-send-mail): Use gnus-agent-queue-mail.

	* gnus-draft.el (gnus-group-send-queue): Pass the group name
	"nndraft:queue" along to gnus-draft-send.  Use
	gnus-agent-prompt-send-queue.
	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
	group is "nndraft:queue".


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gaqm.diff --]
[-- Type: text/x-patch, Size: 3492 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.173
diff -u -r6.173 gnus-agent.el
--- lisp/gnus-agent.el	14 May 2003 04:34:37 -0000	6.173
+++ lisp/gnus-agent.el	14 May 2003 11:08:32 -0000
@@ -174,6 +174,21 @@
 \(gnus-agent-directory) for groups that are no longer agentized.  When
 found, offer to remove them.")
 
+(defcustom gnus-agent-queue-mail t
+  "Whether and when outgoing mail should be queued by the agent.  When
+`always', always queue outgoing mail.  When `nil', never queue.
+Otherwise, queue if and only if unplugged."
+  :group 'gnus-agent
+  :type '(radio (const :format "Always" always)
+		(const :format "Never" nil)
+		(const :format "When plugged" t)))
+
+(defcustom gnus-agent-prompt-send-queue nil
+  "If non-nil, `gnus-group-send-queue' will prompt if called when
+unplugged."
+  :group 'gnus-agent
+  :type 'boolean)
+
 ;;; Internal variables
 
 (defvar gnus-agent-history-buffers nil)
@@ -625,7 +640,8 @@
      'gnus-dummy '((gnus-draft-mode)))))
 
 (defun gnus-agent-send-mail ()
-  (if gnus-plugged
+  (if (or (not gnus-agent-queue-mail)
+	  (and gnus-plugged (not (eq gnus-agent-queue-mail 'always))))
       (funcall gnus-agent-send-mail-function)
     (goto-char (point-min))
     (re-search-forward
Index: lisp/gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-draft.el
--- lisp/gnus-draft.el	12 Apr 2003 23:09:52 -0000	6.21
+++ lisp/gnus-draft.el	14 May 2003 11:08:32 -0000
@@ -141,6 +141,9 @@
 				message-send-hook))
 	(message-setup-hook (and group (not (equal group "nndraft:queue"))
 				 message-setup-hook))
+	(gnus-agent-queue-mail (if (equal group "nndraft:queue")
+				   nil
+				 gnus-agent-queue-mail))
 	type method move-to)
     (gnus-draft-setup article (or group "nndraft:queue"))
     ;; We read the meta-information that says how and where
@@ -191,22 +194,25 @@
 (defun gnus-group-send-queue ()
   "Send all sendable articles from the queue group."
   (interactive)
-  (gnus-activate-group "nndraft:queue")
-  (save-excursion
-    (let* ((articles (nndraft-articles))
-	   (unsendable (gnus-uncompress-range
-			(cdr (assq 'unsend
-				   (gnus-info-marks
-				    (gnus-get-info "nndraft:queue"))))))
-	   (gnus-posting-styles nil)
-	   (total (length articles))
-	   article)
-      (while (setq article (pop articles))
-	(unless (memq article unsendable)
-	  (let ((message-sending-message
-		 (format "Sending message %d of %d..."
-			 (- total (length articles)) total)))
-	    (gnus-draft-send article)))))))
+  (when (or gnus-plugged
+	    (not gnus-agent-prompt-send-queue)
+	    (gnus-y-or-n-p "Gnus is unplugged; really send queue? "))
+    (gnus-activate-group "nndraft:queue")
+    (save-excursion
+      (let* ((articles (nndraft-articles))
+	     (unsendable (gnus-uncompress-range
+			  (cdr (assq 'unsend
+				     (gnus-info-marks
+				      (gnus-get-info "nndraft:queue"))))))
+	     (gnus-posting-styles nil)
+	     (total (length articles))
+	     article)
+	(while (setq article (pop articles))
+	  (unless (memq article unsendable)
+	    (let ((message-sending-message
+		   (format "Sending message %d of %d..."
+			   (- total (length articles)) total)))
+	      (gnus-draft-send article "nndraft:queue"))))))))
 
 ;;;###autoload
 (defun gnus-draft-reminder ()

[-- Attachment #3: Type: text/plain, Size: 111 bytes --]

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
My LESLIE GORE record is BROKEN..

^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-14 11:07                           ` Gaute B Strokkenes
@ 2003-05-14 17:15                             ` Kevin Greiner
  2003-05-14 20:15                               ` Gaute B Strokkenes
  0 siblings, 1 reply; 32+ messages in thread
From: Kevin Greiner @ 2003-05-14 17:15 UTC (permalink / raw)


Gaute B Strokkenes <gs234@cam.ac.uk> writes:

> On 12 mai 2003, gs234@cam.ac.uk wrote:
>>I was slightly unsure about passing "nndraft:queue" down to
>>gnus-draft-send.  The reason for this is that gnus-draft-send seems
>>to use this argument in non-obvious ways to set several
>>message-related variables.  However it already special-cases
>>"nndraft:queue" and I made sure the behaviour is not actually
>>changed.
>>
>>I haven't implemented a butt-saver for Kai, though.  I'll have to
>>find out how...
>
> Now done.
>
> 2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>
>
> 	* gnus-agent.el (gnus-agent-queue-mail,
> 	gnus-agent-prompt-send-queue): New variables.
> 	(gnus-agent-send-mail): Use gnus-agent-queue-mail.
>
> 	* gnus-draft.el (gnus-group-send-queue): Pass the group name
> 	"nndraft:queue" along to gnus-draft-send.  Use
> 	gnus-agent-prompt-send-queue.
> 	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
> 	group is "nndraft:queue".

Thanks Gaute,

I'm going to install your patch here.  However, this is arguably an
enhancement rather than a bug fix so I'm going to hold off on checking
it in.  I'll check it in once Lars gives the all clear.

Kevin



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-14 17:15                             ` Kevin Greiner
@ 2003-05-14 20:15                               ` Gaute B Strokkenes
  2003-05-15  8:15                                 ` Gaute B Strokkenes
  0 siblings, 1 reply; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-14 20:15 UTC (permalink / raw)


On 14 mai 2003, kgreiner@xpediantsolutions.com wrote:
> Gaute B Strokkenes <gs234@cam.ac.uk> writes:
> >2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>
> >
> >	* gnus-agent.el (gnus-agent-queue-mail,
> >	gnus-agent-prompt-send-queue): New variables.
> >	(gnus-agent-send-mail): Use gnus-agent-queue-mail.
> >
> >	* gnus-draft.el (gnus-group-send-queue): Pass the group name
> >	"nndraft:queue" along to gnus-draft-send.  Use
> >	gnus-agent-prompt-send-queue.
> >	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
> >	group is "nndraft:queue".
> 
> Thanks Gaute,
> 
> I'm going to install your patch here.  However, this is arguably an
> enhancement rather than a bug fix so I'm going to hold off on
> checking it in.  I'll check it in once Lars gives the all clear.

Goody, goody.

/me toddles off to write the documentation.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Hmmm..  a CRIPPLED ACCOUNTANT with a FALAFEL sandwich is HIT
 by a TROLLEY-CAR..



^ permalink raw reply	[flat|nested] 32+ messages in thread

* Re: Gnus Agent and mail
  2003-05-14 20:15                               ` Gaute B Strokkenes
@ 2003-05-15  8:15                                 ` Gaute B Strokkenes
  0 siblings, 0 replies; 32+ messages in thread
From: Gaute B Strokkenes @ 2003-05-15  8:15 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1491 bytes --]

On 14 mai 2003, gs234@cam.ac.uk wrote:
> On 14 mai 2003, kgreiner@xpediantsolutions.com wrote:
>> Gaute B Strokkenes <gs234@cam.ac.uk> writes:
>>> 2003-05-12  Gaute B Strokkenes <gs234@srcf.ucam.org>
>>>
>>> 	* gnus-agent.el (gnus-agent-queue-mail,
>>> 	gnus-agent-prompt-send-queue): New variables.
>>> 	(gnus-agent-send-mail): Use gnus-agent-queue-mail.
>>>
>>> 	* gnus-draft.el (gnus-group-send-queue): Pass the group name
>>> 	"nndraft:queue" along to gnus-draft-send.  Use
>>> 	gnus-agent-prompt-send-queue.
>>> 	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
>>> 	group is "nndraft:queue".
>>
>> Thanks Gaute,
>>
>> I'm going to install your patch here.  However, this is arguably an
>> enhancement rather than a bug fix so I'm going to hold off on
>> checking it in.  I'll check it in once Lars gives the all clear.
>
> Goody, goody.
>
> /me toddles off to write the documentation.

2003-05-15  Gaute Strokkenes <gs234@srcf.ucam.org>

	* gnus-agent.el (gnus-agent-queue-mail,
	gnus-agent-prompt-send-queue): New variables.
	(gnus-agent-send-mail): Use gnus-agent-queue-mail.

	* gnus-draft.el (gnus-group-send-queue): Pass the group name
	"nndraft:queue" along to gnus-draft-send.  Use
	gnus-agent-prompt-send-queue.
	(gnus-draft-send): Rebind gnus-agent-queue-mail to nil when
	group is "nndraft:queue".

2003-05-15  Gaute Strokkenes <gs234@srcf.ucam.org>

	* gnus.texi (Outgoing Messages, Agent Variables): Add
	gnus-agent-queue-mail and gnus-agent-prompt-send-queue.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gaqm.diff --]
[-- Type: text/x-patch, Size: 6134 bytes --]

Index: lisp/gnus-agent.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-agent.el,v
retrieving revision 6.173
diff -u -r6.173 gnus-agent.el
--- lisp/gnus-agent.el	14 May 2003 04:34:37 -0000	6.173
+++ lisp/gnus-agent.el	15 May 2003 03:39:09 -0000
@@ -174,6 +174,21 @@
 \(gnus-agent-directory) for groups that are no longer agentized.  When
 found, offer to remove them.")
 
+(defcustom gnus-agent-queue-mail t
+  "Whether and when outgoing mail should be queued by the agent.  When
+`always', always queue outgoing mail.  When `nil', never queue.
+Otherwise, queue if and only if unplugged."
+  :group 'gnus-agent
+  :type '(radio (const :format "Always" always)
+		(const :format "Never" nil)
+		(const :format "When plugged" t)))
+
+(defcustom gnus-agent-prompt-send-queue nil
+  "If non-nil, `gnus-group-send-queue' will prompt if called when
+unplugged."
+  :group 'gnus-agent
+  :type 'boolean)
+
 ;;; Internal variables
 
 (defvar gnus-agent-history-buffers nil)
@@ -625,7 +640,8 @@
      'gnus-dummy '((gnus-draft-mode)))))
 
 (defun gnus-agent-send-mail ()
-  (if gnus-plugged
+  (if (or (not gnus-agent-queue-mail)
+	  (and gnus-plugged (not (eq gnus-agent-queue-mail 'always))))
       (funcall gnus-agent-send-mail-function)
     (goto-char (point-min))
     (re-search-forward
Index: lisp/gnus-draft.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-draft.el,v
retrieving revision 6.21
diff -u -r6.21 gnus-draft.el
--- lisp/gnus-draft.el	12 Apr 2003 23:09:52 -0000	6.21
+++ lisp/gnus-draft.el	15 May 2003 03:39:09 -0000
@@ -141,6 +141,9 @@
 				message-send-hook))
 	(message-setup-hook (and group (not (equal group "nndraft:queue"))
 				 message-setup-hook))
+	(gnus-agent-queue-mail (if (equal group "nndraft:queue")
+				   nil
+				 gnus-agent-queue-mail))
 	type method move-to)
     (gnus-draft-setup article (or group "nndraft:queue"))
     ;; We read the meta-information that says how and where
@@ -191,22 +194,25 @@
 (defun gnus-group-send-queue ()
   "Send all sendable articles from the queue group."
   (interactive)
-  (gnus-activate-group "nndraft:queue")
-  (save-excursion
-    (let* ((articles (nndraft-articles))
-	   (unsendable (gnus-uncompress-range
-			(cdr (assq 'unsend
-				   (gnus-info-marks
-				    (gnus-get-info "nndraft:queue"))))))
-	   (gnus-posting-styles nil)
-	   (total (length articles))
-	   article)
-      (while (setq article (pop articles))
-	(unless (memq article unsendable)
-	  (let ((message-sending-message
-		 (format "Sending message %d of %d..."
-			 (- total (length articles)) total)))
-	    (gnus-draft-send article)))))))
+  (when (or gnus-plugged
+	    (not gnus-agent-prompt-send-queue)
+	    (gnus-y-or-n-p "Gnus is unplugged; really send queue? "))
+    (gnus-activate-group "nndraft:queue")
+    (save-excursion
+      (let* ((articles (nndraft-articles))
+	     (unsendable (gnus-uncompress-range
+			  (cdr (assq 'unsend
+				     (gnus-info-marks
+				      (gnus-get-info "nndraft:queue"))))))
+	     (gnus-posting-styles nil)
+	     (total (length articles))
+	     article)
+	(while (setq article (pop articles))
+	  (unless (memq article unsendable)
+	    (let ((message-sending-message
+		   (format "Sending message %d of %d..."
+			   (- total (length articles)) total)))
+	      (gnus-draft-send article "nndraft:queue"))))))))
 
 ;;;###autoload
 (defun gnus-draft-reminder ()
Index: texi/gnus.texi
===================================================================
RCS file: /usr/local/cvsroot/gnus/texi/gnus.texi,v
retrieving revision 6.518
diff -u -r6.518 gnus.texi
--- texi/gnus.texi	13 May 2003 22:58:55 -0000	6.518
+++ texi/gnus.texi	15 May 2003 03:39:29 -0000
@@ -18193,16 +18193,24 @@
 @node Outgoing Messages
 @subsection Outgoing Messages
 
-When Gnus is unplugged, all outgoing messages (both mail and news) are
-stored in the draft group ``queue'' (@pxref{Drafts}).  You can view
-them there after posting, and edit them at will.
-
-When Gnus is plugged again, you can send the messages either from the
-draft group with the special commands available there, or you can use
-the @kbd{J S} command in the group buffer to send all the sendable
-messages in the draft group.
-
-
+By default, when Gnus is unplugged, all outgoing messages (both mail
+and news) are stored in the draft group ``queue'' (@pxref{Drafts}).
+You can view them there after posting, and edit them at will.
+
+You can control the circumstances under which outgoing mail is queued
+(see @code{gnus-agent-queue-mail}, @pxref{Agent Variables}).  Outgoing
+news is always queued when Gnus is unplugged, and never otherwise.
+
+You can send the messages either from the draft group with the special
+commands available there, or you can use the @kbd{J S} command in the
+group buffer to send all the sendable messages in the draft group.
+Posting news will only work when Gnus is plugged, but you can send
+mail at any time.
+
+If sending mail while unplugged does not work for you and you worry
+about hitting @kbd{J S} by accident when unplugged, you can have Gnus
+ask you to confirm your action (see
+@code{gnus-agent-prompt-send-queue}, @pxref{Agent Variables}).
 
 @node Agent Variables
 @subsection Agent Variables
@@ -18296,6 +18304,19 @@
 have not been fetched), @code{always-undownloaded} (maneuvering always
 ignores articles that have not been fetched), @code{unfetched}
 (maneuvering ignores articles whose headers have not been fetched).
+
+@item gnus-agent-queue-mail
+@vindex gnus-agent-queue-mail
+When @code{gnus-agent-queue-mail} is @code{always}, Gnus will always
+queue mail rather than sending it straight away.  When @code{t}, Gnus
+will queue mail when unplugged only.  When @code{nil}, never queue
+mail.  The default is @code{t}.
+
+@item gnus-agent-prompt-send-queue
+@vindex gnus-agent-prompt-send-queue
+When @code{gnus-agent-prompt-send-queue} is non-@code{nil} Gnus will
+prompt you to confirm that you really wish to proceed if you hit
+@kbd{J S} while unplugged.  The default is @code{nil}.
 
 @end table
 

[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
I wonder if I should put myself in ESCROW!!

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2003-05-15  8:15 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-24  8:33 Gnus Agent and mail Sean Neakums
2003-01-24 12:52 ` Kai Großjohann
2003-01-24 13:49   ` Sean Neakums
2003-01-24 22:00     ` Lars Magne Ingebrigtsen
2003-04-13 21:10 ` Kevin Greiner
2003-04-13 21:18   ` Sean Neakums
2003-04-13 23:32     ` Kevin Greiner
2003-04-14  6:15   ` Kai Großjohann
2003-04-18  6:31     ` Gaute B Strokkenes
2003-04-29  5:40       ` Kevin Greiner
2003-04-29 15:28         ` Kai Großjohann
2003-04-30  2:12           ` Kevin Greiner
2003-05-01 10:57             ` Kai Großjohann
2003-05-08 23:36         ` Gaute B Strokkenes
2003-05-10 14:43           ` Kevin Greiner
2003-05-10 16:08             ` Gaute B Strokkenes
2003-05-10 22:21               ` Gaute B Strokkenes
2003-05-11 23:20                 ` Kevin Greiner
2003-05-12  5:52                   ` Gaute B Strokkenes
2003-05-12 13:47                     ` Kevin Greiner
2003-05-12 18:46                       ` Gaute B Strokkenes
2003-05-12 20:37                         ` Gaute B Strokkenes
2003-05-14 11:07                           ` Gaute B Strokkenes
2003-05-14 17:15                             ` Kevin Greiner
2003-05-14 20:15                               ` Gaute B Strokkenes
2003-05-15  8:15                                 ` Gaute B Strokkenes
2003-05-12 15:51                     ` Kai Großjohann
2003-05-12 18:49                       ` Gaute B Strokkenes
2003-05-13 12:31                         ` Kai Großjohann
2003-05-10 17:35             ` Kai Großjohann
2003-05-10 20:54               ` Gaute B Strokkenes
2003-05-12 15:49                 ` Kai Großjohann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).