Skip to content

MuxPotato/SMTP_SmartMailer_cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Mailer Program

The Smart Mailer Program is a C++ application that sends emails to recipients listed in a CSV file using SMTP services. It supports customizable email bodies, placeholder replacements, and includes tracking functionality to monitor email opens through a 1x1 pixel image hosted on a server. Designed to run on Linux, this program introduces delays between emails to avoid spam detection and generates a detailed report grouped by department codes.

Features

  • Department-Based Filtering: Send emails to specific departments or all recipients in the list.
  • Placeholder Replacement: Replace placeholders like #name# and #department# with recipient-specific values in the email body.
  • HTML Email Support: Supports rich email bodies in HTML format.
  • Email Open Tracking: Includes a transparent 1x1 pixel image in emails to track how many recipients opened the mail.
  • Report Generation: Generates a report showing the number of emails sent, grouped by department code.
  • Cross-Platform GUI/CUI Support: The program provides a clean Command-Line Interface (CUI) for Linux systems.

Additional Development Tools

Nix Shell

A Nix shell configuration is provided for setting up a consistent development environment.

To enter the shell, run:

nix-shell

This will install and set up the following dependencies in an isolated environment:

  • openssl: For secure SMTP connections.
  • boost: C++ libraries for program execution.
  • gcc: C++ compiler.
  • python3: For running auxiliary scripts.
  • flask: Python library for running the pixel tracking server.
  • python-dotenv: To manage environment variables.

Docker Compose

Docker Compose is provided to containerize the Pixel Tracking Server and a Backend API for easier deployment.

Run the following command to start all services:

docker-compose up

This will:

  1. Deploy the Pixel Tracking Server at pixel.chunyu.sh (Port 8080).
  2. Deploy the Backend API at mailer.chunyu.sh (Port 5000).
  3. Set up Traefik as a reverse proxy for routing and securing requests with TLS.
  4. Organize all services into a private Docker network intranet.

Build Dependencies/Installation

The smart_mailer requires gcc, boost, and openssl

Fedora

sudo dnf install gcc-c++ boost-devel openssl-devel

Ubuntu/Debian

sudo apt-get update
sudo apt-get install build-essential libboost-all-dev libssl-dev

Environment Variables

For the smart_mailer to work, some environment variables need to be set. Follow env.example to set the required environment variables.

cp env.example .env

Python Dependencies

Python dependencies can be installed using pip. The Makefile will install the required dependencies.

make install_python_deps

Build/Run Instructions

To build the smart_mailer program, run:

make
make run

To start the pixel tracking server, run:

python pixel_server.py

Cleaning Up

To clean up the build files, run:

make clean

About

Smart Mailer Program: A C++ Linux application for sending customized emails with placeholder support, open tracking via a 1x1 pixel image, spam delay handling, and detailed reports grouped by department codes

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 71.0%
  • Python 16.8%
  • Dockerfile 9.0%
  • Makefile 2.3%
  • Other 0.9%