unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* smtp issues: progress indicator and gracious failure
@ 2011-05-20  8:30 emacs user
  2011-05-25  3:14 ` Kevin Rodgers
  0 siblings, 1 reply; 8+ messages in thread
From: emacs user @ 2011-05-20  8:30 UTC (permalink / raw)
  To: help-gnu-emacs

hi all,

These aren't bug reports, but more like feature requests, in the hope
that these features already exist and I dont know how to activate
them.

I use vm with smtpmail to send mail.  when on a slow wireless
connection, sending 20Mb attachments can take over 10 minutes.  I am
wondering if there is a way to get some progress indicator, such as a
continuously updating "percent uploaded" in the echo area?

also, smtp fails quite often, and then I am left with the outgoing
mail buffer.  I can press c-c c-c to try again and that works in most
cases, but then it adds the message to the outgoing folder again, so I
need to erase the .FCC line by hand.  wouldn't it be good if a failed
message was automatically put in "outgoing folder" such as a queued-
mail directory, and then sent at a later time?  perhaps when smtpmail
is called again to send another message?

cheers, E


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

* Re: smtp issues: progress indicator and gracious failure
       [not found] <6e96dd7d-e1b5-4a28-9951-ac5dc73586df@l6g2000vbn.googlegroups.com>
@ 2011-05-20 12:08 ` Uday Reddy
  2011-05-20 12:46 ` Stefan Monnier
       [not found] ` <jwvliy1wngi.fsf-monnier+gnu.emacs.help@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Uday Reddy @ 2011-05-20 12:08 UTC (permalink / raw)
  To: help-gnu-emacs

I think smtpmail is a make-shift solution for sending mail from client 
machines.  You might try experimenting with msmtp, which is a native 
program that implements the SMTP protocol for your machine.  Here is the 
link to the msmtp page:

   http://msmtp.sourceforge.net/

Cheers,
Uday



On 5/20/2011 9:30 AM, emacs user wrote:
> hi all,
>
> These aren't bug reports, but more like feature requests, in the hope
> that these features already exist and I dont know how to activate
> them.
>
> I use vm with smtpmail to send mail.  when on a slow wireless
> connection, sending 20Mb attachments can take over 10 minutes.  I am
> wondering if there is a way to get some progress indicator, such as a
> continuously updating "percent uploaded" in the echo area?
>
> also, smtp fails quite often, and then I am left with the outgoing
> mail buffer.  I can press c-c c-c to try again and that works in most
> cases, but then it adds the message to the outgoing folder again, so I
> need to erase the .FCC line by hand.  wouldn't it be good if a failed
> message was automatically put in "outgoing folder" such as a queued-
> mail directory, and then sent at a later time?  perhaps when smtpmail
> is called again to send another message?
>
> cheers, E



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

* Re: smtp issues: progress indicator and gracious failure
       [not found] <6e96dd7d-e1b5-4a28-9951-ac5dc73586df@l6g2000vbn.googlegroups.com>
  2011-05-20 12:08 ` smtp issues: progress indicator and gracious failure Uday Reddy
@ 2011-05-20 12:46 ` Stefan Monnier
       [not found] ` <jwvliy1wngi.fsf-monnier+gnu.emacs.help@gnu.org>
  2 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-05-20 12:46 UTC (permalink / raw)
  To: help-gnu-emacs

> I use vm with smtpmail to send mail.  when on a slow wireless
> connection, sending 20Mb attachments can take over 10 minutes.  I am
> wondering if there is a way to get some progress indicator, such as a
> continuously updating "percent uploaded" in the echo area?

You could try the patch below.

> also, smtp fails quite often, and then I am left with the outgoing
> mail buffer.

Do you happen to know why?

> I can press c-c c-c to try again and that works in most cases, but
> then it adds the message to the outgoing folder again, so I need to
> erase the .FCC line by hand.  wouldn't it be good if a failed message
> was automatically put in "outgoing folder" such as a queued- mail
> directory, and then sent at a later time?  perhaps when smtpmail is
> called again to send another message?

That seems to be specific to VM, so I'll let the VM crowd handle it.


        Stefan


=== modified file 'lisp/mail/smtpmail.el'
--- lisp/mail/smtpmail.el	2011-02-12 17:51:02 +0000
+++ lisp/mail/smtpmail.el	2011-05-20 12:44:28 +0000
@@ -941,15 +941,20 @@
   (process-send-string process "\r\n"))
 
 (defun smtpmail-send-data (process buffer)
-  (let ((data-continue t) sending-data)
+  (let ((data-continue t) sending-data
+        (pr (make-progress-reporter "Sending email"
+                                    (with-current-buffer buffer (point-min))
+                                    (with-current-buffer buffer (point-max)))))
     (with-current-buffer buffer
       (goto-char (point-min)))
     (while data-continue
       (with-current-buffer buffer
+        (progress-reporter-update pr (point))
         (setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
 	(end-of-line 2)
         (setq data-continue (not (eobp))))
-      (smtpmail-send-data-1 process sending-data))))
+      (smtpmail-send-data-1 process sending-data))
+    (progress-reporter-done pr)))
 
 (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
   "Get address list suitable for smtp RCPT TO: <address>."



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

* Re: smtp issues: progress indicator and gracious failure
       [not found] ` <jwvliy1wngi.fsf-monnier+gnu.emacs.help@gnu.org>
@ 2011-05-21  6:08   ` emacs user
       [not found]   ` <257bb46f-ff6c-42fb-b8ac-741b2eb01e8f@x10g2000yqj.googlegroups.com>
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: emacs user @ 2011-05-21  6:08 UTC (permalink / raw)
  To: help-gnu-emacs

On May 20, 3:46 pm, Stefan Monnier <monn...@iro.umontreal.ca> wrote:
> > I use vm with smtpmail to send mail.  when on a slow wireless
> > connection, sending 20Mb attachments can take over 10 minutes.  I am
> > wondering if there is a way to get some progress indicator, such as a
> > continuously updating "percent uploaded" in the echo area?
>
> You could try the patch below.
>
> > also, smtp fails quite often, and then I am left with the outgoing
> > mail buffer.
>
> Do you happen to know why?
>
> > I can press c-c c-c to try again and that works in most cases, but
> > then it adds the message to the outgoing folder again, so I need to
> > erase the .FCC line by hand.  wouldn't it be good if a failed message
> > was automatically put in "outgoing folder" such as a queued- mail
> > directory, and then sent at a later time?  perhaps when smtpmail is
> > called again to send another message?
>
> That seems to be specific to VM, so I'll let the VM crowd handle it.
>
>         Stefan
>
> === modified file 'lisp/mail/smtpmail.el'
> --- lisp/mail/smtpmail.el       2011-02-12 17:51:02 +0000
> +++ lisp/mail/smtpmail.el       2011-05-20 12:44:28 +0000

thanks, fantastic!  what version of emacs can I apply this patch to?
I tried trunk and it failed, although I may have done this
incorrectly.  cheers, E


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

* Re: smtp issues: progress indicator and gracious failure
       [not found]   ` <257bb46f-ff6c-42fb-b8ac-741b2eb01e8f@x10g2000yqj.googlegroups.com>
@ 2011-05-22 18:41     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-05-22 18:41 UTC (permalink / raw)
  To: help-gnu-emacs

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

> thanks, fantastic!  what version of emacs can I apply this patch to?
> I tried trunk and it failed, although I may have done this
> incorrectly.  cheers, E

It's meant to be applied to `trunk' and seems to apply fine for me.
Here it is again, freshly regenerated from trunk, and bundled up in
a MIME attachment.


        Stefan



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

=== modified file 'lisp/mail/smtpmail.el'
--- lisp/mail/smtpmail.el	2011-02-12 17:51:02 +0000
+++ lisp/mail/smtpmail.el	2011-05-22 18:39:23 +0000
@@ -941,15 +941,20 @@
   (process-send-string process "\r\n"))
 
 (defun smtpmail-send-data (process buffer)
-  (let ((data-continue t) sending-data)
+  (let ((data-continue t) sending-data
+        (pr (make-progress-reporter "Sending email"
+                                    (with-current-buffer buffer (point-min))
+                                    (with-current-buffer buffer (point-max)))))
     (with-current-buffer buffer
       (goto-char (point-min)))
     (while data-continue
       (with-current-buffer buffer
+        (progress-reporter-update pr (point))
         (setq sending-data (buffer-substring (point-at-bol) (point-at-eol)))
 	(end-of-line 2)
         (setq data-continue (not (eobp))))
-      (smtpmail-send-data-1 process sending-data))))
+      (smtpmail-send-data-1 process sending-data))
+    (progress-reporter-done pr)))
 
 (defun smtpmail-deduce-address-list (smtpmail-text-buffer header-start header-end)
   "Get address list suitable for smtp RCPT TO: <address>."


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

* Re: smtp issues: progress indicator and gracious failure
       [not found] ` <jwvliy1wngi.fsf-monnier+gnu.emacs.help@gnu.org>
  2011-05-21  6:08   ` emacs user
       [not found]   ` <257bb46f-ff6c-42fb-b8ac-741b2eb01e8f@x10g2000yqj.googlegroups.com>
@ 2011-05-23  6:50   ` Uday Reddy
       [not found]   ` <4dda0405$0$316$14726298@news.sunsite.dk>
  3 siblings, 0 replies; 8+ messages in thread
From: Uday Reddy @ 2011-05-23  6:50 UTC (permalink / raw)
  To: help-gnu-emacs

On 5/20/2011 1:46 PM, Stefan Monnier wrote:

>> I can press c-c c-c to try again and that works in most cases, but
>> then it adds the message to the outgoing folder again, so I need to
>> erase the .FCC line by hand.  wouldn't it be good if a failed message
>> was automatically put in "outgoing folder" such as a queued- mail
>> directory, and then sent at a later time?  perhaps when smtpmail is
>> called again to send another message?
>
> That seems to be specific to VM, so I'll let the VM crowd handle it.

Well, it is not really a VM thing, except to say that VM is still using 
mail-mode for sending mail, which is semi-obsolete.  mail-mode puts FCC 
headers in the message composition buffer and leaves them there until 
the message gets sent.

Perhaps moving to message-mode will cure the problem?

Cheers,
Uday



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

* Re: smtp issues: progress indicator and gracious failure
       [not found]   ` <4dda0405$0$316$14726298@news.sunsite.dk>
@ 2011-05-23 13:22     ` Stefan Monnier
  0 siblings, 0 replies; 8+ messages in thread
From: Stefan Monnier @ 2011-05-23 13:22 UTC (permalink / raw)
  To: help-gnu-emacs

>>> I can press c-c c-c to try again and that works in most cases, but
>>> then it adds the message to the outgoing folder again, so I need to
>>> erase the .FCC line by hand.  wouldn't it be good if a failed message
>>> was automatically put in "outgoing folder" such as a queued- mail
>>> directory, and then sent at a later time?  perhaps when smtpmail is
>>> called again to send another message?
>> That seems to be specific to VM, so I'll let the VM crowd handle it.
> Well, it is not really a VM thing, except to say that VM is still using
> mail-mode for sending mail, which is semi-obsolete.  mail-mode puts FCC
> headers in the message composition buffer and leaves them there until the
> message gets sent.

Sounds like we have a bug there, then.  I guess "emacs user
<user.emacs@gmail.com>" should M-x report-emacs-bug about it.

> Perhaps moving to message-mode will cure the problem?

I wouldn't know.


        Stefan


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

* Re: smtp issues: progress indicator and gracious failure
  2011-05-20  8:30 emacs user
@ 2011-05-25  3:14 ` Kevin Rodgers
  0 siblings, 0 replies; 8+ messages in thread
From: Kevin Rodgers @ 2011-05-25  3:14 UTC (permalink / raw)
  To: help-gnu-emacs

On 5/20/11 2:30 AM, emacs user wrote:
> hi all,
>
> These aren't bug reports, but more like feature requests, in the hope
> that these features already exist and I dont know how to activate
> them.
>
> I use vm with smtpmail to send mail.  when on a slow wireless
> connection, sending 20Mb attachments can take over 10 minutes.  I am
> wondering if there is a way to get some progress indicator, such as a
> continuously updating "percent uploaded" in the echo area?
>
> also, smtp fails quite often, and then I am left with the outgoing
> mail buffer.  I can press c-c c-c to try again and that works in most
> cases, but then it adds the message to the outgoing folder again, so I
> need to erase the .FCC line by hand.  wouldn't it be good if a failed
> message was automatically put in "outgoing folder" such as a queued-
> mail directory, and then sent at a later time?  perhaps when smtpmail
> is called again to send another message?

There should be a "*trace of SMTP session to HOST*" buffer, where HOST is
smtpmail-smtp-server.

I used to use smtpmail under VM, and added this to my ~/.emacs:

(defadvice smtpmail-send-it (around display-trace-buffer activate)
   "If an error is signalled, display the process buffer."
   (condition-case signals-data
       ad-do-it
     (error (shrink-window-if-larger-than-buffer
	    (display-buffer (get-buffer (format "*trace of SMTP session to %s*"
						smtpmail-smtp-server))))
	   (signal (car signals-data) (cdr signals-data)))))

-- 
Kevin Rodgers
Denver, Colorado, USA




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

end of thread, other threads:[~2011-05-25  3:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <6e96dd7d-e1b5-4a28-9951-ac5dc73586df@l6g2000vbn.googlegroups.com>
2011-05-20 12:08 ` smtp issues: progress indicator and gracious failure Uday Reddy
2011-05-20 12:46 ` Stefan Monnier
     [not found] ` <jwvliy1wngi.fsf-monnier+gnu.emacs.help@gnu.org>
2011-05-21  6:08   ` emacs user
     [not found]   ` <257bb46f-ff6c-42fb-b8ac-741b2eb01e8f@x10g2000yqj.googlegroups.com>
2011-05-22 18:41     ` Stefan Monnier
2011-05-23  6:50   ` Uday Reddy
     [not found]   ` <4dda0405$0$316$14726298@news.sunsite.dk>
2011-05-23 13:22     ` Stefan Monnier
2011-05-20  8:30 emacs user
2011-05-25  3:14 ` Kevin Rodgers

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 read-only IMAP folder(s) and NNTP newsgroup(s).