Peter - I have never done what you are asking, though I can offer a few ideas how autoprint might be done, given that I have used similar processes to do some other things with applications called by Mercury.
These are the steps that I would probably take:
1. Test each received e-mail message to see if it contains a PDF attachment. This can be done by using a regular expression test on message bodies, looking for a "filename=xxxx.pdf".
2, As the next command in the filtering process, call a program. The purpose of the program is to extract the filename from the temporary file. This could probably be done with a .bat or .cmd script though personally, I would use Unix tools for Windows. Using Unix tools it is very easy to extract the filename using grep and cut commands. Once the filename has been extracted, write it to another temporary file. This is required as, so far as I can see, Mercury filter processing cannot actually extract the file name.
3. After 1. and 2. are completed, let Mercury processing continue.
4. There is now a "gotcha". It would be nice to carry straight on and print the PDF file from the first temporary file that was made in 1. However, the S/MIME content of the temporary file needs to be decoded first. There maybe specific applications that coan do just this, but I am not aware of any. The obvious way to do the decoding is to let the client mail application do it. So far as I know, most (maybe all) major e-mail clients decode attachments to a temporary file. This will be the file that you will want to print. However, if you have to wait till the client connects and decodes the file, I think that it wll be necessary to run a daemon/background process to look for the file (you know the filename at this point). I presume that it will be somewhere in the "Temporary Internet Files" structure.
5. If you are able to find the file, it should be possible to print the file ias a background process using Adobe Reader (or Acrobat Professional, if you have it), using the process indicated in http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm
There are a few unknowns in the above. Certainly, if you can find a S/MIME decoder, this would be far easier to use than getting involved with the mail client. In fact, I have just Googled "S/MIME decoder" and there are many hits, though I haven't investigated them. Anyway, if any of these applications are suitable, you may be able to call them from the Mercury filter process and avoid having to deal with daemons and finding files from client temporary files etc.
I am sure that there will be some complications, e.g. what if there is more than one PDF attachment in a message.
Best of luck! I would be interested to know if you succeed.
Gordon
<P>Peter - I have never done what you are asking, though I can offer a few ideas how autoprint might be done, given that I have used similar processes to do some other things with applications called by Mercury.</P>
<P>These are the steps that I would probably take:</P>
<P>1. Test each received e-mail message to see if it contains a PDF attachment.&nbsp; This can be done by using a regular expression test on message bodies, looking for a "filename=xxxx.pdf".</P>
<P>2, As the next command in the filtering process, call a program.&nbsp; The purpose of the program is to extract the filename from the temporary file.&nbsp; This could probably be done with a .bat or .cmd script though personally, I would use Unix tools for Windows.&nbsp; Using Unix tools it is very easy to extract the filename using grep and cut commands.&nbsp; Once the filename has been extracted, write it to another temporary file.&nbsp; This is required as, so far as I can see, Mercury filter processing cannot actually extract the file name. </P>
<P>3. After&nbsp;1. and 2. are completed,&nbsp;let Mercury processing continue.</P>
<P>4. There is now a "gotcha".&nbsp; It would be nice to carry straight on and print the PDF file from the first temporary file that was made in 1.&nbsp; However, the S/MIME content of the temporary file needs to be decoded first.&nbsp; There maybe specific applications that coan do just this, but I am not aware of any.&nbsp; The obvious way to do the decoding is to let the client mail application do it.&nbsp; So far as I know, most (maybe all) major e-mail clients decode attachments to a temporary file.&nbsp; This will be the file that you will want to print.&nbsp; However, if you have to wait till the client connects and decodes the file, I think that it wll be necessary to run a daemon/background process to look for the file&nbsp; (you know the filename at this point).&nbsp; I presume that it will be somewhere in the "Temporary Internet Files" structure.</P>
<P>5. If you are able to find the file, it should be possible to print the file ias a background process using Adobe Reader (or Acrobat Professional, if you have it), using the process indicated in <A href="http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm">http://support.adobe.com/devsup/devsup.nsf/docs/52080.htm</A></P>
<P>There are a few unknowns in the above.&nbsp; Certainly, if you can find a S/MIME decoder, this would be far easier to use than getting involved with the mail client.&nbsp; In fact, I have just Googled "S/MIME decoder" and there are many hits, though I haven't investigated them.&nbsp; Anyway, if any of these applications are suitable, you may be able to call them from the Mercury filter process and avoid having to deal with daemons and finding files from client temporary files etc.</P>
<P>I am sure that there will be some complications, e.g. what if there is more than one PDF attachment in a message.</P>
<P>Best of luck!&nbsp; I would be interested to know if you succeed.</P>
<P>Gordon</P>
<P mce_keep="true">&nbsp;</P>