Showing posts with label E-mail. Show all posts
Showing posts with label E-mail. Show all posts

Setup and Configure Basic E-mail Server

Follow the instruction to setup and configure basic E-mail Server

1. Start two terminal shells, one as root on desktopX, the other as root on serverX

2. On each machine, confirm that postfix and mutt packages are installed and that the
   postfix service is running.

   # yum install -y postfix mutt
   # service postfix status
 
3. On serverX, add the user elvis. Become elvis and open the mutt MUA to monitor
   incoming mail.
 
   # useradd elvis
   # yum install -y mutt
   # su - elvis
   $ mutt

4. Use the mutt MUA on desktopX to compose and send mail to elvis@serverX.example.com.

   Press m in mutt to compose a new message. Enter elvis@serverX.example.com in the
   To: field. Enter Test as the subject.Enter a few words in the body and save and exit
   (it opened the file in vi). Press y t send to mail.

5. Did elvis receive e-mail on serverX? check it

6. On desktopX use mailq to examine the delivery queue.Also browse /ver/log/maillog to
   look for any problems.

   # mailq
   # tail /var/log/maillog

7. On serverX, recall that postfix binds to localhost only be default according to Red Hat
   policy. Use netstat to confirm this is the case.

   # netstat -tuln | grep :25

8. Examine the current settings of the inet_interfaces directive in the main postfix
   configuration file /etc/postfix/main.cf

   # grep inet_interfaces /etc/postfix/main.cf

9. Edit /etc/postfix/main.cf. Find the line that has inet_interfaces = localhost and
   change it to inte_interfaces = all. Restart the postfix service and confirm the
   deamon is listening on all interface.

   # service postfix restart
   # netstat -tuln | grep :25

10.ON desktopX use postfix flush to manually flush the pending delivery queue.Confirm
   that the queue is now empty and that the mail was successfully delivered.
 
   # postfix flush
   # mailq
   # tail /var/log/maillog

11.On serverX use the mutt MUA to confirm e-mail delivery. Also examine /var/log/maillog
   for evidence the mail was successfully delivered.
 
   # mutt
   # tail /var/log/maillog

-- Happy E-mailing

Related topic:
                      Basic E-mail Delivery
                      Key e-mail delivery concepts
                      The postfix MTA
                      

The postfix MTA

A number of open source e-mail servers exits, including Postfix, Sendmail, and Exim. In this unit, we will focus on Postfix, a powerful but relatively easy to configure MTA, which happens to be used by default in Red Hat Enterprise Linux 6.

Remember that Sendmail was the default MAT in Red Hat Enterprise Linux 5 and earlier.

Postfix is provided by the postfix RPM package, and is controlled by the postfix service script. It is a modular program made up of several cooperating programs, its components controlled by the master process.
The main configuration file for postfix is /etc/postfix/main.cf which may be edited using a text editor or with the postconf command. The postconf command may also be used to determine current and default configuration setting, either for all of Postfix or on an option-by-option basis.

By default, postfix only listen for incoming e-mail from localhost. To reconfigures Postfix to receive mail for local delivery sent from remote hosts, inet_interfaces = all must be set in /etc/postfix/main.cf.


When troubleshooting e-mail, a log of all mail-related operations is kept in /var/log/maillog, which includes information about rejections and successful deliveries. The mailq command (or postqueue –p) displays a list of any outgoing mail messages that have been queued. To attempt to deliver all queued message again immediately, you can run the postfix flush command (or postqueue –f); otherwise Postfix will attempt to resend them about once an hour until they are accepted or expire.

Related Topic

Key e-mail delivery concepts

Relaying: When an e-mail server (MTA) forwards submitted mail to another server for delivery

Queueing:  a filed delivery or relay attempt is queued and retried periodically by the MTA(By default Postfix does this once every hour.)


Rejected: when an e-mail message is refused by an e-mail server during the initial submission

Bounced: when an e-mail message is returned by a remote server to the originating e-mail server and/or user after it has been accepted for delivery by the remote server



Related Topic:
                         Basic e-mail Delivery concepts
                         The Postfix MTA

Basic E-mail Delivery

MTA:   “Mail Transfer Agent”. MTAs relay mail from point to point until it can be delivered. E-mail is submitted by other server using the SMTP protocol to TCP port 25, or by local clients with the /usr/bin/sendmail program. If the MTA is the final destination, the message is passed to the MDA. If not, it looks up the next MTA in DNS using MX records and relays it there using SMTP.

MDA: “Mail Delivery Agent”. The MDA delivers mail to the recipient’s local message store(by default /var/spool/mail/user). Postfix provides its own MDA to deliver to the default local file-based message store, /usr/libexec/postfix/local.

MUA: “Mail User Agent”. Clients used to send e-mail and read e-mail in the user’s message store.


Related Post:
                   Key e-mail delivery concepts
                        The Postfix MTA