Tuesday 21 April 2015

Postfix Server for a domain in RHEL7/CentOS7

In this tutorial, we will configure an email server (gateway) for a domain 'mycompany.com'. This central email gateway will receive all mail for the domain. And also, send all mail originating from the internal network. In other words, it will act as a single entry/exit point for all incoming and outgoing mail.

Client machines in the network will relay outgoing mail through the mail gateway. And client machines can read incoming mail from the mail gateway by using POP or IMAP. 

NOTE:
- Ensure that DNS Server is configured for the network.
- Ensure MX record entry for the domain is made in the DNS Server zone file.
- Ensure reverse dns entry for the mail server is made in the DNS Server zone file. (Not necessary for this tutorial)
- To check for errors, view the log file '/var/log/maillog'

This tutorial is based on the following configuration:
- Domain Name: mycompany.com
- Email Gateway Name: meru.mycompany.com
- Email Gateway IP address: 192.168.122.1
- Network served by the mail gateway: 192.168.122.0/24

Postfix Incoming/Outgoing Server (Gateway) Configuration: This server will receive incoming mail for the domain. And relay outgoing mail from client machines.

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

    #the domains for which this machine is the final destination.
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain


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

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

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

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

5) Restart postfix service
    systemctl restart postfix


Postfix Client Configuration(Submission-only mode): These machines will not receive mail over the network. And will relay outgoing mail through the Postfix Server configured above.

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 = $myhostname

    # the network interface addresses on which to receive incoming mail.
    inet_interfaces = localhost


    #the domains for which this machine is the final destination.
    mydestination = localhost

    #the mail gateway to send mail to.(The server configured above)
     relayhost = [192.168.122.1]     

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

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

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

5) Restart postfix service
    systemctl restart postfix

2 comments:

  1. Problems with dovecot are not easy to fix. See here for mark email threads

    ReplyDelete
  2. 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)

    SQL Injector
    Premium Accounts (Netflix, Pornhub, etc)
    Paypal Logins
    Bitcoin Cracker
    SMTP Linux Root
    DUMPS with pins track 1 and 2
    WU & Bank transfers
    Socks, rdp's, vpn
    Php mailer
    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