Setting Up An Email For Postfix

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

INSTALLING AND CONFIGURING POSTFIX

INSTALLING

1. Creating Some Required Users

We need to create some users for Postfix to work with, as well as some groups. issue
the following commands:

Make a backup of your user and group list files:

cp /etc/passwd /etc/passwd-original
cp /etc/group /etc/group-original

Add a group for Postfix:

groupadd -g 54321 postdrop

Add a user for Postfix:

Double-check before pressing <Enter>. Make sure that you get the CaSe right:

echo "postfix:*:12345:12345:Postfix:/no/where:/no/shell"
>>/etc/passwd

Download Files and Untar

Download/Copy postfix installation file to your local machine

scp 192.168.1.60:/usr/local/src/postfix-2.4.5.tar.gz /usr/local/src

change to the directory where Postfix was downloaded to:

cd /usr/local/src

Now we need to untar it:

tar xzvf postfix-#.#.#.tar.gz

(#.#.# should be replaced with your version number. This is what I’ll use from now
on)

Then change to the directory where Postfix was extracted to:

cd postfix-#.#.#

Install

Then build the program:

make

You’ll see many lines on the screen as the source is compiled.


Now we’ll install Postfix:

make install

Press <Enter> to accept all the defaults when asked.

At this point you can do a very preliminary test, and start/stop postfix:

postfix start

You should see: postfix/postfix-script: starting the Postfix mail system

postfix stop

You should see: postfix/postfix-script: stopping the Postfix mail system


CONFIGURING

The main.cf File

The main.cf file is the actually file that controls how Postfix will treat mail. The
structure of the file is actually quite simple, and the commands’ explanation can be
found on Postfix’s web site. The main.cf file that’s supplied with Postfix includes
some settings and their explanation. We’ll renamed it to something else, and create
a new main.cf from scratch.

Let’s rename the original file, and then edit a brand new one:

cd /etc/postfix
mv main.cf main.cf.original

Now we’ll create a new main.cf:

touch main.cf

Edit the main.cf file with the following configuration parameters

vi main.cf

myhostname = example.sys
mydomain = example.sys
myorigin = $mydomain
mydestination = $mydomain
mynetworks_style = host

Explanation

myhostname This defines the full hostname for your server. Replace
example.sys with your host name. For example: somoe.sys
mydomain Your server’s domain name. Replace example.sys with your
host name. For example: somoe.sys
myorigin The domain name that mail coming from this machine will
appear to come from. You want this set to your domain name.
mydestination this parameter specifies the list of domains that the machine
considers itself. The default of $myhostname and
localhost.$mydomain should do here. Don't specify the virtual
domains that are hosted on the machine here!
mynetworks_style This tells Postfix which IPs can send mail through it. Specify
"mynetworks_style = host" when Postfix should "trust"
only the local machine.
INSTALLING AND CONFIGURING SQUIRRELMAIL

INSTALLING

Install Squirrelmail

Method 1:
rpm –ivh squirelmail-1.4.6-1.noarch.rpm

Method 2: double click on file window style

CONFIGURING

Setup Apache

Set document root to /usr/share/squirrelmail


Set Document to /usr/share/squirrelmail

Setup Squirrelmail

Run Squirrelmail setup script

/usr/share/squirrelmail/config/./conf.pl

Set various configuration parameters important one is the domain found in server
settings section (option 2 on main panel)
INSTALLING AND CONFIGURING DOVECOT

INSTALLING

Install the RPM

rpm –ivh dovecot-1.0-1.2.rc15.el5.i386.rpm

Note: you may have many dependencies, within the directory I have included all
dependencies rpm’s hence install each dependency as required

Hint: a quick way to install will be to install all rpms at once e.g

rpm –ivh file1.rpm file2.rpm file3.rpm file4.rpm file5.rpm

CONFIGURING

Edit dovecot configuration file

Vi /etc/dovecot.conf

Uncomment or add the following lines

Protocols pops pop3s imap imaps

mail_location: mbox:~mail:INBOX=/var/mail/%u

Start dovecot

/etc/init.d/dovecot start

You might also like