Skip to content

club-1/newsletter-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Newsletter-Go

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.

Features

  • subscription
    • users can subscribe using email
      • subscription verify sender's authenticiy by sending a confirm email
    • users can unsubscribe 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

Installation

  • newsletter is the user facing program that can be used to setup and send the news.
  • newsletterctl is the part that catch subscription and unsubscriptions.

They have to be inside the following subfolders :

bin/newsletter
sbin/newsletterctl

For example inside /usr/local.

Usage

Users may setup, send, or stop the newsletter using the command line.

Setup

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.

Send newsletter

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.

Stop

newsletter [-v] stop

Remove .forward files to deactivate newsletter. Add -v option to increase verbosity.

Deployment

make deploy

Deploy settings can be modified by creating a .env file.

  • REMOTE remote server name (default is club1.fr)
  • REMOTE_PATH instal path (default is /var/tmp/nlgo)

Deployment will create:

bin/newsletter
sbin/newsletterctl

About

newsletter, but in go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •