| Welcome to the Zimbra :: Forums! | |
Welcome, if you would like to post a comment please register.
We also encourage you to explore all things Zimbra with our team and members of the community.
|  | 
10-16-2008, 12:31 AM
| | | filter attachment problem 
Hello, everybody:
I have a problem now;
That I want reject some mails by attachment filename;
Like if I receive a mail , and the mail have an attachment named test.zip;
So I want whether have a way to set the specially attachment name to reject this email..
Please help me a lot! Thank you very much.  | 
10-16-2008, 12:37 AM
| | | It would help if we new which version of ZCS you were running  Code: su - zimbra
zmcontrol -v well you could use just a normal filter in the web client and when it matches move it to the Junk folder. Or, you could create a SpamAssassin rule which would match the filename and then assign it a very high score. Or another would be to get Postfix to reject it using MIME header checks. Which do you fancy trying ?
__________________ | 
10-16-2008, 12:51 AM
| | | thank you very much for your replay....:-)
When I perform "zmcontrol -v";It return :
Release 5.0.7_GA_2444.RHEL5_20080626020941 RHEL5 FOSS edition.
For your way ,I think like this :
1、web client : It can only set with or without,and can't set by attachment filename;
2、SpamAssassin : I also test,But result is not very well;
3、Postfix : I set like this :
main.cf:
nested_header_checks = pcre:/etc/postfix/nested_header_checks
$cat /etc/postfix/nested_header_checks
/filename\=\"postcard\.zip\"/ REJECT
But result is also not very well..
My English is so-so..
whether or no thank you very much... | 
10-16-2008, 12:57 AM
| | | For Postfix it would be better to do something like :- Code: vi main.cf
mime_header_checks = regexp:/etc/postfix/mime_header_checks
$ cat /etc/postfix/mime_header_checks
/name=[^>]postcard\.zip / REJECT
Then restart Postfix
__________________ | 
10-16-2008, 01:00 AM
| | |  Thank you very much ,I will try it ,Hope it can be well..
:-) | 
10-16-2008, 01:30 AM
| | | I try it ,But I am very sorry to tell you it doesn't work yet...  | 
10-16-2008, 01:34 AM
| | | When you restart ZCS after making the changes ensure that main.cf is not being overwritten! Does anything get logged to /var/log/zimbra.log ?
__________________ | 
10-16-2008, 01:49 AM
| | | I make the changes in main.cf ,and then "postfix reload";It not being overwritten.
/var/log/zimbra.log:
Oct 16 16:27:37 mail amavis[15733]: (15733-17) Passed CLEAN, [119.147.10.226] [119.147.10.226] <test@qq.com> -> <hehe@domain.com>, Message-ID: <tencent_2B53ABDB2AA534E768E48662@qq.com>, mail_id: XJfZ-zZQkOdJ, Hits: -, size: 814850, queued_as: 6A90027E618, 455 ms
Oct 16 16:27:37 mail postfix/smtp[30134]: 7934C27DE9F: to=<hehe@domain.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=6.3, delays=5.8/0/0/0.46, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 6A90027E618)
Oct 16 16:27:37 mail postfix/qmgr[26601]: 7934C27DE9F: removed
Oct 16 16:27:37 mail postfix/lmtp[1028]: 6A90027E618: to=<hehe@domain.com>, relay=mail.domain.com[10.10.10.234]:7025, delay=0.36, delays=0.04/0/0/0.32, dsn=2.1.5, status=sent (250 2.1.5 OK)
Oct 16 16:27:37 mail postfix/qmgr[26601]: 6A90027E618: removed
Over! | 
10-16-2008, 06:26 PM
| | | Thank you very much ,I am very Happy ,Because when I try agian ,It works very well.
Like this :
vi main.cf
mime_header_checks = regexp:/etc/postfix/mime_header_checks
$ cat /etc/postfix/mime_header_checks
/name=[^>]postcard\.zip/ REJECT
(Not "/name=[^>]postcard\.zip / REJECT";Only a blank problem)
Then restart Postfix
Thank you again..   | 
10-16-2008, 06:32 PM
| | | But Now I have another problem,That if my filename is chinese,How can I do to reject this emails??
Thank you . | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode | | Why Join? Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.  |