awdeorio / mailmerge

A simple, command line mail merge tool.
MIT License
140 stars 41 forks source link

Retry #36

Open awdeorio opened 5 years ago

awdeorio commented 5 years ago

Wait and retry in response to SMTP rate limiting. Include a configuration parameter to set the timeout.

nickolay commented 3 years ago

@awdeorio you said in #103:

I agree that reliable email delivery would be best implemented by starting with rendering all the templates into a folder. In summary, I think that writing output to a folder is a niche use with a reasonable work-around. I don't think it makes sense as a stand-alone feature. I do think it makes sense as part of the bigger picture of reliable delivery #36. I'm goingg to close this issue in favor of continuing the discussion under issue #36.

Could you sketch out your thoughts on this please? I was planning on simply feeding all the generated eml files to a script that works with an individual message and either gets it accepted by the SMTP server or returns a non-zero error when giving up:

ls /path/to/*.eml | xargs -I{} bash -c "send.sh {} && mv {} {}.sent"

This would alert me when any of the messages failed to send, and would fix itself later in case of an intermittent error. A bad eml would require a manual intervention (removing it from the queue and possibly generating a fixed version).

awdeorio commented 3 years ago

I'm thinking something like this

  1. Create a directory RUNDIR
  2. Render all messages to individual plain text files in RUNDIR
  3. Send messages one at a time a. If success, move on the next message b. If failure, wait and then try again

Design decisions

Testing