Skip to content

Test your Email Deliverability by schedule and receive email reports.

License

Notifications You must be signed in to change notification settings

karser/spamtest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

spamtest

  • Check your Email Deliverability (test if your emails are being delivered to Inbox or Spam folder at Gmail, Outlook and etc).
  • Check your Sender Score of your Email Server (IP reputation)
  • Supports multiple accounts
  • Run tests by schedule
  • Receive email reports

Here is how email report looks like:

Prepare files

accounts.json

Define your SMTP accounts here in the following format:

[
  {
    "note": "gsuite my email",
    "dsn": "smtp://[email protected]:[email protected]:587",
    "fromName": "Sender name",
    "fromEmail": "[email protected]"
  }
]

The password must be urlencoded (%2B instead of +, %20 instead of space and etc).

body.html

Put your email contents into this file.

Getting started with docker-compose

This setup runs a glockapps tests with email report by a cron schedule once a week. Create a file called docker-compose.yml with the content below:

version: "3.2"

services:
  spamtest:
    image: karser/spamtest:latest
    restart: unless-stopped
    environment:
      GLOCKAPPS_KEY: 'XXXXXXXXX'
      ACCOUNTS_PATH: '/accounts.json'
      SUBJECT: 'Your test email subject'
      BODY_PATH: '/body.html'
      REPORT_DSN: 'smtp://[email protected]:[email protected]:587'
      REPORT_FROM_EMAIL: '[email protected]'
      REPORT_FROM_NAME: 'Spamtest'
      RECIPIENT_EMAIL: '[email protected],[email protected]'
      CRON_CONFIG: |
        0 0 * * 1 /var/app/bin/console app:spamtest >> /var/log/cron.log 2>&1
        0 8 * * 1 /var/app/bin/console app:report >> /var/log/cron.log 2>&1
    volumes:
      - ./body.html:/body.html:ro
      - ./accounts.json:/accounts.json:ro
    command: ['/usr/local/bin/cron-entrypoint']

Run this and get into the container:

docker-compose up -d
docker exec -it spamtest_spamtest_1 sh

Verify accounts without creating a glockapps test

First you want to make sure that your accounts config is correct and emailable.

bin/console app:spamtest --validate-only

Then let's run a spam test:

bin/console app:spamtest

Send email report

After a while run the report script

bin/console app:report

Getting started without docker

Clone the repo and install dependencies

git clone
composer install

Verify accounts without creating a glockapps test

First you want to make sure that your accounts config is correct and emailable.

bin/console app:spamtest \
  --verify [email protected] \
  --accounts-path=/path/to/accounts.json \
  --subject='Your test email subject' \
  --body-path=/path/to/body.html

Run a glockapps test

bin/console app:spamtest \
  --glockapps-key=XXXXXXXXX
  --accounts-path=/path/to/accounts.json \
  --subject='Your test email subject' \
  --body-path=/path/to/body.html

Send email report

bin/console app:spamtest \
  --glockapps-key=XXXXXXXXX
  --accounts-path=/path/to/accounts.json \
  --report-dsn='smtp://[email protected]:[email protected]:587' \
  [email protected] \
  --report-from-name=Spamtest \