Gnus development mailing list
 help / color / mirror / Atom feed
* sending mail while unplugged
@ 2003-07-10 13:02 Alexander Kotelnikov
  2003-07-10 15:03 ` Gaute B Strokkenes
  2003-07-10 16:36 ` Steve Evans
  0 siblings, 2 replies; 6+ messages in thread
From: Alexander Kotelnikov @ 2003-07-10 13:02 UTC (permalink / raw)


Hello.

Is there a way to make outgoing mail not keeped in queue, but passed
to MTA on send when gnus is unplugged?

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia



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

* Re: sending mail while unplugged
  2003-07-10 13:02 sending mail while unplugged Alexander Kotelnikov
@ 2003-07-10 15:03 ` Gaute B Strokkenes
  2003-07-11  6:29   ` Xavier Maillard
  2003-07-10 16:36 ` Steve Evans
  1 sibling, 1 reply; 6+ messages in thread
From: Gaute B Strokkenes @ 2003-07-10 15:03 UTC (permalink / raw)


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

On 10 jul 2003, sacha@myxomop.com wrote:

> Hello.
>
> Is there a way to make outgoing mail not keeped in queue, but passed
> to MTA on send when gnus is unplugged?

Try the below patch.  It's going to be applied to Gnus once the
current feature freeze is over.  (I was going to just post a link to
the original message with the patch, but google groups doesn't seem to
have it.)


[-- 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: 103 bytes --]


-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
..Am I in a SOAP OPERA??

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

* Re: sending mail while unplugged
  2003-07-10 13:02 sending mail while unplugged Alexander Kotelnikov
  2003-07-10 15:03 ` Gaute B Strokkenes
@ 2003-07-10 16:36 ` Steve Evans
  1 sibling, 0 replies; 6+ messages in thread
From: Steve Evans @ 2003-07-10 16:36 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 10 Jul 2003, sacha@myxomop.com wrote:

> Hello.
>
> Is there a way to make outgoing mail not keeped in queue, but passed
> to MTA on send when gnus is unplugged?

This is how I did it:

(defadvice message-send-mail (around unplug activate)
  (let ((old-plugged-state gnus-plugged))
    (gnus-agent-toggle-plugged t)
    ad-do-it
    (gnus-agent-toggle-plugged old-plugged-state)))

Steve
- -- 
____________________________________________________________________
Steve Evans            E-mail: mailto:stevee@gorbag.com
                       WEB:    http://www.gorbag.com
Registered Linux user #217906: http://counter.li.org
Public Encyption Key:          http://www.gorbag.com/public-key.html
____________________________________________________________________

Just because everything is different doesn't mean anything has
changed.
		-- Irene Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.7 <http://mailcrypt.sourceforge.net/>

iD8DBQE/DZX9e55D0k1e/z4RAkY3AJ0ajlUKbIz/W1ao1wlQGEt+ruqAywCZAZg8
TekB4A7a57mu34stJVwOfIM=
=/PMQ
-----END PGP SIGNATURE-----



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

* Re: sending mail while unplugged
  2003-07-10 15:03 ` Gaute B Strokkenes
@ 2003-07-11  6:29   ` Xavier Maillard
  2003-07-13 11:59     ` Kai Großjohann
  0 siblings, 1 reply; 6+ messages in thread
From: Xavier Maillard @ 2003-07-11  6:29 UTC (permalink / raw)


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

On 10 jui 2003, Gaute B. Strokkenes verbalised:

On 10 jul 2003, sacha@myxomop.com wrote:
>  
> >  Hello.
> >  
> >  Is there a way to make outgoing mail not keeped in queue, but
> >  passed to MTA on send when gnus is unplugged?
>  
>  Try the below patch.  It's going to be applied to Gnus once the
>  current feature freeze is over.  (I was going to just post a link to
>  the original message with the patch, but google groups doesn't seem
>  to have it.)

Nice feature to have. I only wonder how you, guys, use the gnus
(un)plug feature. I mean here I am automagically unplugged when and
only when I do NOT have any network connection (e.g. in the train).

So I am just curious about that :)

Whatever, it is still usefull to have this too.

zeDek
-- 
http://www.gnusfr.org -- French Gnus user site

Anti-war disclaimer:
	"Bombing for peace is like fucking for virginity"

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: sending mail while unplugged
  2003-07-11  6:29   ` Xavier Maillard
@ 2003-07-13 11:59     ` Kai Großjohann
  2003-07-15  5:42       ` Xavier Maillard
  0 siblings, 1 reply; 6+ messages in thread
From: Kai Großjohann @ 2003-07-13 11:59 UTC (permalink / raw)


Xavier Maillard <zedek@gnu-rox.org> writes:

> Nice feature to have. I only wonder how you, guys, use the gnus
> (un)plug feature. I mean here I am automagically unplugged when and
> only when I do NOT have any network connection (e.g. in the train).

When I log in, ~/.xinitrc starts Gnus unplugged.

I get up in the morning.  I turn on the laptop.  I log in.  I wait
for Gnus to start.  I go plugged.  I fetch news.  I have breakfast
and take a shower.  I go back to the laptop and get new mail and
fetch news once more, just for the heck of it.  I do something for a
minute.  I go back to the laptop, go unplugged, hibernate the laptop,
put it in my backpack.

I go to the trainstation.  In the train, I wake up the laptop, read
mail in unplugged mode and answer it and so on.  At the end of the
train ride, I shut down the laptop.

In the office, I put the laptop into the docking station and turn it
on.  (I had shut it down before because Linux doesn't like to wake up
in the docking station for various reasons.)  I log in.  I wait for
Gnus to appear.  I plug it.  I send queued messages.  I work.

In the evening, it's ``same procedure as every year, James''.
-- 
~/.signature



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

* Re: sending mail while unplugged
  2003-07-13 11:59     ` Kai Großjohann
@ 2003-07-15  5:42       ` Xavier Maillard
  0 siblings, 0 replies; 6+ messages in thread
From: Xavier Maillard @ 2003-07-15  5:42 UTC (permalink / raw)


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

On 13 jui 2003, Kai Großjohann wrote:

>  Xavier Maillard <zedek@gnu-rox.org> writes:
>  
> >  Nice feature to have. I only wonder how you, guys, use the gnus
> >  (un)plug feature. I mean here I am automagically unplugged when and
> >  only when I do NOT have any network connection (e.g. in the train).
>  
>  When I log in, ~/.xinitrc starts Gnus unplugged.

Not exactly the same way I do but your way is good too.
  
>  I get up in the morning.  I turn on the laptop.  I log in.  I wait
>  for Gnus to start.  I go plugged.  I fetch news.  I have breakfast
>  and take a shower.  I go back to the laptop and get new mail and
>  fetch news once more, just for the heck of it.  I do something for a
>  minute.  I go back to the laptop, go unplugged, hibernate the laptop,
>  put it in my backpack.
>  
>  I go to the trainstation.  In the train, I wake up the laptop, read
>  mail in unplugged mode and answer it and so on.  At the end of the
>  train ride, I shut down the laptop.

I must admit this is how I thought everybody used to use the
plugged/unplugged stuff so it fully match my thought :) At least this
is how I DO and I imagine.

>  In the office, I put the laptop into the docking station and turn it
>  on.  (I had shut it down before because Linux doesn't like to wake up
>  in the docking station for various reasons.)  I log in.  I wait for
>  Gnus to appear.  I plug it.  I send queued messages.  I work.

Wow ! You can use your linux box at work !! This is not my case, indeed
:( I have to travel everyday with my 2 laptops : mine and another
running the evil OS !
  
>  In the evening, it's ``same procedure as every year, James''.

Same.

zeDek
-- 
http://www.gnusfr.org -- French Gnus user site

Anti-war disclaimer:
	"Bombing for peace is like fucking for virginity"

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

end of thread, other threads:[~2003-07-15  5:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-10 13:02 sending mail while unplugged Alexander Kotelnikov
2003-07-10 15:03 ` Gaute B Strokkenes
2003-07-11  6:29   ` Xavier Maillard
2003-07-13 11:59     ` Kai Großjohann
2003-07-15  5:42       ` Xavier Maillard
2003-07-10 16:36 ` Steve Evans

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).