procmail
[Top] [All Lists]

Re: Filtering MS-Office Attachments

2009-07-17 11:05:41
* R.G. Ball <rgball(_at_)ellerbach(_dot_)com> [08.07.2009 20:15]:
On Wed, July 8, 2009 11:52 am, Thomas Göbel wrote:
[snip]
I am using this code for filter MS-Office attachment and to send an
automatic reply mail. Today i noticed that this recipe also matches on
PDF-Documents? Any idea why? The recipe is OK if all four "*" lines are
fullfilled, isnt it? So, if there is an attachment named name=file.pdf
it should not match this line? But it does!

Actually, by using this type of scoring for the recipe you are saying if
*any* of the 3 conditions with the score match then proceed to the action
line.

If you want all 4 conditions to be met before declaring an MS-Office
attachment was received then take out the "2147483647^0" from the
conditions.

Rich
Thanks Rich,
now all recipes are working. Just one thing i am a little bit confused
about. If there are attachments (ms-office) included the sender gets an
email. This also works fine but in procmail.log i get an error message
as follows:

$ mailstat .procmail.log 

  Total  Number Folder
  -----  ------ ------
      0       1  ## 
      0       1  ## procmail: Error while writing to " msmtp -a gmx "$TO" < 
$HOME/.mailreply.iso"

Is this behavior normal or is there a mistake in the recipe? Maybe i
have to use a lockfile?

:0HB
* ^content-type:.*multipart/(mixed|alternative)
* .*name=.*\.(ppt|xls|doc)
* ! ^X-Loop: my.mail-at-foo.bar
{
        :0
        | msmtp -a gmx "$TO" < $HOME/.mailreply.iso

        :0
        * ^TO.students
        hochschule/

        :0
        * ^TO.*private
        gmx/
}
-- 
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail