Search code examples
fedoraprocmail

file extention filtering does not work in procmail


procmail will not download just .xls, .doc and .docx extentions. every condition i have found either downloads everything or nothing. i am using fedora 14

conditions i have tried that dont download anything are:

*^[ ]* name:.*\.(xls|doc|docx)  
*^      name.*\.(xls|doc|docx)  
* ?? name:.*\.(xls|doc|docx)  
* filename:.\.(xls|doc|docx)

... and ever other combination of those.

EDIT: i have tried all of these as well.

* name=.*\.(xls|doc|docx)   
* ^.*name=.*.(xls|doc|docx)  
* ^.*name.*\.(xls|doc|docx)  
*^Content-.*attachment.*name=.*\.(xls|doc|docx)

Thank you in advance


Solution

  • Trapping 'multipart' content types first may help, but my procmail is a little rusty:

    :0
    * ^Content-Type: multipart/
    {
      :0 B
      * ^Content-.*attachment.*name=.*\.(doc|xls)
      {
    

    This should catch any .doc, .docx, .xls or .xlsx attachments.