Papercut replacement
- imap to print
- use case: on a Raspi oder Office server that hangs in the same LAN like the printer and can print via cups/system using "lp"
- just uses
lp
under the hood - uses the awesome mail_room Gem under the hood to handle imap connection, which does most of the lifting
Send Mail as a authorized return-path (via regex matching) to your mailbox, it will print all pdf Attachments.
USAGE
create config.yml
---
:email: "print@mycompany.de"
:password: "securepassword"
:host: 'imap.mycompany.de'
:port: 993
:ssl: true
:start_ssl: false
:delete_after_delivery: true
:expunge_deleted: true
:name: "inbox"
:search_command: 'NEW'
:delivery_method: "print_attachments"
:delivery_options:
:whitelist_from: ".*@mycompany.de$"
# Modify lp command to change media format, or address, see lp -h for all options
:lp_command: "lp -o media=a4 -o sides=two-sided-long-edge"
ruby run.rb
Or wrap with your favourite init tool.