Learn more about Qmail's working principle and configuration file (1)

Source: Internet
Author: User
Tags qmail

In this article, we mainly introduceQmailAnd Configuration File Settings. In this section, let's

Better Analysis of Problems and facility qmail. To help you better understand and integrate Qmail

1. What is qmail?

The qmail package is a mail program on unix systems. The qmail program was developed by dan bernstein.

Provides the mail transfer agent (mta) function for standard unix servers to replace sendmail. Qmail Internet home http://www.qmail.org.

2. qmail and Related Services

Qmail provides the mta function, but other protocols and software are required for customers to see their own letters. Two Types

Common mechanisms for remote users to retrieve their messages are post office protocols (pop3) and interactive mail access protocols (imap ).

Summary:

The qmail system includes several executable programs, configuration files, qmail tools, and environment variables, which affect each other and jointly provide mail services.

3 qmail delivery process

The qmail system has nine core programs. Here is a brief introduction. Qmail-smtpd is responsible for receiving mail messages from remote hosts and sending them to qmail-queue for processing. The qmail-inject program is used to receive locally generated mail messages and send them to the qmail-queue program. The qmai-queue program processes the emails they send and transfers them to the mail queue for sending. Once a message is successfully placed in the mail queue, the qmail-send program is called to process it. Qmail-send checks the status of each message in the mail queue. The message that failed the previous mail request is identified and determines whether it is a temporary failure or permanent message. If it fails, it will be delivered again, A permanent failure will be delivered to the qmail-clean program and deleted. That is to say, qmail-clean is used to clear permanently failed mail messages.

Qmail-send calls the qmail-lspawn and qmail-rspawn programs. Qmail-send determines who the mail is sent to. If it is sent to a local computer, it is handed over to the qmail-lspawn program and then sent to the local mail server by qmail-local. If it is determined to be a remote host, the qmail-rspawn program is called. qmail-rspawn determines the target email server for each recipient of the mail message, and then calls the qmail-remote program to send the message.

2.2qmail Process

Qmail-send

Splogger qmail

Qmail-lspawn

Qmaiil-rspawn

Qmail-clean

Qmail requires five programs to run in the background at any time. These core programs allow qmail to scan new emails and send them to appropriate destinations.

4 qmail Utility

In addition to the preceding five qmail processes, the process and local users also use several other qmail utilities to process and transmit messages. As follows:

Bouncesaying allows the user to bounce back information when the message is forwarded to the program or the program is unavailable.

Condredirect allows the user to forward messages to the program and then forward the messages to another address.

Callback T is used to modify exit encoding of a calling program.

Forward forwards messages to a backup email address.

Maildir2mbox converts a message in a maildir-format mailbox to a standard sendmail mailbox.

Maildirwatch generates a mailbox in maildir format

Maildirwatch monitors a user's mail directory and reports all new messages.

Preline pre-processes the messages before forwarding them to relevant programs.

Qbiff: when a new message arrives, write a notification to the user terminal display.

Qmail-clean permanently removes unarrived messages from the qmail Message Queue

Qmail-inject inserts new messages into qmail mail queue

Qmail-local delivers messages to users on the local Mail System

Qmail-lspawn is called by qmail-send to forward messages to the qmail-local program.

Qmail-newmrh is used to create a qmail database from the morercpthosts File

Qmail-newn creates a qmail user file from an ASCII file table containing the System user name and email name

Qmail-pop3d accepts pop3 connections to allow users to read their mailboxes

Qmail-popup is used to verify the user ID and password in the pop3 connection

The qmail-pw2u converts the user ID and password of a UNIX system into a table structure that can be used by qmail-newn

Qmail-qmtpd accepts qmtp connection requests from remote hosts

Qmail-qread generates a report that displays messages in the current qmail mail queue.

Qmail-qstat generates a report to display the number of messages waiting for sending in the qmail delivery status.

Qmail-queue queues mail messages for delivery

Qmail-remote sends messages to remote mail users

Qmail-rspawn is called by qmail-send to forward messages to qmail-remote.

Qmail-send

Qmail-showctl displays the current qmail System Configuration

Qmail-smtpd receives smtp connection requests from remote hosts

Qmail-start initialize the qmail Startup Script

Qmail-tcpok is used to clear the tcp timeout record table used in qmail-remote.

Qmail-tcpto displays the current tcp timeout record table

Qreceipt is used to respond to messages that require confirmation

Sendmail is used to copy the functions of the sendmail program to the mta program.

Splogger inserts messages into the system login program

Tcp-env converts network connection information into unix environment variables

Each qmail utility plays a different role in correct processing and delivery of mail messages. Some of them can only be called by the qmail kernel program. Others can be used by the qmail system administrator to process messages and obtain statistics. Some other users can work out their own mail message processing by a single common Mail User.

5. qmail Environment Variables

In addition to control files, qmail programs can also use unix environment variables to control their actions. The value of most control files can be overloaded by a set environment variable. If the environment variable is not set, use the value of the control file. The environment variable of qmail is set before the qmail program runs. This is done by a package. Common examples are tcpwrapper and tcpserver. This document uses the tcpserver. In the subsequent content of "(4) ucspi-tcp principles and settings", we will discuss it in detail.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.