Gnus development mailing list
 help / color / mirror / Atom feed
* Sending outgoing messages while unplugged.
@ 2002-07-16 12:11 Davide G.M.Salvetti
  2002-07-16 14:14 ` Kai Großjohann
  0 siblings, 1 reply; 3+ messages in thread
From: Davide G.M.Salvetti @ 2002-07-16 12:11 UTC (permalink / raw)


Hi!

From reading the docs it appears as there's no way to send (via SMTP)
outgoing messages while unplugged.  Is it true?

I'd like to use the agent only for some IMAP group which I can't access
while I'm off line, but I do have a working MTA which takes care of my
mail, so that I don't have a problem sending mail while unplugged.

Is there any way I can tell Gnus not to use the queue even if unplugged?

Many thanks!

-- 
Salve, | GNU PG (GPG) Key ID: 9396865D
Davide | <http://www.linux.it/~salve/>



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

* Re: Sending outgoing messages while unplugged.
  2002-07-16 12:11 Sending outgoing messages while unplugged Davide G.M.Salvetti
@ 2002-07-16 14:14 ` Kai Großjohann
  2002-07-16 15:18   ` Davide G.M.Salvetti
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Großjohann @ 2002-07-16 14:14 UTC (permalink / raw)
  Cc: Ding

"Davide G.M.Salvetti" <salve@debian.org> writes:

> I'd like to use the agent only for some IMAP group which I can't access
> while I'm off line, but I do have a working MTA which takes care of my
> mail, so that I don't have a problem sending mail while unplugged.
>
> Is there any way I can tell Gnus not to use the queue even if unplugged?

Invoking the Agent installs gnus-agent-send-mail as the value of
message-send-mail-function, I think.  I think that setting it back to
message-send-mail-with-sendmail (or whatever) ought to do the trick.

(gnus-agentize)
(setq message-send-mail-function 'message-send-mail-with-sendmail)

But newer Oorts have another mechanism of enabling the Agent (not
gnus-agentize), so I'm not sure how to set message-send-mail-function
after this happens.  Anyone?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)



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

* Re: Sending outgoing messages while unplugged.
  2002-07-16 14:14 ` Kai Großjohann
@ 2002-07-16 15:18   ` Davide G.M.Salvetti
  0 siblings, 0 replies; 3+ messages in thread
From: Davide G.M.Salvetti @ 2002-07-16 15:18 UTC (permalink / raw)
  Cc: Ding

>>>>> "Kai" == Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> writes:

Kai> Invoking the Agent installs gnus-agent-send-mail as the value of
Kai> message-send-mail-function, I think.  I think that setting it back
Kai> to message-send-mail-with-sendmail (or whatever) ought to do the
Kai> trick.

Thank you very much Kai, you got me started.

Kai> But newer Oorts have another mechanism of enabling the Agent (not
Kai> gnus-agentize), so I'm not sure how to set
Kai> message-send-mail-function after this happens.  Anyone?

I see Oort bind message-send-mail-real-function to
gnus-agent-send-mail.

One may bind it back to nil, letting message use
message-send-mail-function instead.  I haven't followed this route,
though.

A quick inspection of gnus-agent-send-mail showed to me that the
simplest thing appears to be redefining it this way

(defun gnus-agent-send-mail ()
  (funcall gnus-agent-send-mail-function))

after gnus has been loaded (one may put the previous defun near the end
of her ~/.gnus).

I think that this behavior should be configurable.  A quick (untested!)
patch may be the following one.

<======================================================================>
*** /tmp/gnus-agent.el5768cWt	Tue Jul 16 17:16:30 2002
--- /tmp/gnus-agent.el5768pgz	Tue Jul 16 17:16:30 2002
***************
*** 82,87 ****
--- 82,92 ----
    :group 'gnus-agent
    :type 'hook)
  
+ (defcustom gnus-agent-send-mail-while-unplugged nil
+   "If non-nil, Gnus will always send outgoing mail immediately.
+ In other words, if non-nil Gnus will not queue your outgoing mail while
+ unplugged, but will call message-send-mail-function immediately.")
+ 
  ;; Extracted from gnus-xmas-redefine in order to preserve user settings
  (when (featurep 'xemacs)
    (add-hook 'gnus-agent-group-mode-hook 'gnus-xmas-agent-group-menu-add))
***************
*** 431,437 ****
       "nndraft:queue" 'gnus-dummy '((gnus-draft-mode)))))
  
  (defun gnus-agent-send-mail ()
!   (if gnus-plugged
        (funcall gnus-agent-send-mail-function)
      (goto-char (point-min))
      (re-search-forward
--- 436,442 ----
       "nndraft:queue" 'gnus-dummy '((gnus-draft-mode)))))
  
  (defun gnus-agent-send-mail ()
!   (if (or gnus-agent-send-mail-while-unplugged gnus-plugged)
        (funcall gnus-agent-send-mail-function)
      (goto-char (point-min))
      (re-search-forward
<======================================================================>

(The doc string should really be rewritten.)

-- 
Salve, | GNU PG (GPG) Key ID: 9396865D
Davide | <http://www.linux.it/~salve/>



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

end of thread, other threads:[~2002-07-16 15:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-16 12:11 Sending outgoing messages while unplugged Davide G.M.Salvetti
2002-07-16 14:14 ` Kai Großjohann
2002-07-16 15:18   ` Davide G.M.Salvetti

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