Thursday, July 3, 2008

Fedora 9: Quick Sendmail MTA Setup

Long before the decades of email servers begun, a postman's job is highly critical on delivering postal mails, not to consider those old transportation means to travel those postal mails and deliveries across the country and states. Technology is continuously evolving.

Gone were the days on spending almost the whole day configuring a linux server to act as a production email server gateway considering those old time efforts of gathering a widely dispersed and missing library module dependencies for a successful email server source codes compilation. Those days are over.

Now, here's a quick post on how to basically setup your Fedora 9 desktop to simply act as your email server gateway to internet world. If you wish to setup an email server using Sendmail as your MTA, read on.

Fedora 9: Sendmail Server Quick Setup

Basic requirements:

1. Fedora Linux OS

2. Configured and working DNS setting

3. Internet connectivity

Sendmail Installation Steps

Install sendmail rpm package via yum

# yum -y install sendmail

The above command install all required sendmail files. All vital sendmail configuration files are mostly installed to /etc/mail/ .

Starting Sendmail Daemon Service

By default configuration setup, sendmail is being run as root to port 25 of your host's localhost (127.0.0.1) interface. Considering you have a working DNS setup and a routing public IP address facing the internet, you should be able to send emails going to outside world using sendmail MTA from your localhost interface.

However, this type of default setup accepts email connections only from your host's localhost port 25 and does not accept any incoming email connections nor any email relays from outside world and not even from other PCs near your email server box.

I just could not accept the fact why Yahoo mail servers could not accept incoming emails from this type of sendmail default setup, while other servers including GMail accepts incoming emails originally relayed and queued from this type of default sendmail setup. Perhaps, Yahoo concludes that replying from that email would be incomplete and useless then.

Starting Sendmail MTA

# service sendmail start

As long as you have a routing public IP address facing the internet, a working DNS setup with proper hostname configuration, and without any local firewall restrictions, sendmail should start successfully and you should be able to send emails going to outside world.

Normally, if you have a non-routing IP address or you have only localhost as your active interface, your sendmail should just queue up and fail on sending emails to internet world.

Sendmail Service Verification

# telnet localhost 25

A telnet to locahost port 25 should give you current sendmail package version and your email box name like so

220 your.hostname.box ESMTP Sendmail 8.14.2/8.14.2;

* hit Control + ] to quit

Checking Sendmail Process

# ps -ef | grep sendmail

# ps -axuw | grep sendmail

Enable Sendmail Between Reboots

# chkconfig sendmail on

Checking Sendmail Queued Mails

# mailq

Sending Sendmail Test Email

# mail -s "Subject"  username@gmail.com

test

.

Alternatively, to send a test email from CLI

# echo "email body" | mail -s "Test Root Email" root@localhost

Monitoring Sendmail Log Activity

# tailf /var/log/maillog

Sendmail Log Rotation

# vi /etc/logrotate.d/syslog

HTH

0 comments:

Sign up for PayPal and start accepting credit card payments instantly.
ILoveTux - howtos and news | About | Contact | TOS | Policy