• This repository has been archived on 19/Apr/2021
  • Stars
    star
    984
  • Rank 46,528 (Top 1.0 %)
  • Language
    Java
  • License
    Other
  • Created about 13 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Dummy SMTP server with GUI for testing emails in applications easily.

FakeSMTP

FakeSMTP is a Free Fake SMTP Server with GUI for testing emails in applications easily. It is written in Java.

Configure your application to use localhost as your SMTP server, and all emails will be intercepted and displayed in this software.

FakeSMTP uses SubEthaSMTP: an easy-to-use server-side SMTP library for Java.

FakeSMTP is free to use for commercial and non-commercial projects and the source code is provided.

It is licensed under the very free BSD or GPL license, whichever you prefer.

Requirements

You need Java JVM 1.6 or newer installed on your machine.

If you are on a "Unix-like" machine (Mac, GNU/Linux, BSD...), you may have to be "root" to start the port 25, otherwise, try another port >= 1024.

Usage

The fakeSMTP.jar is auto-executable. If your desktop environment supports it, you can directly double click on the .jar file. Otherwise, run the following command:

java -jar fakeSMTP-VERSION.jar

If you want to specify the directory where emails will be saved when starting the application, you can use the -o argument:

java -jar fakeSMTP-VERSION.jar -o output_directory_name
java -jar fakeSMTP-VERSION.jar --output-dir output_directory_name

If you want to autostart the SMTP server at launch, you can use the -s argument:

java -jar fakeSMTP-VERSION.jar -s
java -jar fakeSMTP-VERSION.jar --start-server

If you want to autostart the SMTP server without a GUI (background) on a different port and bound to the loopback address:

java -jar fakeSMTP-VERSION.jar -s -b -p 2525 -a 127.0.0.1
java -jar fakeSMTP-VERSION.jar --start-server --background --port 2525 --bind-address 127.0.0.1

If you don't need to save emails on the filesystem (to improve the overall performances), you can use the -m (memory mode) argument:

java -jar fakeSMTP-VERSION.jar -m

To see all the available options (relay domains, custom eml-viewer...):

java -jar fakeSMTP-VERSION.jar --help

Alternatives

FakeSMTP was created because we couldn't find any free (as in freedom) and cross-platform SMTP server with GUI for testing emails in applications or websites. Listed below are some greats alternatives to Fake SMTP:

SMTP4dev

  • Nice features;
  • Open source;
  • Windows only (written in .Net).

DevNull SMTP

  • Lightweight;
  • Closed source;
  • Cross-Platform (written in Java 1.4).

Building it

You need to download and setup Maven. Once installed, go to project directory and run the following command:

mvn package -Dmaven.test.skip

This command will create an executable jar on the target folder.

We recommend you not to skip unit tests.

Once you know how to configure unit tests for this project, stop skipping them.

Running integration tests

To run integration tests, you will first need to launch the application and start the server on port 2525.

java -jar fakeSMTP-VERSION.jar -p 2525 -s

You can then run the following command:

mvn integration-test

Change the default port for unit/integration tests

You need to modify the following file: src/test/java/com/nilhcem/fakesmtp/core/test/TestConfig.java.

Please note that it is better to have two different ports for unit and integrations tests, to avoid any port binding exception while running Maven's integration-test goal.

Usage on Docker

  • Run distributed version: Dockerfile

    `docker build -t="mail" github.com/Nilhcem/FakeSMTP`
    
    `docker run -ti -p 250:25 --privileged=true -v /mail:/output mail`
    
  • Build from source

Get sources from GitHub: Dockerfile

git clone https://github.com/Nilhcem/FakeSMTP
cd FakeSMTP

Build the docker image

mvn package docker:build -DskipTests

Run the docker image

docker run -ti -d fakesmtp

Configure container

  • Map the SMTP port 25 to host:

    -p 250:25

  • Map volume for received mails:

    --privileged=true -v /mail-data:/output

Full command

  • Foward fakesmtp:25 to host port 250,

  • mount host folder /home/fakesmtp/mail as container folder /output

    docker run -ti -d -p 250:25 --privileged=true -v /home/fakesmtp/mail:/output fakesmtp

Contact me

Use my github's nickname (at) gmail (dot) com

More Repositories

1

hosts-editor-android

Hosts Editor for Android
Java
275
star
2

home-monitoring-grafana

Home sensor data monitoring with MQTT, InfluxDB and Grafana
Python
242
star
3

tensorflow-classifier-android

http://nilhcem.com/android/custom-tensorflow-classifier
Java
109
star
4

markdown2html

An extremely simple markdown to html converter and editor.
Java
71
star
5

smarthome-androidthings

Home automation with Android Things and the Google Assistant (Actions on Google)
JavaScript
55
star
6

esp32-cloud-iot-core-k8s

Using Cloud IoT Core to connect an ESP32 to the Google Cloud Platform
C
47
star
7

blefun-androidthings

Bluetooth Low Energy communication sample between an Android Things server and an Android client
Java
36
star
8

ble-led-name-badge-android

An Android app to control an LED Name Badge
Kotlin
34
star
9

mobilization-2016

Mobilization VI Schedule app
Java
30
star
10

1602A-androidthings

1602 LCD module driver for Android Things
Java
29
star
11

droidcontn-2016

Latest version: https://github.com/Nilhcem/mobilization-2016
Java
28
star
12

audiofun-androidthings

Android Things project demonstrating Text-To-Speech and Speech-To-Text
Java
26
star
13

usbfun-androidthings

Communication sample between an Arduino and an Android (Things) device over USB
Java
21
star
14

ledcontrol-androidthings

Android Things Port of the Arduino LedControl library for the MAX7219 LED matrix module
Java
19
star
15

ledmatrixfun-androidthings

Android Things project that displays text on an RGB Led Matrix (8x8) via I²C
Java
18
star
16

droidconat-2016

Latest version: https://github.com/Nilhcem/mobilization-2016
Java
16
star
17

assistant-androidthings

Using the Google Assistant + api.ai to create robots that give chocolates
Protocol Buffer
14
star
18

android-websocket-example

Sample project using websockets on Android
Java
13
star
19

mpr121-androidthings

MPR121 driver for Android Things
Java
11
star
20

frcndict-android

French-Chinese Dictionnary for Android
Java
11
star
21

nearby-connections-api-sample-things

Using Nearby Connections API to communicate between Android (mobile) and Android Things devices over Wi-Fi
Java
11
star
22

droidconde-2016

Latest version: https://github.com/Nilhcem/mobilization-2016
Java
9
star
23

wsepd-androidthings

WaveShare E-Paper Display driver for Android Things
Java
8
star
24

xebia-essentials-android

Android app that interacts with the Xebia Essentials cards
Java
7
star
25

the-10mn-watchface

A watchface created in 10 minutes (or more)
Java
7
star
26

i2cfun-androidthings

Sample project using an Android Things board as an I2C master, and some slaves (homemade arduino device / ssd1306...)
Kotlin
7
star
27

uartfun-androidthings

Android Things project demonstrating how you can interact from your computer via a UART cable
Java
7
star
28

devfestnantes-2016

DevFest Nantes 2016 Schedule App
Java
6
star
29

home-automation-talk-resources

Home Automation talk resources
C++
6
star
30

device-actions-androidthings

Android Things project with the Google Assistant and Device Actions
Java
6
star
31

lcd-pcf8574-androidthings

LCD 1602 with PCF8574 I2C adapter driver for Android Things
Java
5
star
32

devoxxfr-2016

Latest version: https://github.com/Nilhcem/mobilization-2016
Java
5
star
33

office-noise-detector-androidthings

A way to visualize how noisy is our open space office.
Kotlin
4
star
34

bblfr-android

Brown Bag Lunch France Android Application
Java
4
star
35

droidcongr-2016

Latest version: https://github.com/Nilhcem/mobilization-2016
Java
3
star
36

kids-assistant-androidthings

Room automation for kids, with the Google Assistant
Kotlin
3
star
37

nilhcem.github.io

Personal blog -- http://nilhcem.com
SCSS
3
star
38

hoodie-androidwear

http://nilhcem.com/android-wear/watchfaces-design
Java
3
star
39

blinkt-androidthings

Android Things driver for Pimoroni's Blinkt! hat
Java
3
star
40

keypad-androidthings

Matrix Keypad driver for Android Things
Java
3
star
41

xebia-android-hp-kotlin

Xebia Technical Job Interview Project entirely written in Kotlin
Kotlin
2
star
42

hexawatch

An artistic way to read the time, easy when you know how
Java
2
star
43

shammane-androidwear

A tribute to the shammane watch for Android Wear
Java
2
star
44

ir-rgb-bulb-fun

Reverse engineering an infrared RGB bulb to use with the Google Assistant
Arduino
2
star
45

xebia-rxjava-tutorial

Exemple d'utilisation de la bibliothèque RxJava
Shell
2
star
46

android-dev-challenge-compose-week1

Week #1: Puppy adoption app
Kotlin
1
star
47

xebia-volley-tutorial

Exemple d'utilisation de la bibliothèque Volley
Java
1
star
48

awesome-o-meter

Android app that detects Xiaomi MiKey clicks
Kotlin
1
star
49

android-snapchat-xoxo

Starts Snapchat and takes a discreet screenshot after 5 seconds [ROOT ONLY]
Java
1
star