[Postfix] Filter only outbound mail

Posted on 2011-05-01
Last Modified: 2013-11-10
Hi All,

I search one issue for apply a postfix rule.

I would that postfix send to a server with virus scanner all mails before sending to the internet.

My customer make a AUTH connect to the postfix SMTP (port 25) after check if the customer have the right user and pass, the SMTP server would send the mail to another server (mail-filter).

I've play with the "smtpd_sender_restrictions" variable and the value "check_client_access cidr:/etc/postfix/antivirus_sortant".

Into the file I've put " FILTER smtp:[IP.SERVEUR.FILTRAGE]:10024".

The rule work find, all mails are sending to the Filter server, but the problem ... All incoming mail from the network are filter ...
I would just check the mail sending with SMTP login & pass from my customer.

Not the mail receive for example by another smtp server :)

How I can filter only mail coming from a customer ?

Thank all
Question by:omnipcx
    LVL 30

    Expert Comment

    by:Kerem ERSOY

    In fact the idea here is to setup 2 connections one would send the mail directly to internet and be setup at say 20025 and the filtered one in 25.

    LVL 30

    Accepted Solution

    Here's how:

    Plese check the section:

    2. Use two or more IP addresses to only filter incoming messages (bypass filtering for internal clients)


    Author Comment

    Hi KeremE,

    Thank for your reply.
    My problem, I need to use the same ip, because, I move to a new system and it's hard to inform our customer that they need update the profil (ex outlook) with the new server.

    I need realy find a issue for explain to postfix if they have a sasl login, they must give the mail to the mail filter server.

    LVL 19

    Expert Comment

    For the IP address you don;t want scanned, in the file /etc/postfix/antivirus_sortant above the entry...
    eg  dunno
    LVL 19

    Expert Comment

    You could use "permit" instead of "dunno".

    Permit will allow the message to be accepted immediately without looking at any more rules.
    Dunno simply stops any further processing/lookup on this rule. ie this rule returns nothing eg don't know. (not permit, not reject)

    Author Closing Comment

    Partially solution

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Explanation:- SPF = Sender Policy Framework. This is basically a file that can be published with you DNS (Domain Name Service) records, These are the records on the internet that tell everyone else who is. (eg. When an email is se…
    Nearly six years ago I was hired by a company to be their senior server engineer. One of my first projects was to implement Exchange Server 2007 on a Windows Server 2008 Single Copy Cluster for high availability. That was the easy part; read on to l…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    In this video we show how to create an email address policy in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.:  First we need to log into the Exchange Admin Center. Navigate to the Mail Flow…

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now