LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-23-2009, 11:12 PM   #1
fredlim
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
Question Postfix content filtering


Hi I am trying to setup Postfix build-in content inspection, but I am a beginner in regular expression and have trouble.

What I need to do is to check if the sender send an email with attachment, he should Cc to his boss.

main.cf:
header_checks = pcre:/etc/postfix/mime_header_checks
mime_header_checks = pcre:/etc/postfix/mime_header_checks

mime_header_checks:
/^From: my@abc.com|^Cc: [^boss@abc.com]|name=[^>]*\./ REJECT Please Cc to your supervisor.


But I can't get the desire result,
my@abc.com can send message without attachment;
my@abc.com will got reject if he send a attachment email if he does not Cc to boss@abc.com; but
my@abc.com still not able to send the email if he Cc to boss@abc.com


Any help would be appreciate.

Thanks.

Fred
 
Old 04-24-2009, 06:29 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I don't think that's possible. But, you can just use sender_bcc_maps or always_bcc.
 
Old 04-25-2009, 05:42 AM   #3
fredlim
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Should I use after queue filtering? I read the Postfix document it seems require to use a shell script to check the content, or use a smtpd proxy? I am still not figure out the setup yet.

Thanks.
 
Old 04-25-2009, 09:52 AM   #4
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
I think the simplest solution is to use one of the bcc maps in main.cf. For example, this will send boss a copy of all email sent by suspiciousguy. In main.cf:
Code:
sender_bcc_maps = hash:/etc/postfix/sender_bcc
In sender_bcc:
Code:
suspiciousguy@example.com    boss@example.com
Notes:
1. This assumes you trust envelope addresses.
2. Depending on the delivery agent, you might be able to sort/keep only the kind of mail that boss needs to see. The effect would be to bcc only certain kinds of mail sent by certain people.
 
Old 04-25-2009, 11:50 PM   #5
fredlim
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Berhanie View Post
I think the simplest solution is to use one of the bcc maps in main.cf. For example, this will send boss a copy of all email sent by suspiciousguy. In main.cf:
Code:
sender_bcc_maps = hash:/etc/postfix/sender_bcc
In sender_bcc:
Code:
suspiciousguy@example.com    boss@example.com
Notes:
1. This assumes you trust envelope addresses.
2. Depending on the delivery agent, you might be able to sort/keep only the kind of mail that boss needs to see. The effect would be to bcc only certain kinds of mail sent by certain people.
The hard thing is the sender should initiate Cc but not automatically, and different sender has different boss. It seems after-queue filter could use the shell script to inspect the header and body, it is right? But I am not familiar in shell script, I just curious the possiblity to use another language like Python to inspect the MIME header and body.

Thanks.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Content Filtering without a Proxy mikes63737 Linux - Networking 8 05-24-2016 03:25 PM
What is 'content filtering'? rsean LQ Articles Discussion 1 07-26-2007 11:44 PM
Content Filtering metallica1973 Linux - Security 6 12-29-2006 08:28 PM
Privoxy content filtering gabsik Linux - Networking 3 04-13-2006 12:33 AM
Content filtering for Postfix 2.0.x How to block attachments? dtournas Linux - Security 3 01-07-2006 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration