Send E-mail to printer automatically

Using postfix and lp command

First Solution: CronJob

I successfully print incoming mail using this method. I configured postfix for using Maildir by adding this line to main.cf:

home_mailbox = Maildir/

I wrote a short script called printmails:

maildir="$HOME/Maildir/new/"
for entry in `ls $maildir`; do
    cat $HOME/Maildir/new/$entry | lp -d PRINTER_NAME
    mv $HOME/Maildir/new/$entry  $HOME/Maildir/cur/
done

Then I run script for cron.

Second Solution: Intermediate quick print

you can add alias for user in /etc/aliases:

user: "| lp -d PRINTER_NAME"

and run

newaliases