emacs-async icon indicating copy to clipboard operation
emacs-async copied to clipboard

resend async email.

Open zw963 opened this issue 8 years ago • 7 comments

Hi, I use mu4e, and use emacs-async package to sent email.

But, in some case, when I sent, I found the internet is not connect.

In this case, my sent email is moved to Maildir: /sent, But, the email is not sent out actually.

How to do for this case?

Thanks.

zw963 avatar Jun 17 '16 08:06 zw963

See log, I could see:

Sending via mail...
Delivering message to [email protected]...

If internet is available when sent, correct output is:

[mu4e] Message sent
Delivering message to [email protected]

Current, my internet is not so stable, is there exist a workaround for this?

thanks

zw963 avatar Jun 17 '16 09:06 zw963

Billy.Zheng [email protected] writes:

See log, I could see:

Sending via mail... Delivering message to [email protected]...

If internet is available when sent, correct output is:

[mu4e] Message sent Delivering message to [email protected]

Current, my internet is not so stable, is there exist a workaround for this?

If your connection is unstable, you should use by default mu4e in queued mode, when you are sure you are well connected flush all your queued mails.

I agree this is a problem but it is hard to fix this only on the async side, probably we should find a solution both on mu4e and async-smtp. (i.e telling mu4e the mail have been sent from the async callback)

Thierry

thierryvolpiatto avatar Jun 20 '16 17:06 thierryvolpiatto

I create a issue for mu project too, thanks

My network is not so bad in most case though.

But this case will happen occasionally.

the problem is if this case happen, I hard to do the resend operation. I have to copy this email content and create a new mail send it again. I think this operation maybe make mu4e index broken.

It is a very bad experience for me, currently, I prefer to waiting email is sent and not use async email package. it better ...

zw963 avatar Jun 21 '16 14:06 zw963

This is definitely a bug. The a sinking on package is supposed to signal an error if the email fails to send, which would leave the buffer in an unsent status.

At the moment, this is just an experimental package to show proof of concept. I would recommend not using it in light of this problem.

jwiegley avatar Jun 21 '16 18:06 jwiegley

John Wiegley [email protected] writes:

This is definitely a bug. The a sinking on package is supposed to signal an error if the email fails to send, which would leave the buffer in an unsent status.

This is too late, when the error is sent (if it was) mu4e or whatever mua have moved the email to sent recipient, it is why I said we have to find a fix in both packages (probably around the message-sent-hook usage).

At the moment, this is just an experimental package to show proof of concept. I would recommend not using it in light of this problem.

I use it since months, and when used on a valid connection it is safe to use (this email have been sent async).

Thierry

thierryvolpiatto avatar Jun 21 '16 19:06 thierryvolpiatto

You can modify the value of smtpmail-queue-mail automatically when your network is connected or disconnected. This ensure your mails are queued when network is disconnected. You can achieve this by installing https://github.com/tromey/emacs-network-manager library and using something like this:

(use-package NetworkManager
    :config
    (NetworkManager-add-listener
     (lambda (state)
       (setq smtpmail-queue-mail (not state))
       (when (eq major-mode 'mu4e-main-mode)
         (let ((pos (point)))
           (mu4e~main-view-real nil nil)
           (goto-char pos))))))

thierryvolpiatto avatar Feb 16 '17 08:02 thierryvolpiatto

@thierryvolpiatto , Cool! I will try it later.

Thanks

zw963 avatar Feb 18 '17 05:02 zw963