Sendmail and ISPmanager

From ISPWiki

Jump to: navigation, search


General information about Sendmail

Sendmail directory:


Main files:

<hostname>.mc (or on Linux) - the main configuration file, where all the changes are specified. is based on that configuration file.

aliases - a list of virtual mailboxes that are expanded to other users. It enables you to redirect your email from a mailbox to a certain user.

virtusertable - maps mail addresses for virtual domains and mailboxes to real mailboxes.



Creating e-mail domains via ISPmanager

The information about an e-mail domain is specified in the /etc/mail/virtusertable file

The file may vary depending on the "Default actions" field. : error:nouser No such user here - error message devnull - ignore and drop - redirect to - redirect to the domain 

The local-host-names file contains a list of domain names Sendmail is to accept as the local host name. This means that this local mailbox will be receiving email there regardless mx records of the domain.

Creating mailboxes via ISPmanager

A virtual user (virtuser_id) will be created while creating a mailbos.

The virtusertable file maps mail addresses for virtual domains and mailboxes to real user mailboxes: virtuser_1005 

In the above example, the virtuser_1005 user maps to the mailbox .

Sendmail stores mailbox passwords in the sasldb database.

The passwords are set by the following command (you can also change the mailbox password by exсecuting this command):

/usr/local/sbin/saslpasswd2 -p -a Sendmail -c -u sales 

The command that is used to set mailbox passwords is specified in the ISPmanager configuration file. It will look like that (the path to sasldb and the db4_dump command may vary depending on your OS):

path db4 db4_dump185 -p /usr/local/etc/sasldb2.db 

The mail alias is specified in the virtusertable file - is the alias for 

Mail redirects are specified in the aliases file. For example, if you enter in the "Send copies to e-mail", aliases will look like this:

virtuser_1005: \virtuser_1005,


In <domain directory>/mail/ is create .vacation.db and .vacation.msg

virtuser associated with the auto-responder should be specified in aliases.

virtuser_1004:  \virtuser_1004,"|vacation -U -f /home/eff/data/email/ -m /home/eff/data/email/ -R  mail"

Calculating mailbox quota

Sendmail uses virtual users. You should specify the owner - virtuser for the mailbox home directory. In the above example, the virtuser_1005 user maps the mailbox, thus the mailbox home directory and all the files/directories that are kept there has the virtuser_1005 owner.

drwxr-x--x 3 virtuser_1005 fly 512 Dec 3 06:13 /home/fly/data/email/ 

The quota is set for the virtuser_1005 user. This is a system user that's why the OS will not allow email messages if the user exceeds his quota.

How to transfer an email domain between user accounts

Transfer the ( email domain from mary to cat

Sendmail uses virtual users (virtuser). In the /etc/mail/virtusertable file locate the virtuser who is the owner of that mailbox.  virtuser_503

In /etc/passwd change the home directory of virtuser_503 from /var/www/mary/data/email/ into /var/www/cat/data/email/


In the dovecot configuration file (/etc/dovecot/dovecot.passwd) change the mailbox's directory.

Transfer the directory to your new user.

mv /var/www/mary/data/email/ /var/www/cat/data/email/

As virtuser_503 is the owner of the home directory, you should only change the group into that of your new user

chgrp -R cat /var/www/cat/data/email/

In the ISPmanager configuration file (/usr/local/ispmgr/etc/ispmgr.conf) locate Domain 500 and specify the UID of your new user.

Restart ISPmanager

killall ispmgr

Restart dovecot

/etc/init.d/dovecot restart


Q: The mailbox stopped functioning upon disabling and enabling.

A: The possible cause of this issue is invalid command for the password damp in the sasldb database in the ISPmanager configuration file.

Q: Email messages are sent to a local email rather than according to the mx records of the domain.

A: Sendmail considers a domain to be local, if:

1. The domain coincides with the server hostname. 2. This email domain is created on the server (the domain is specified in the local-host-names and virtusertable files). 3. The domain coincides with the reverse address of the IP address the email messages is sent from.

Q: Which storage format does sendmail use: maildir or mbox?

A: Sendmail does not support maildir. sendmail can manager maildir through the LDA. You can find the LDA that sendmail is using in the configuration file (if the LDA is not used, email messages are stored in the mbox file). In our example we use procmail: MAILER(procmail)dnl

The format is specified in the procmail configuration file /usr/local/etc/procmailrc (or/etc/procmailrc on Linux).

Was this helpful? Yes | No
Personal tools