LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-02-2010, 04:18 PM   #1
edmundasv
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Rep: Reputation: 0
potfix email filter based on sender and recipient to forward messages


Hello,

We have MS Exchange email server with postfix/amavis on FreeBSD as proxy for anti-spam and anti-virus.

We use our own developed CRM and trying to implement such functionality that when CRM manager send email to CRM client or vice versa through email client like Outlook (no plugins for CRM) this message would be shown in CRM.
There is already a solution to parse emails from specific emailbox and show it in CRM.

What I need is to create postfix email filter to check if sender email is in file CRM_managers_emails and recipient email is in file CRM_clients_emails then forward that email to crm@mycompany.com

Filter should check both incoming and outgoing messages.

I will auto generate CRM_managers_emails and CRM_clients_email files containing all such emails taken from CRM database.

I know i should use something like Postfix After-Queue Content Filter but most of examples are for blocking emails.

Thanks
 
Old 11-03-2010, 05:01 AM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
You can set up both sender and recipient restriction lists and have Postfix verify against these lists and reject if they are not on this list. You could then either set up a blanket forward all mail to your exchange server or set up an alias list and have the forwarding done on a per user basis.

This might get you started. The Postfix documentation page contains A LOT of information and the contents directory shows a lot of detail on the categories, so if this isn't quite what you are after, I would suggest you look there.
 
Old 11-03-2010, 03:29 PM   #3
edmundasv
LQ Newbie
 
Registered: Nov 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Noway2 View Post
You can set up both sender and recipient restriction lists and have Postfix verify against these lists and reject if they are not on this list. You could then either set up a blanket forward all mail to your exchange server or set up an alias list and have the forwarding done on a per user basis.

This might get you started. The Postfix documentation page contains A LOT of information and the contents directory shows a lot of detail on the categories, so if this isn't quite what you are after, I would suggest you look there.
Thanks, it's clear how to create lookup tables for manager and clients emails.

But I don't need to reject any emails, only to forward emails that matched sender and recipient email addresses from lookup tables.
 
Old 11-04-2010, 04:23 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Gentoo
Posts: 2,125

Rep: Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781Reputation: 781
I think I am starting to get a better understanding of what you are trying to do. One thing to note for the future, is that, generally, you can apply the same restrictions to senders and recipients, so you can specify which valid recipients in a list and use this as a filter.

In answer to your question, I think you are after what is called virtual transport. There are at least four ways that this can be configured, including using postfix as an incoming relay host for specific users. Here is some documentation on using this (in the manner I think you desire): http://www.postfix.org/VIRTUAL_README.html. Look for Mail forwarding domains, about 3/4 the way down the page.

and here is a link to a previous thread that might be applicable. In this case, the user wanted to set up a virtual transport and use a custom delivery method, which involved modification to master.cf. I don't think you need to go this far, but some of the information may be helpful.

http://www.linuxquestions.org/questi...e-help-831074/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Forward mail based on sender id_viorel Linux - Server 2 08-30-2010 05:28 AM
Evolution: show sender or recipient (like InOut) gypsy_rabbi Linux - Software 0 02-28-2009 07:35 PM
Any email clients which can encrypt and then forward emails based on a rule/filter? curtisa Linux - Software 1 02-01-2009 08:03 AM
Ximian Evolution - forward email filter khermans Linux - Software 1 06-21-2004 01:01 PM
web-based email filter (sendmail) johnpayback Linux - General 0 08-19-2002 06:49 PM

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

All times are GMT -5. The time now is 03:46 PM.

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