# Automatic Printing of Emails via Procmail?

## ChojinDSL

My boss would like for all email correspondence between employees and clients to be printed out automatically.

(No need to tell me about how much useless paper this creates.)

At the moment a copy of all outgoing and incoming email is forwarded to a special account.

I figured I would do it as follows:

Use fetchmail + procmail on our fileserver to download all relevant emails from the special account and filter them into separate subdirectories according to user and client.

But how can print all emails in a certain folder automatically? 

I will be using maildir as a storage format. The idea is to print a email as soon as a new one is available, but at the same time not re-print old ones.

I was thinking I could setup a procmail rule which will make a copy of new mail to a special "printing" folder. Once the emails in there are printed, the folder gets emptied.

But how can I get procmail to print? Also, some of our clients send html email. Is there a way using CLI tools to print a html email as it would look in a email client, rather than printing raw HTML code?

----------

## grimm26

You can tell your boss that this has got to be the stupidest idea ever.  It is a waste of resources all around.  By all means, store all this special correspondence in a special email folder, but why in the world should you print it all out?

----------

## i92guboj

I can't give you a solution either.

But I can give you an advice: if you want to avoid legal problems, you and your boss should first make sure you know what the law in your country says about this.

There are two parts here: the right of an enterprise to watch how the resources are used (and that they are used correctly) and the right of the workers to their own privacy. In some countries, would not be legal to use that to watch all the mails of all your workers (in case that that is the intention). In some others, you can do so only after making sure you properly inform all the workers, so they know they are being watched.

I know that in the European community, where I live, it is completely forbidden to intercept or spy any communicaiton (may it be via phone, regular mail or electronic, etc...), unless its purpose is to defend of guarantee the national security. Of course, printing the mails of all your workers would vulnerate (if not blatantly violate) that precept. 

I am not an expert in these matters, anyway. I suppose it all depends on what do you exactly want to do and the law on your country.

EDIT: I also think it is not a smart idea in which regards economy, and much worse in which regards ecology.

----------

## bmichaelsen

you can use

 *Quote:*   

> lynx --dump

 

to render the mails as text.

----------

## ChojinDSL

*sigh*

My boss is aware of the ecological stuff, etc etc. All the admins have told him so. Nonetheless, there is a good reason for this (at least my boss thinks so.).

The employees here work as sales agents for different worldwide territories. It is their job to establish contacts with other companies and maintain regular contact via email.

Offers, quotes and contracts are sent via email. 

Every agent is is hired on a freelance basis and gets paid a certain amount per hour, along with a provision should a client sign a contract with us.

Only email communication between agents and clients is to be printed and filed. This is so that my boss can follow up on exactly what has been communicated with a client and what hasn't, as well as judge the effectiveness of each agent. Also, the idea is, that if an agent should leave suddenly or get fired, that the company can continue where that person has left off.

I also believe its a huge waste of paper, and I believe/hope once my boss sees just how much of a waste of paper and human resources it is, that he will change his mind and that we will simply store them electronically. Nonetheless, I still need to make it work.

On the other hand, there is not THAT much email communication between clients and agents. Theoretically, the amount of paper should be negligable. We'll see once I get it working. 

Obviously the idea is to only print relevant emails, no spam or such. Which is why I will be implementing a whitelist to ensure that really ONLY relevant emails get printed.

So far in theory my method will involve a combination of:

fetchmal (to retrieve emails.)

procmail (for sorting and filtering.)

mimestrip (a perl script which extracts attachments and can store them in a specific folder.)

muttprint (Prints emails nicely formatted and can even print HTML emails, I think.)

htmldoc (Converts different formats to Postscript.)

Last but not least: A bit of bash scripting to tie it all together.

P.S.

I've mentioned legal issues to my boss, but as far as I know its all handled in the contract the agents sign before working here, and its only work email. They are not allowed to use their work email for private purposes. Upon request, the admins will gladly set them up with a private email address with one of the freemail providers, in case they dont already have one.

----------

## bmichaelsen

- I still dont get what the advantage of a printed email is over an electronic email. There is none.

- A far better solution would be to use a CRM or commerial grade issue tracker like OTRS ...

----------

