Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
We have an email server running Dovecot and Postfix. I recieve a lot of spam email containing wierd chinese/japanese or other asian characters. We don't need these emails in our organization and we do not communicate with people using asian characters. How can we instruct Postfix to block out all emails containing asian characters ?
We already use "body_checks" to discard email containing some regex strings... but how can we do it for asian characters ?
Code:
Server [/etc/postfix] # cat body_checks
/free mortgage quote/ DISCARD
/repair your credit/ DISCARD
/From:.*<>/ DISCARD
Server [/etc/postfix] # cat main.cf |grep body
body_checks = pcre:/etc/postfix/body_checks
Server [/etc/postfix] #
Put a content check in place to scan for the desired character sets, either in the header/subject/content-type. And which asian characters? More than one set, since that encompasses Japanese, Chinese, and Korean. You've already got rules in place, so adding one more shouldn't be a problem, especially since you've been working with postfix for a while now.
Also, I have discovered that some emails are encoded in Base64. This, effectively, bypasses the checks. How can I check for base64 encoded strings of asian characters ?
Also, I have discovered that some emails are encoded in Base64. This, effectively, bypasses the checks. How can I check for base64 encoded strings of asian characters ?
...which is the same thing you asked in your other thread, and don't acknowledge. Again, read the postfix docs..you can use body_check for such things, or use amavis/spamassassin.
1. The Postfix documentation is so hard to understand, I need a practical solution - I thought there is a quick fix since I believe I'm not the only one experiencing problems with asian characters... OK, i'll read the docs... I was hoping for a quick fix...
2. If you look closely to my reply on Ubuntu Forums, I have specifically written the fact that a specific line from the given solution does not work...
3. Regarding decoding of base64, I didn't find anything...
1. The Postfix documentation is so hard to understand, I need a practical solution - I thought there is a quick fix since I believe I'm not the only one experiencing problems with asian characters... OK, i'll read the docs... I was hoping for a quick fix...
2. If you look closely to my reply on Ubuntu Forums, I have specifically written the fact that a specific line from the given solution does not work...
3. Regarding decoding of base64, I didn't find anything...
So:
You're essentially asking others to read the docs and only pull out the pieces you need, rather than you doing it. If you use the search terms given you to, you'll find examples; start there.
If you look closely, saying "does not work" isn't much of a problem description. Further, if you put MORE character sets in, as opposed to just the ones in the example, then it'll filter more, wouldn't it??
You were handed a search term, and a link to the docs specifically related to content inspection. You were given names of programs that DO THIS.
With all due respect, it seems that the Forum is not much help for "read read read".
I came to the forums seeking a proven solution, in case anyone already dealt with this issue.
I do not ask others to read for me ! This is called misjudging. I learned to read when I was 4 :-)
The ideea was to obtain a quick fix IF someone else already encountered the problem - I assume that is also the role of a Forum - to ask quick help, if available :-)
I assume anyone can read :-)
OK, back to reading manuals. Thank you.
With all due respect, it seems that the Forum is not much help for "read read read". I came to the forums seeking a proven solution, in case anyone already dealt with this issue. I do not ask others to read for me ! This is called misjudging. I learned to read when I was 4 :-) The ideea was to obtain a quick fix IF someone else already encountered the problem - I assume that is also the role of a Forum - to ask quick help, if available :-) I assume anyone can read :-)
OK, back to reading manuals. Thank you.
And with all due respect, the forum is here if you're needing HELP...not wanting to read the instructions/claim they're 'hard to understand', etc., and wanting someone else to read them for you doesn't fall within that realm.
You were given a filter on your other thread, in another forum...all you've said is it "doesn't work". Nothing about WHAT isn't working/how/why, or what you've actually tried to MAKE IT WORK. Again, if it's not filtering everything, then expand the character sets. This is all information you can look up for yourself, and (since you don't actually give us details about what's not working), that's all we can tell you isn't it??? Should we guess as to what it's not doing??
You asked about content filtering; again, that's covered in the postfix docs...can you show us what YOU have done to try to accomplish this?? Have you looked at the things you were given/had looked up for you regarding amavis/spamassassin, to do exactly what you're after???
Forums are here to help people help themselves. This is like asking someone to help you paint your house, only for you to sit in a chair and watch them...that's not help...that's having it done for you.
I have tried - with no result. I always try to solve my problems before posting in the forums. Usually, the forums are the last place to try to ask help, and after all other attempts failed.
The problem is simple: I want to filter asian characters.
Here is my header_checks file:
Code:
/free mortgage quote/ DISCARD
/repair your credit/ DISCARD
The filtering works great if I test any asian character from the list in the body_checks file.
The problem is that I receive emails which ENCODE with Base64 (the Email client displays the asian character but the Message Source is Encoded in Base64).
For example: 連 in Base64 is "6YCj"
And my message source is full of Base64 encoded text.
I have tried - with no result. I always try to solve my problems before posting in the forums. Usually, the forums are the last place to try to ask help, and after all other attempts failed.
...and if you don't actually show us what you've done/tried, how exactly do you expect us to know???
Quote:
The problem is simple: I want to filter asian characters. Here is my header_checks file:
Code:
/free mortgage quote/ DISCARD
/repair your credit/ DISCARD
The filtering works great if I test any asian character from the list in the body_checks file.
Great...so the asian character filtering DOES work, which isn't what you indicated previously.
Quote:
The problem is that I receive emails which ENCODE with Base64 (the Email client displays the asian character but the Message Source is Encoded in Base64). For example: 連 in Base64 is "6YCj" And my message source is full of Base64 encoded text. I have also tried these:
postmap: warning: header_checks, line 5: unbalanced '"' in '/^Content-Type:.*\bcharset="?(?:GB2312|big5)\b/ DISCARD' -- ignoring this line
...meaning that you have a syntax/mismatch in that file...meaning you need to go fix it. It's not only telling you what the problem is, but what line it's on. Hard to be more clear than that...have you actually LOOKED at the file? The error is very clear in what you posted.
Quote:
Also, if I leave these in header_checks, it still doesn't filter the base64-encoded characters...
Right, which takes us back to "use one of the tools that were given to you before". AGAIN: amavis/spamassassin do these things, and you've been using spamassassin for a while now. Implement the content filter there, or AGAIN, read the documentation on content inspection.
I've corrected that syntax problem, however, it still doesn't filters asian chars. I will try with SpamAssassin.
Great how you followed up after having it pointed out to you. Also, you said before it *DID* filter asian characters (post #11, where you said it did), and that you were needed ADDITIONAL filtering, which postfix doesn't do.
Again: you have been using spamassassin for years, which does attachment filtering/inspection...you were given a link to another program as well.
Thank you for pointing it out.
I mean it filters asian chars if the email is plain email.
If the content is Base64 encoded and the email client decodes the Base64 content, then the filtering has no effect.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.