Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send Later does bad things if throttleDelay is so big that it takes more than check interval to send all the messages #669

Closed
jikamens opened this issue Dec 3, 2023 · 6 comments

Comments

@jikamens
Copy link
Contributor

jikamens commented Dec 3, 2023

          Apparently still not fixed:

Now using SL Version 10.3.3 Last Updated October 28, 2023 TB 115.5.0 (64-bit) on Ubuntu up to date
Mail merge from a list (only using a few emails in the list for now).
Sendlater "throttleDelay": 600000, (I also tried adding another zero with no apparent effect)
Put debugging on Trace and saw nothing helpful - it sent the messages all at once - then said it was waiting 60 seconds

I am thinking I could simulate this by setting up individual times for each email address in the merge file as a column to put in the send field or some such thing - but that seems a bit too crazy.
Or perhaps I could have an external shell script that somehow pushes a message to be sent into TBird every minute or so?
Any other suggestions or work arounds?

Originally posted by @fc0 in #503 (comment)

@jikamens
Copy link
Contributor Author

jikamens commented Dec 3, 2023

Sendlater "throttleDelay": 600000, (I also tried adding another zero with no apparent effect)
Put debugging on Trace and saw nothing helpful - it sent the messages all at once - then said it was waiting 60 seconds

This is not the behavior I am seeing, when throttleDelay is used as intended, which what you're doing isn't. I set throttleDelay to 5000 (5 seconds) and scheduled 3 messages for the same send time, and it worked as intended. Confirmed in two different ways. First, the logs:

2023-12-03T16:44:23.656Z: Throttling send rate: 5s
2023-12-03T16:44:23.621Z: Sending message 6cf81704-f325-4c12-8d54-c36cedc8d372@kamens.us.
2023-12-03T16:44:18.656Z: Throttling send rate: 5s
2023-12-03T16:44:18.617Z: Sending message 5c1e7094-65fa-481b-987a-1bad59fda192@kamens.us.
2023-12-03T16:44:13.644Z: Throttling send rate: 5s
2023-12-03T16:44:13.605Z: Sending message 71306286-a9a3-4935-b7b9-5e4742d429d9@kamens.us.

Second, the timestamps on the corresponding message files on my mail server after they are delivered

# stat 44127[345].
  File: 441273.
  Size: 5200            Blocks: 16         IO Block: 4096   regular file
Device: 800h/2048d      Inode: 1029914     Links: 1
Access: (0600/-rw-------)  Uid: (   76/   cyrus)   Gid: (   12/    mail)
Access: 2023-12-03 11:44:15.000000000 -0500
Modify: 2023-12-03 11:44:15.000000000 -0500
Change: 2023-12-03 11:44:15.469686853 -0500
 Birth: 2023-12-03 11:44:15.459686724 -0500
  File: 441274.
  Size: 5200            Blocks: 16         IO Block: 4096   regular file
Device: 800h/2048d      Inode: 1029917     Links: 1
Access: (0600/-rw-------)  Uid: (   76/   cyrus)   Gid: (   12/    mail)
Access: 2023-12-03 11:44:20.000000000 -0500
Modify: 2023-12-03 11:44:20.000000000 -0500
Change: 2023-12-03 11:44:20.156413967 -0500
 Birth: 2023-12-03 11:44:20.149747215 -0500
  File: 441275.
  Size: 5200            Blocks: 16         IO Block: 4096   regular file
Device: 800h/2048d      Inode: 1029921     Links: 1
Access: (0600/-rw-------)  Uid: (   76/   cyrus)   Gid: (   12/    mail)
Access: 2023-12-03 11:44:25.000000000 -0500
Modify: 2023-12-03 11:44:25.000000000 -0500
Change: 2023-12-03 11:44:25.139811575 -0500
 Birth: 2023-12-03 11:44:25.136478199 -0500

The problem you're running into is that you're going to have problems if you set throttleDelay so large that the time it takes to send all the due/overdue messages in a single loop is longer than your check interval, the default of which is one minute.

Send Later could handle that situation better, so I'm going to "morph" this bug into that, and it's something I'll have to investigate how to improve. In the meantime, Don't Do That (and I'll update the user guide to say that).

I am thinking I could simulate this by setting up individual times for each email address in the merge file as a column to put in the send field or some such thing - but that seems a bit too crazy.

Not only is that not crazy, it's the recommended way to do what you're trying to accomplish. The point of throttleDelay is to placate mail servers which get upset if you send multiple messages in very quick succession. If you are trying to space out many messages by minutes rather than seconds, you should be using Mail Merge for that with a separate send time for each message, not throttleDelay.

@jikamens jikamens changed the title throttleDelay still not working? Send Later does bad things if throttleDelay is so big that it takes more than check interval to send all the messages Dec 3, 2023
@jikamens
Copy link
Contributor Author

jikamens commented Dec 3, 2023

Note: in addition to the problem noted by the originator of this ticket, there's an additional problem when multiple Send Later loops overlap: you start getting popups about the drafts folder being corrupt when it isn't.

I suspect at least two different fixes are required here:

  1. Don't allow throttleDelay to be larger than the check interval.
  2. Don't allow main loop runs to overlap.

@fc0
Copy link

fc0 commented Dec 4, 2023

Got it on throttledelay - not the right thing for my application.

So I am trying to figure out how to do this with mail merge going to send later... and I cannot figure out how... so far.

I want to send one message per minute to each of the folks on a list - using mail merge to generate the messages and Thunderbird - send later - to schedule them one after another at 1-minute intervals. There are thousands of recipients, so I do not want to click on one after another to indicate the individual delay times or do it via a GUI at that level of detail.

Is this something send-later with mail merge can actually do? Where do I find the relevant documentation to do this? Or do I have to somehow script it? And if I do, where do I find the information on scripting to do this?

@jikamens
Copy link
Contributor Author

jikamens commented Dec 4, 2023

I can't really provide the kind of detailed support you're looking for here, but the basic idea is to create a Mail Merge compatible spreadsheet containing all the recipients, with a column for the send time of each message. Put the send time of the first message in the first recipient row of the spreadsheet and then use a formula in all the subsequent rows to increment the time by one minute. Then you can save that as a CSV and use the CSV to do the mail merge. The Send Later user guide explains how to use columns from the CSV to specify the send date and send time. If you have so many messages that the send time rolls over into the next day then you'll have to be a bit cleverer and use a formula to calculate the date/time, not just the time, and insert that date/time into the Mail Merge.

@fc0
Copy link

fc0 commented Dec 4, 2023

Got it - The simplest way is to simply use Mail Merge -> Send Now with Pause set to 60 seconds. The interface stays open as it goes through one after the other - no problem.

@jikamens
Copy link
Contributor Author

It turns out the problem wasn't that main loop runs were overlapping, it was that forAllDrafts was timing out each message send after five seconds even though the throttle delay was much larger than that. It'll be fixed in the next beta not to do that, but it's still a bad idea to use large values for throttleDelay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants