Code Monkey home page Code Monkey logo

email2printerftp's Introduction

email2printerFTP

  • This service connects to an IMAP e-mail server and looks for e-mail that are unread/unseen in the Inbox
  • The sender address (domain and e-mail address) is checked against ALLOWED_SENDERS
  • All attachments with file extensions in ALLOWED_FILE_TYPES will be downloaded, and e-mails will be marked as read/seen.
  • If PRINT_ACTIVE is not set to False the service will upload the file to the PRINTER_IP FTP server, to print.

Inspiration

I have an HP MFP 283fdw printer that allows you to use HPEPRINT to send e-mail to <custom-adress>@hpeprint.com to print files easily and remotely, however this requires my document to be uploaded to the HPE cloud. This service allows me to e-mail my self hosted e-mail server and have the HP printer pickup the job over the FTP protocol.

NOTE: My HP printer had "FTP Printing" disabled by default, and I needed to turn this on via a tickbox in the the printers webUI(https) under Networking > Configuration > Advanced

WARNING: The e-mail FROM: header can easily be spoofed unless DMARC is enforced (p=reject) on the sending domain name. You could also configured your IMAP server to only receive e-mail from PERMITTED SENDERS or IP addresses.

Environment Variables

VARIABLE Description
PRINTER_IP (REQUIRED)The IP address of the Printer's FTP server. NOTE: Anonymous FTP authentication is used.
IMAP_SERVER_IP (REQUIRED)The IP or hostname of the IMAP server
IMAP_USERNAME (REQUIRED)The username the authentication with your IMAP server
IMAP_PASSWORD (REQUIRED)The password the authentication with your IMAP server
ALLOWED_SENDERS (REQUIRED) Space seperated e-mail addresses or domain names, e.g. [email protected] gmail.com
SCHEDULE (OPTIONAL) The time (in seconds) between checking the e-mail account Default: 60
ALLOWED_FILE_TYPES (OPTIONAL) Space seperated file extensions that will be sent to the printer Default: pdf. Supports docx with GOTENBERG_API
PRINT_ACTIVE (OPTIONAL) This can be set to False for testing without actually printing, i.e. the file WILL NOT be sent to the printer Default: True
GOTENBERG_API (OPTIONAL) Set the endpoint for Gotenberg http://192.168.0.1:3000 i.e. https://gotenberg.dev/
docker run -it -e PRINTER_IP='192.168.1.50' -e IMAP_SERVER_IP='192.0.2.1' -e IMAP_USERNAME='[email protected]' -e IMAP_PASSWORD='yourIMAPpassword' -e SCHEDULE=90 -e ALLOWED_FILE_TYPES='docx pdf' smck83/email2printerftp

email2printerftp's People

Contributors

smck83 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.