Here are the responses I received so far, I don't think these people want to join a forum, but they agreed to allow me to repost their information.
At one time I had a php script that automatically printed any emails sent to z special address. It would actually be easy to adapt it to attachments. I'll look through my backups and see if I can change it. If I did maybe someone could concert.
The guy wants his email PDF attachments automatically printed. I do similar
things at work.
1. Set up procmail. I do this the old way, by creating a ~/.forward file
2. Set up a procmail rule in ~/.procmailrc for his emails. It sounds like they
are all coming from one email address, so that would make it really easy. If
they are coming from multiple addresses, then you could still create a
procmail rule based on the To address (and using a special address to receive
the fax on), or specifying a specific subject line. Assuming one from address,
you would have a procmail rule like this:
3. Create program to process the emails - ~/bin/handle_pdf_att. At this point,
most people say "it's Linux, write your own". I wrote a Perl program that
accepts the emails via stdin, and processes them. Initially I used the Perl
email and MIME libraries from CPAN, but they really sucked, and when I needed
some more detailed mail handling, I found too many of them said things like
"not implemented yet" or "author stopped here and then disappeared, someone
needs to finish this stuff". I wrote my own Perl module to parse the emails,
extract attachments, decode them, etc. Very direct, not fancy, did precisely
what I needed and no more. Not worth passing back to CPAN, not generic enough.
But good enough to handle all incoming email for several domains for several
years without needing attention. If your user wanted, I could easily produce a
new Perl program to extract PDFs from the emails, decode them, write them to
disk so he has permanent storage of them, and then print them. It would take a
few hours. I would be happy to do this.
> 1. Set up procmail. I do this the old way, by creating a ~/.forward file
> 2. Set up a procmail rule in ~/.procmailrc for his emails. It sounds like they
> 3. Create program to process the emails - ~/bin/handle_pdf_att. At this point,
This would only work if the user was using a traditional email system on his
Linux box. One where there is an MTA on the box (sendmail, postfix, qmail,
etc) and his MUA (pine, mutt, etc) pulled from it. And fetchmail pulled from
the ISP and handed email to the MTA. I think that is not common today.
If they have an MUA like Thunderbird that pulls directly from an ISP,
eliminating the need for having an MTA on the box, then my suggested approach
will not work. And I think that this is the more usual way that Linux boxes
are set up these days.
I will post additional responses as they arrive or relay additional questions that you have for the responders.