1

I send emails with delay using mu4e-send-delay. The repo seems out of date with the last commit 2 years ago.

I often find that emails I sent with delay are sent twice, for example a pair sent within 1 minute of each other:

Date: Mon 29 Apr 16:05:09 2019
Date: Mon 29 Apr 16:04:17 2019

an another pair within 1 second of each other:

Date: Tue 30 Apr 12:51:22 2019
Date: Tue 30 Apr 12:51:21 2019

And some pairs have exactly the same timestamp.

Nevertheless, some recipients I contacted only receive one of them.

In addition, attachments show differently, for example one email in the pair has:

Date: Mon 29 Apr 11:56:01 2019
Maildir: /Sent Items
[...body of email...]
<#part type="application/pdf" filename="/var/folders/zx/j_gjm0ld081b_mcqmg3gp9l1zp59y6/T//mu-2137171910/9ca95bbc/3/SS Programme 2019.pdf" disposition=attachment>
<#/part>

and another in the pair has:

Date: Mon 29 Apr 11:55:41 2019
Maildir: /Sent Items
Attachments: [1]SS Programme 2019.pdf(1.1M)
[...body of email...]

This thread mentions a similar behavior with mu4e, not mu4e-send-delay, and the fix is:

(setq mu4e-sent-messages-behavior 'delete)

How can I fix this in mu4e-send-delay?

1 Answer 1

1

This behavior is due to the IMAP protocol. The email is written to the Sent folder once upon sending and then again when pulling emails from the server. Hence the discrepancy in times and in the appearance of attachments.

The cause is lines 281-283 of mu4-send-delay:

;; write mail to Sent-folder
(when file
  (write-file file))

I created a pull request that uses the variable mu4e-sent-messages-behavior from mu4e to decide whether to write to the Sent folder or not, and stay consistent with mu4e:

;; write mail to Sent-folder if set in mu4e
(when (equal 'mu4e-sent-messages-behavior 'sent)
  (when file
    (write-file file)))

I'm not sure why this did not happen when sending emails immediately, even though I did not set that variable to delete.

If it's not merged, pull code from my fork.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.