A very basic newsletter program for POSIX servers.
It allow local server users to send a newsletter with their own email address to a list of subscribers.
It was designed for CLUB1 community server, but may be usable by other UNIX-like servers (like tilde servers).
The design strategy of this piece of code is to take advantage of Sendmail-style .forward files combined with recipient delimiter (+ addresses). On CLUB1's server, we use it with Postfix (man).
This is a rewrite of the previous Bash version https://github.com/club-1/newsletter in Go.
- subscription
- users can subscribe using email
- subscription verify sender's authenticiy by sending a confirm email
- users can unsubscribe using email
- users can subscribe using email
- newsletter sending
- plain text only
- allow markdown formating
- can be send through CLI
- can be send through email
- send a preview email to owner before sending confirmation
- configuration
- subscribeds emails are stored line by line in a plain text file
- signature is stored as a plain text file
- advanced config is stored in JSON file
- interactive setup through CLI
- change language of mail subscribe/unsubscribe interface
- english (default)
- french
- other
- fancy ascii banner
- logger
- store archives of newsletters
newsletteris the user facing program that can be used to setup and send the news.newsletterctlis the part that catch subscription and unsubscriptions.
They have to be inside the following subfolders :
bin/newsletter
sbin/newsletterctl
For example inside /usr/local.
Users may setup, send, or stop the newsletter using the command line.
newsletter setup
Interactive setup to edit display name, newsletter title, language, and signature.
Create necessary .forward files if they do not exist.
Add -v option to increase verbosity.
If your content is stored in a file:
newsletter [-y] [-p] send SUBJECT CONTENT_FILE
Alteratively, you can pipe the content through STDIN:
echo CONTENT | newsletter [-y] [-p] SUBJECT
This will send you a preview mail and ask for confirmation.-y will skip confirmation and preview mail.
If -p is set, action is limited to preview.
newsletter [-v] stop
Remove .forward files to deactivate newsletter. Add -v option to increase verbosity.
make deploy
Deploy settings can be modified by creating a .env file.
REMOTEremote server name (default isclub1.fr)REMOTE_PATHinstal path (default is/var/tmp/nlgo)
Deployment will create:
bin/newsletter
sbin/newsletterctl