dsmithson/printersmtpserver

By dsmithson

Updated about 2 years ago

Acts as an SMTP server for HP printers, taking attachments and writing them to a folder

Image
Networking
0

1.8K

dsmithson/printersmtpserver repository overview

Printer SMTP Server

This repository contains an SMTP server application designed to be connected to by HP printers, specifically the CM2320nf MFP model. The server accepts attachments, which are images scanned by the printer, and stores them in a specified file path.

Features

  • Accepts SMTP connections on a configurable port (default is 25).
  • Stores email attachments (images) in a specified output path.

Configuration

The application can be configured using command-line parameters or environment variables.

Command-Line Parameters
  • --SmtpPort: The port on which the SMTP server will listen. Defaults to 25 for executable, and 25000 for the docker container (kubernetes doesn't like ports below 1024).
  • --OutputPath: The path where the attachments will be stored. This parameter is required.
Environment Variables
  • SMTP_SMTPPORT: The port on which the SMTP server will listen. Defaults to 25.
  • SMTP_OUTPUTPATH: The path where the attachments will be stored. This variable is required.

Usage

Running the Application

You can run the application using Docker.

Docker
  1. Build the Docker image:

    docker build -t dsmithson/smtp-server-service:latest .
    
  2. Run the Docker container:

    docker run -d -p 25:25 -e SMTP_OUTPUTPATH=/attachments dsmithson/smtp-server-service:latest
    

    You can also specify the port:

    docker run -d -p 2525:2525 -e SMTP_SMTPPORT=2525 -e SMTP_OUTPUTPATH=/attachments dsmithson/smtp-server-service:latest
    
Local Execution
  1. Ensure you have the .NET Core runtime installed.

  2. Build the application:

    dotnet build
    
  3. Run the application:

    dotnet run --project /src/SmtpServerService/SmtpServerService.csproj --SmtpPort 25 --OutputPath /attachments
    

    Or using environment variables:

    SMTP_SMTPPORT=25 SMTP_OUTPUTPATH=/attachments dotnet run --project /src/SmtpServerService/SmtpServerService.csproj
    

License

This project is licensed under the MIT License - see the LICENSE file for details.

Tag summary

Content type

Image

Digest

sha256:db0b17d6d

Size

2.8 MB

Last updated

about 2 years ago

docker pull dsmithson/printersmtpserver