Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Uday Reddy

On 5/23/2011 1:06 PM, emacs user wrote:



hi Uday, I think I managed to set this up, although didn't switch yet.  one 
advantage may be that msmtp can get the needed smtp password from a system 
keyring/ keychain (on mac os x).  see


Ok, that is good.  I see no downside to switching to msmtp.  So, if you 
are able to, please go ahead.



  "Currently supported keyrings are the Gnome Keyring and the Mac OS X Keychain. The script 
msmtp-gnome-tool.py can be used to manage Gnome Keyring passwords for msmtp. To manage Mac OS X 
Keychain passwords, use the Keychain Access GUI application. The ‘account name’ is same as the msmtp 
‘user’ argument. The ‘keychain item name’ is smtp://  where  matches 
the msmtp ‘host’ argument."

I wonder if this can also be used for incoming imap passwords in vm somehow...


Well, VM doesn't do password storage on its own, but uses Emacs's 
auth-source library.  I think Ted Zlatanov has Mac OS X on his TO-DO 
list too.  Perhaps you can give him a prompt.


Cheers,
Uday


Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Uday Reddy

On 5/23/2011 1:01 PM, emacs user wrote:



I'd be happy to try this.  Is this done by setting some vm-variable?



Not really.  VM needs to be modified to work on top of message-mode.  I 
have it on my TO-DO list.


> will all the vm functionality still be there?   the manual seems to
> only indicate that mail mode is used and that it is not too
> dissimilar from message mode...

Yes, when it is done, there should be no visible change, except that 
message-mode will probably behave a bit better.  We will also be able to 
use it to post messages to newsgroups.


Cheers,
Uday


Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread emacs user
On Friday, May 20, 2011 3:08:30 PM UTC+3, Uday Reddy wrote:
> 
>http://msmtp.sourceforge.net/
> 
> Cheers,
> Uday

hi Uday, I think I managed to set this up, although didn't switch yet.  one 
advantage may be that msmtp can get the needed smtp password from a system 
keyring/ keychain (on mac os x).  see

http://msmtp.sourceforge.net/doc/msmtp.html
 "Currently supported keyrings are the Gnome Keyring and the Mac OS X Keychain. 
The script msmtp-gnome-tool.py can be used to manage Gnome Keyring passwords 
for msmtp. To manage Mac OS X Keychain passwords, use the Keychain Access GUI 
application. The ‘account name’ is same as the msmtp ‘user’ argument. The 
‘keychain item name’ is smtp:// where  matches the msmtp 
‘host’ argument."

I wonder if this can also be used for incoming imap passwords in vm somehow...


Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Stefan Monnier
> 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


=== modified file 'lisp/mail/smtpmail.el'
--- lisp/mail/smtpmail.el	2011-02-12 17:51:02 +
+++ lisp/mail/smtpmail.el	2011-05-22 18:39:23 +
@@ -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: ."



Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread emacs user
On Sunday, May 22, 2011 9:41:28 PM UTC+3, Stefan Monnier wrote:
> 
> 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

OK, this worked miraculously well, totally appreciate this, thanks!   may be 
good to put a space between "sending mail" and the percent indicator.  cheers, E


Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Stefan Monnier
> 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 +
+++ lisp/mail/smtpmail.el   2011-05-20 12:44:28 +
@@ -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: ."



Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Uday Reddy
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




Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Stefan Monnier
>>> 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
" should M-x report-emacs-bug about it.

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

I wouldn't know.


Stefan


Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread Uday Reddy

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



Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread emacs user
On Monday, May 23, 2011 9:50:17 AM UTC+3, Uday Reddy wrote:
> 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

I'd be happy to try this.  Is this done by setting some vm-variable?  will all 
the vm functionality still be there?   the manual seems to only indicate that 
mail mode is used and that it is not too dissimilar from message mode...  



Re: [VM] smtp issues: progress indicator and gracious failure

2011-05-24 Thread emacs user
On May 20, 3:46 pm, Stefan Monnier  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 +
> +++ lisp/mail/smtpmail.el       2011-05-20 12:44:28 +

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