image\howbutt.gifUsing the qmail configuration files

You can configure or reconfigure the qmail configuration files to change the attributes of the mail server. By default, all the qmail configuration files are located in the /var/qmail/control directory. The configuration files do not have file extensions. You must not add a file extension to the configuration files because the mail server will not recognize the configuration files if you do.

The most important configuration file is the me configuration file. The mail server can function with just the me configuration file; however, the mail server will not run if the me configuration is not properly set. The type of mail server is based on the values of the configuration files. For example, you can configure the mail server to be an open relay mail server by configuring the rcpthosts configuration file. For information about relaying, see "Using the mail server as a relay mail server."

The more important configuration files are discussed in the following section. You can use a text editor to edit the configuration files.

image\nicon.gif Notes

badmailfrom

The badmailfrom configuration file lets you specify an email address that the mail server does not accept email messages from. For example, a mail client with an email address that appears in the badmailfrom configuration file cannot send email messages to your mail server. In the following example, two email addresses are added to the badmailfrom configuration file.

ChrisY@mydomain.com

TimG@netdomain.net

bouncefrom

If an email message cannot reach its final destination, the email is returned to its source. This is known as bounced email. For example, if an email message is send to TimG@netdomain.net, but the user no longer exists, the email is sent back to its source. The bouncefrom configuration file lets you specify an email address that is used to receive bounced email. It is recommended that you set up a user account specifically for this feature. For example, you can set up a user account called mailadmin. In the following example, mailadmin is set.

mailadmin@mydomain.com

The following email message is an example of a bounced email:

The following email message is an example of a bounced email:

Delivered-To: leop@netdomain.net

Received: (qmail 5458 invoked by alias); 7 Oct 1999 11:25:57 -0000

Delivered-To: mailadmin@netdomain.net

Received: (qmail 5455 invoked for bounce); 7 Oct 1999 11:25:57 -0000

Date: 7 Oct 1999 11:25:57 -0000

From: MAILER-DAEMON@netdomain.net

To: mailadmin@netdomain.net

Subject: failure notice

Hi. This is the qmail-send program at leop_doc1.corel.lnx.

I tried to deliver a message to this address, but the mail bounced!

<TimG@netdomain.net>:

Sorry, no mailbox here by that name.

bouncehost

The bouncehost configuration file lets you specify the domain name of the computer that the mail server is located on. If the domain name of the computer is mydomain.com, then the value of bouncehost is mydomain.com.

concurrencylocal

The concurrencylocal configuration file lets you specify the number of local deliveries that the mail server can send at the same time. Local deliveries occur when the mail server delivers email messages to a local user. The default value for the concurrencylocal configuration file is 20. The maximum value is 120. If you set this value to 0, the mail server suspends local deliveries. In the following example, the number of local deliveries that can be sent at the same time is set to 20.

20

concurrencyremote

The concurrencyremote configuration file lets you specify the number of remote deliveries that the mail server can send at the same time. Remote deliveries occur when the mail server delivers email messages to a remote user. A remote user is a user on another mail server. The default value for the concurrencyremote configuration file is 20. The maximum value is 120. If you set this value to 0, the mail server suspends remote delivers. In the following example, the number of remote deliveries that can be sent at once is set to 25.

25

defaultdomain

The defaultdomain configuration file lets you specify the default domain name of the computer that the mail server is located on.

defaulthost

The defaulthost configuration file lets you specify the default user name that the mail server uses. If an email message is sent to the mail server without a user name, the mail server will send the email message to the user who is specified in this file. In the following example, the default user name is set to Frankj.

Frankj

databytes

The databytes configuration file lets you specify the maximum size, in bytes, of an email message. If an email message exceeds this value, the mail server will not send it. The default is 0, meaning there is no size limit. It is recommended that you keep the default value because having a size limit reduces the flexibility of the mail server.

envnoathost

The envnoathost configuration file lets you specify a domain name that the mail server uses when the @ symbol does not appear in the email address. A complete email address consists a user name and a domain name, for example: ChrisY@mydomain.com. If you set the envnoathost configuration file to mydomain.com, and the mail server receives an email addressed to ChrisY, the mail server will send the email message to ChrisY@mydomain.com. In the following example, the envnoathost configuration file is set to mydomain.com.

mydomain.com

helohost

The helohost configuration file lets you specify the host name used in SMTP HELO command. For information about the HELO command, see "Using electronic mail protocols." The default is the domain name of the computer.

locals

The locals configuration file lets you add local domain names to the mail server. The default value for this configuration file is the domain name of the computer that the mail server is located on. Every domain name that appears in the locals configuration file is local to the mail server. The mail server will send email messages to local domains without having to send the email to another mail server. In the following example, the two domain names, mydomain.com and domain.net are set.

mydomain.com

domain.net

If these two domains are the only local domains on the mail server, then email messages sent to another domain are considered remote email. The mail server must be configured as a relay server to successfully deliver remote email. For information about configuring the email server as a relay mail server, see "Using the mail server as a relay mail server."

me

The me configuration file lets you specify the domain name of the computer that the mail server is located on. The mail server will not run if the me configuration file is not set properly. In the following example, the me configuration file is set to mydomain.

mydomain

image\nicon.gif Note

queuelifetime

The queuelifetime configuration file lets you specify the amount of time, in seconds, that an email message can exist in the mail server's queue. A queue is a storage area that is used by the mail server to store email. After the time expires, the mail server attempts to deliver the email message once more, after which the email message is bounced back to the source. For information about bounced email, see the bouncefrom description located earlier in this overview. The default value is 604800 seconds, which is one week.

rcpthosts

The rcpthosts configuration file lets you specify the remote domain names for which the mail sever will accept email messages. For example, the domain names set in the locals configuration file are all the local domain names. The domain names that are set in the rcpthosts configuration file are not local domain names, but the mail server will accept and deliver email messages to them. If you set the domain name myotherdomain.com in this configuration file, the mail server will accept and deliver email messages for a user on this domain. In the following example, the domain name myotherdomain is set.

myotherdomain.com

If you want to allow the mail server to accept all domain names, then delete the rcpthosts configuration file. For information about configuring the mail server as a relay mail server, see "Using the mail server as a relay mail server."

smtpgreeting

The smtpgreeting configuration file lets you specify the greeting message that the mail server sends to the SMTP client upon connection.

timeoutconnect

The timeoutconnect configuration file lets you specify the amount of time, in seconds, that the mail server waits for a connection to a remote mail server. The default value is 60 seconds.

timeoutremote

The timeoutremote configuration file lets you specify the amount of time, in seconds, that the mail server waits for a response from a remote mail server. The default value is 1200 seconds.

virtualdomains

The virtualdomains configuration file lets you specify a virtual domain name and user. The syntax of a virtual domain name and user is user@domian:prepend. If the mail server receives an email message for user@domain, the mail server changes the email address to prepend-user@domain and treats the email message as a local email. Assume the following value is the virtualdomains configuration file:

user@domain:frankj

If an email message arrives for user@domain, the mail server changes the email address to frankj@domain and treats the message as local. The mail server checks the virtualdomains configuration file after the locals configuration file. If the domain name appears in both the locals configuration file and the virtualdomains configuration file, the mail server will disregard the virtualdomains configuration file.