imap-print

command module
v0.0.0-...-2f5c5c4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

IMAP-Print

Application connects to IMAP based mail-server via TLS, fetches available emails, downloads corresponding attachments and finaly sends them to a configured printer via cups. A cronjob on my home server execs application every minute and checks if there is smomething to do.

Run & Build

go get ./...
go build -o imap-print *.go

Prerequisites

You have to set up cups on your machine with a configured printer which we can talk to by name.

Configuration

You can use environment variables to configure IMAP-Printer. In addition, you can place a .env file in your current working directory.

IMAP_ADDR=mail.example.com:993
IMAP_USER=myprinter@example.com
IMAP_PASS=mypassword
IMAP_MBOX=INBOX
CUPS_PRINTER=Officejet-6000-E609a
ALLOWED=marco@example.com:someone@somewhere.com
EXTENSIONS=doc:pdf

Application Options

If you do not want to use a .env file you can also make use of direct application options:

NAME:
   IMAPPrint - Query emails and print attachments

USAGE:
   imap-print [global options] command [command options] [arguments...]

VERSION:
   1.0.0

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --addr HOST:PORT, -a HOST:PORT            The IMAP server address HOST:PORT
   --user USER, -u USER                      The IMAP account USER
   --pass PASS, -p PASS                      The IMAP account PASS
   --mbox NAME, -m NAME                      The mailbox NAME (default: "INBOX")
   --printer PRINTER, --prt PRINTER          The cups PRINTER name
   --allowed ADRESSES, --all ADRESSES        List of allowed sender email ADRESSES seperated by ":"
   --extensions EXTENSIONS, --xt EXTENSIONS  List of allowed EXTENSIONS seperated by ":"
   --dry-run, -d                             Execute a dry-run (default: false)
   --verbose, --vv                           Verbose output (default: false)
   --help, -h                                show help (default: false)
   --version, -v                             print the version (default: false)

TODO

  • Implement response email with results

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址