Wednesday, April 21, 2010

PostFix on Linux

Pre-Assumptions (Depends on the configurations done at the OS installation)

  • Domain name: localdomain.com
  • Host name: localhost.localdomain.com
  • Firewall is already configured to allow port 25:tcp
  • IPv4
  • local user account: lakmali
1. Install needed software

Install most of the needed software from Fedora Extras using yum:

Open Linux terminal and switch to super user by executing

# –su

# yum install postfix mysql-server spamassassin clamav amavisd-new cyrus-sasl clamav-update sqlgrey

2. Configure and Test PostFix

v Do some basic configuration to setup postfix before first starting it. Find the configuration variables and update them. Edit the /etc/postfix/main.cf configuration file and make the following changes:

#vi /etc/postfix/main.cf

v Do the following changes

mydomain = localdomain.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks_style = host

v Start the server for the first time:

#/sbin/service postfix start

Send a test mail to a local user using telnet: (commands are in bold and responses are in italic)

telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.

220 host.example.com ESMTP Postfix
>
EHLO testdomain.com
250-host.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-ENHANCEDSTATUSCODES
250-8BITMIME
MAIL FROM: 
250 2.1.0 Ok

RCPT TO: 
250 2.1.5 Ok
DATA 
354 End data with .
Subject: Hello Lakmali
hey lakmali,
I just wanted to send some test mail to you :)
.
250 2.0.0 Ok: queued as B95C8110064 
QUIT
3. Check the users mail with the 'mail' command when logged in as the local-user (lakmali):
# mail

For more information visit : postfix-mail-server
Now I am researching on the usage of PostFix mail server to our project.


Posted by: Lakmali

No comments:

Post a Comment