Thursday, 14 May 2015

Configure Postfix as a Gateway for Exchange

In this tutorial, we will configure Postfix as a Mail Gateway for a backend Exchange Server or any other back-end mail server. This configuration provides several advantages such as blocking unwanted traffic, virus-scanning ,spam prevention, reduce load on back-end. 

We will configure a Mail Gateway on 'meru.mycompany.com', so that it relays mail for the domain 'mycompany.com' to a mail server on the internal network 'server1.mycompany.com'


1) Edit the file '/etc/postfix/main.cf'. Make the following changes

    myhostname = meru.mycompany.com
    mydomain = mycompany.com


    #the default domain name to append if @domain is missing
    myorigin = $mydomain

    # the network interface addresses on which to receive incoming mail.
    inet_interfaces = all
    # remember to comment this line
    #inet_interfaces = localhost

    #this machine is not the final destination for any domain
    mydestination = 

   #turn off local recipient checking
   local_recipient_maps =



    #Trusted SMTP clients - can relay mail through this server.  
   mynetworks = 192.168.122.0/24, 127.0.0.0/8

    # Relay mail for the domains listed below
    relay_domains = mycompany.com

    # Accept mail only for relay users listed in relay_recipients file
    relay_recipient_maps = hash:/etc/postfix/relay_recipients

    # Where to relay mail
    transport_maps = hash:/etc/postfix/transport


2) Create the file  '/etc/postfix/relay_recipients' containing the list of mail recipients for the domain 'mycompany.com'
shabbir@mycompany.com    x
ali@mycompany.com            x
batul@mycompany.com        x


3) Recreate the relay map
[root@meru ~]# postmap /etc/postfix/relay_recipients

4) Edit the file '/etc/postfix/transport' and add the name of the back-end mail server to which to relay mail for the domain 'mycompany.com'.
mycompany.com  smtp:[server1.mycompany.com]

5) Recreate the transport map.
[root@meru ~]# postmap /etc/postfix/transport

6) To view the parameters changed run the following command.
     postconf -n

7) To check for systax errors, run the following command.
     postfix check

8) Open firewall port 25/TCP.
    firewall-cmd --zone=public --add-service=smtp --permanent
    firewall-cmd --reload

9) Restart postfix service
    systemctl restart postfix


1 comment:

  1. SSN FULLZ AVAILABLE

    Fresh & valid spammed USA SSN+Dob Leads with DL available in bulk.

    >>1$ each SSN+DOB
    >>3$ each with SSN+DOB+DL
    >>5$ each for premium fullz (700+ credit score with replacement guarantee)

    Prices are negotiable in bulk order
    Serious buyer contact me no time wasters please
    Bulk order will be preferable

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    OTHER STUFF YOU CAN GET

    SSN+DOB Fullz
    CC's with CVV's (vbv & non-vbv)
    USA Photo ID'S (Front & back)

    All type of tutorials available
    (Carding, spamming, hacking, scam page, Cash outs, dumps cash outs)

    SMTP Linux Root
    DUMPS with pins track 1 and 2
    WU & Bank transfers
    Socks, rdp's, vpn
    Php mailer
    Sql injector
    Bitcoin cracker
    Server I.P's
    HQ Emails with passwords
    All types of tools & tutorials.. & much more

    Looking for long term business
    For trust full vendor, feel free to contact

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    ReplyDelete