[ANN] mu4e-send-delay / schedule mails

62 views
Skip to first unread message

Benjamin Andresen

unread,
Sep 22, 2016, 7:31:16 PM9/22/16
to mu-di...@googlegroups.com
Hello,

I've created a more fully featured version of delaying and scheduling
mails for mu4e.
It basically does the same thing as Ben Maughen's mu4e-delay but this
one has the following features which aren't present in mu4e-delay:

mu4e context support
Allows easy edit of the X-Delay header in mu4e-compose-mode
Displays scheduled time in mu4e-view
Doesn’t send if mail is currently being edited
Works with attachments

https://github.com/bandresen/mu4e-send-delay/

Right now this is relying on two things which I'm not happy about:

I'm redefining `mu4e~draft-common-construct' [1] so I see he header upon
creating a new mu4e-compose buffer.

And I would like to add the ability to see if a mail in Drafts is
flagged to be scheduled later.
I don't have a ton of drafts, but quickly being able to pin point which
one are actively scheduled and which ones are merely work in progress
would be neat.

Thanks for mu4e! If the code quality is acceptable I would also be glad
to work on this to get it incorporated into mu4e upstream.

Best regards,
Benjamin Andresen

[1] https://github.com/bandresen/mu4e-send-delay/blob/master/mu4e-send-delay.el#L303

Mohamed HIBTI

unread,
Sep 23, 2016, 6:06:36 AM9/23/16
to mu-discuss, be...@in-ulm.de
Hi Benjamin,
Thank you for this package. I tried it (emacs 25.1) and have some issues:
- In your defcustoms you seem to miss mu4e-send-delay-default-timer
- The function gnus-float-time is not defined, you may use  float-time instead
Best regards,
Mohamed

Benjamin Andresen

unread,
Sep 23, 2016, 9:30:14 AM9/23/16
to Mohamed HIBTI, mu-discuss
Hello Mohamed,

Thanks for the report.

The variable is mu4e-send-delay-timer but I forgot to update from an
older name for the variable in the initialize-send-queue-timer function.

I switched from using the default initialize variable to this way of
doing it so it could be adjusted programatically. No idea how useful,
but that way one could reduce the timer when inside mu4e or increase the
timer when emacs is idle.

I changed from gnus-float-time to float-time. In the README I say I
tested it on emacs 25.1 only, so I guess this is okay.

Best regards,
Benjamin
--
MfG, Benny

Dirk-Jan C. Binnema

unread,
Oct 2, 2016, 7:06:24 AM10/2/16
to mu-di...@googlegroups.com

On Thursday Sep 22 2016, Benjamin Andresen wrote:

> Hello,
>
> I've created a more fully featured version of delaying and scheduling
> mails for mu4e.
> It basically does the same thing as Ben Maughen's mu4e-delay but this
> one has the following features which aren't present in mu4e-delay:
>
> mu4e context support
> Allows easy edit of the X-Delay header in mu4e-compose-mode
> Displays scheduled time in mu4e-view
> Doesn’t send if mail is currently being edited
> Works with attachments
>
> https://github.com/bandresen/mu4e-send-delay/
>
> Right now this is relying on two things which I'm not happy about:
>
> I'm redefining `mu4e~draft-common-construct' [1] so I see he header upon
> creating a new mu4e-compose buffer.
>
> And I would like to add the ability to see if a mail in Drafts is
> flagged to be scheduled later.
> I don't have a ton of drafts, but quickly being able to pin point which
> one are actively scheduled and which ones are merely work in progress
> would be neat.
>
> Thanks for mu4e! If the code quality is acceptable I would also be glad
> to work on this to get it incorporated into mu4e upstream.

Thanks, looks good (at a quick glance), and I can see this being useful!
So, I'd be interested in including this mu4e upstream.

Couple of smaller things:
- It seems mu4e-send-delay-header-value does not ensure the header is
actually a header and not in the message body
- we should ensure it works with emacs 24.x as well
- we'd need a bit of documentation for this

As for the things you're not completely happy about yet, showing the
header should be easily solved. As for distinguishing delayed messages
with draft message -- perhaps we can use a special 'delayed'-folder for
the delayed messages?

Kind regards,
Dirk.

--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C

Ben Maughan

unread,
Oct 4, 2016, 3:53:40 PM10/4/16
to mu-discuss, be...@in-ulm.de
Dear Benjamin,

This looks great - thanks for sharing your work. I've never found time to improve my version so I shall be switching over to using yours when I get chance!

Best wishes,
Ben

Ben Maughan

unread,
Oct 4, 2016, 4:04:57 PM10/4/16
to mu-discuss, be...@in-ulm.de
I forgot to ask, did you manage to get attachments to send correctly when using sendmail rather than smtpmail? My version worked fine with smtpmail but I couldn't put up with the way emacs hangs briefly when the delay timer causes a message to send (this was especially noticeable with an attachment of moderate size). With mu4e-delay and sendmail there is no pause when the mail is sent, but attachments are not attached!

I've not had chance to test mu4e-send-delay but I'll be happy to hear if you solved this problem that I had!

Cheers,
 Ben

Benjamin Andresen

unread,
Oct 5, 2016, 11:46:23 AM10/5/16
to mu-discuss, Ben Maughan
Yeah, I'm using the sendmail configuration and attachments are now
correctly sent.

For me it works properly. The last bug I fixed was about charsets but I
think it should be fine now.

Maybe give it a try!

Best regards,
Benny
--
Mit freundlichen Grüßen,
Benny
0x88FF6C7D5A066E23
6637 32C9 8632 776E A436 3C1B 88FF 6C7D 5A06 6E23

Ben Maughan

unread,
Oct 5, 2016, 3:37:10 PM10/5/16
to mu-discuss, benma...@gmail.com, be...@in-ulm.de
I've tried it out, and it is a huge improvement over my original in every way, and attachments work for me too! mu4e-delay is dead, long live mu4e-send-delay!

Thanks for sharing your code. Are you happy for me to direct people to it on my blog?

Ben

Benjamin Andresen

unread,
Oct 6, 2016, 9:28:21 AM10/6/16
to Ben Maughan, mu-discuss
Great that it's working for you!

And sure, you can people direct them for now. I'm going to have a look
at what to improve or change to get it accepted upstream in the future.

If that time comes I will of course update the github page.

Ben Maughan

unread,
Oct 10, 2016, 4:21:26 PM10/10/16
to mu-discuss, benma...@gmail.com, be...@in-ulm.de
Dear Benny,

I may have found a small bug. If I save a message as a draft and then send a message with delay so that it also ends up in my drafts folder waiting to be sent, then the timer fails with the following:

Error running timer `mu4e-send-delay-send-queue': (wrong-type-argument integerp nil)

and the delayed message is not sent until I delete or send the draft message.

I've not looked in detail to debug this but thought I'd check if you see the same behaviour. I wondered if it is due to the fact the the draft has "2m" as the X-Delay header and not a full timestamp as a delayed message would have.

Cheers,
 Ben

Benjamin Andresen

unread,
Oct 10, 2016, 7:14:58 PM10/10/16
to Ben Maughan, mu-discuss
Dear Ben,

I've noticed that error myself but I'm busy lately so I didn't
investigate it. Thanks for reporting it!

I've pushed a change that fixes it.

I'm a bit amused at myself that my manual testing didn't catch this. It
is after all not quite uncommon to use Drafts for Drafts, which is what
will trigger this error.

Ben Maughan

unread,
Oct 11, 2016, 3:11:01 PM10/11/16
to Benjamin Andresen, mu-discuss
Hi Benny,

That fixed it for me - thanks!

If I spot any other bugs I'll log them as an issue on github to save
spamming the mailing list. I've been using it solidly for a few days
now though, with no other problems.

Cheers,
Ben
--
-----------------------------------------------
Ben Maughan
benma...@gmail.com
http://www.star.bris.ac.uk/bjm

Benjamin Andresen

unread,
Oct 17, 2016, 1:17:54 PM10/17/16
to mu-di...@googlegroups.com

Dirk-Jan C. Binnema
> On Thursday Sep 22 2016, Benjamin Andresen wrote:
>
> Thanks, looks good (at a quick glance), and I can see this being useful!
> So, I'd be interested in including this mu4e upstream.

Dear DJCB,

I would like to revisit this in a few months. I don't think this is
stable enough and I realizied today it isn't well enough integrated to
message.el to not unearth hard to track down behavior in the future.

I will check all the things you point out below while working on it
occassionally.
(The bane of working well enough so the priority isn't completely
there.)

Thanks for the feedback and sorry for the very delayed response.

>
> Couple of smaller things:
> - It seems mu4e-send-delay-header-value does not ensure the header is
> actually a header and not in the message body
> - we should ensure it works with emacs 24.x as well
> - we'd need a bit of documentation for this
>
> As for the things you're not completely happy about yet, showing the
> header should be easily solved. As for distinguishing delayed messages
> with draft message -- perhaps we can use a special 'delayed'-folder for
> the delayed messages?
>
> Kind regards,
> Dirk.
>
> --
> Dirk-Jan C. Binnema Helsinki, Finland
> e:dj...@djcbsoftware.nl w:www.djcbsoftware.nl
> pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C


--
Best regards,

Dirk-Jan C. Binnema

unread,
Oct 18, 2016, 3:31:18 PM10/18/16
to mu-di...@googlegroups.com

On Monday Oct 17 2016, Benjamin Andresen wrote:

> Dirk-Jan C. Binnema
>> On Thursday Sep 22 2016, Benjamin Andresen wrote:
>>
>> Thanks, looks good (at a quick glance), and I can see this being useful!
>> So, I'd be interested in including this mu4e upstream.
>
> Dear DJCB,
>
> I would like to revisit this in a few months. I don't think this is
> stable enough and I realizied today it isn't well enough integrated to
> message.el to not unearth hard to track down behavior in the future.
>
> I will check all the things you point out below while working on it
> occassionally.
> (The bane of working well enough so the priority isn't completely
> there.)

Oh, sure, take your time :)
Reply all
Reply to author
Forward
0 new messages