Giter VIP home page Giter VIP logo

Comments (2)

nickolay avatar nickolay commented on September 28, 2024

@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).

from mailmerge.

awdeorio avatar awdeorio commented on September 28, 2024

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

  • Should we delete messages that have been sent successfully?
  • Where should RUNDIR be located?
  • Which specific SMTP exceptions should trigger a retry?
  • How long to wait between attempts?
  • Where to configure the delay between attempts and max retries?
  • What happens if mailmerge exits unsuccessfully for any reason? E.g., user hits Control-C, an exception occurs, an error in a database row. Delete RUNDIR and start over next time mailmerge is run? Start where you left off?
  • What happens if template or database changes in the middle of a retry? Should we copy the template, database, config, and attachments into RUNDIR?

Testing

  • Verify mailmerge --dry-run does not write any files
  • Directory creation, even with different PWD
  • Message render to files
  • Max retry
  • Delay between attempts
  • Directory cleanup(?) on success
  • Directory cleanup on error
  • Resume behavior on second run after error (pending design decision)

from mailmerge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.