Understanding Mail Server Configuration

(version 2.3.2)


Related Docs:   Introduction To H-Sphere Mail (v. 2.4 and up)


Installed Software

H-Sphere mail system consists of several popular mail packages, and patches to them:

  • hsphere-qmail-1.03 - message transfer utility on the modified sendmail protocol.
  • hsphere-vpopmail-5.2.2 - virtual mail utility on the POP protocol.
  • hsphere-ucspi-0.88 - tcp server and related utilities
  • hsphere-ezmlm-0.53 - mailing list manager.

* H-Sphere 2.3.2 uses hsphere-mail-all-7, which is an update of hsphere-mail-all-6. The new featuresinclude the following qmail addons:

- Andre Oppermann's ext-todo patch, which solves the 'silly qmail syndrome'. That's where qmail spends more time processing incoming email than scheduling deliveries.
- big-DNS patch, which fixes oversize DNS packet problem.
- Modified version of Qmail chkuser 0.6 patch that checks if the vpopmail recipient is valid before accepting the message.

H-Sphere mail system also includes the following packages to provide webmail functionality:

  • hsphere-sqwebmail-3.3.7
  • imp-3.1
  • Apache web server v.1.3.29


Location Of Files


Qmail directory is /var/qmail; /hsphere/local/var/qmail/ is its symlink.

/hsphere/local/var/qmail/bin - binary executable files
/hsphere/local/var/qmail/boot - different variants of startup files (not recommended to change!)
/hsphere/local/var/qmail/configure - binary files used for installation and configuration
/hsphere/local/var/qmail/control - configuration files
/hsphere/local/var/qmail/man - manuals for qmail
/hsphere/local/var/qmail/queue - the sequence for letters to be placed before delivery
/hsphere/local/var/qmail/users - plain-text and db3 databases with all mail clients


Vpopmail directory is /hsphere/local/var/vpopmail. It is home directory for the vpopmail user (type finger vpopmail for details).

/hsphere/local/var/vpopmail/bin - binary executable files
/hsphere/local/var/vpopmail/doc - documentation
/hsphere/local/var/vpopmail/domains - directory comprising all mail domains registered in the system, their POP boxes, etc.
/hsphere/local/var/vpopmail/etc - files with TCP environments required for POP3 server operation
/hsphere/local/var/vpopmail/include - system service files
/hsphere/local/var/vpopmail/lib - libraries of the program
/hsphere/local/var/vpopmail/users - not used in H--Sphere

Qmail + Vpopmail configuration files:

/hsphere/local/var/qmail/control/rcpthosts - the list of the first fifty local virtual mail domains
/hsphere/local/var/qmail/control/morercpthosts - The list of the rest local virtual mail domains
/hsphere/local/var/qmail/control/morercpthosts.cdb - db3 database file for the rest virtual mail domains
/hsphere/local/var/qmail/users/assign - plain-text databases with all pathes to all virtual mail domains
/hsphere/local/var/qmail/users/assign.cdb - db3 database with all pathes to all virtual mail domains


Mail Traffic Calculation

Each day cron runs the /hsphere/scripts/cron/mail_anlz.pl script that analyzes mail traffic in the /var/log/maillog Qmail log file and collects mail statistics into specially formatted log files in the H-Sphere statistics directory (/hsphere/local/var/statistic).

These dd.mm.YYYY.qml.txt log files, where dd.mm.YYYY is the log date timestamp, contain lines of the following format:


where name is the domain name, xFer is the total traffic in kilobytes.

Then, H-Sphere TrafficLoader utility is launched by cron to collect mail traffic from the statistics directory and to store it into the system database. TrafficLoader also calls the /hsphere/shared/scripts/xfer_cat.pl script to move the already loaded mail statistics files to the /hsphere/local/var/statistic/loaded directory as dd.mm.YYYY.qml.txt.gz archives.


Qmail Startup Script

Qmail daemon startup script is located:
Linux: /etc/init.d/qmaild
FreeBSD: /usr/local/etc/rc.d/qmaild.sh

Read how to restart qmaild.

tcpserver parameters

USER_QMAILD=`id -u qmaild`
GROUP_QMAIL=`cat /etc/group|grep "^nofiles"|sed 's/^.*:.*:\(.*\):.*/\1/'`
MAIL_SERVER=`head -1 /hsphere/local/var/qmail/control/locals`

POP3 server startup

/hsphere/shared/bin/tcpserver -H -R -c ${TCP_SERVERS} 0 pop-3 \
/hsphere/local/var/qmail/bin/qmail-popup ${MAIL_SERVER} \
/hsphere/local/var/vpopmail/bin/vchkpw \
/hsphere/local/var/qmail/bin/qmail-pop3d Maildir &

SMTP server startup

a) with POP before SMTP authentification:

/hsphere/shared/bin/tcpserver -H -R -c ${TCP_SERVERS} -x \
/hsphere/local/var/vpopmail/etc/tcp.smtp.cdb -u ${USER_QMAILD} -g \
${GROUP_QMAIL} 0 smtp /hsphere/local/var/qmail/bin/qmail-smtpd | \
/hsphere/local/var/qmail/bin/splogger smtpd 3 &

b) with SMTP Authentification:

/hsphere/shared/bin/tcpserver -H -c ${TCP_SERVERS} -x \
/hsphere/local/var/vpopmail/etc/tcp.smtp.cdb -u ${USER_QMAILD} -g \
${GROUP_QMAIL} 0 smtp /hsphere/local/var/qmail/bin/qmail-smtpd \
/hsphere/local/var/vpopmail/bin/vchkpwsmtp /bin/true | \
/hsphere/local/var/qmail/bin/splogger smtpd 3 &

Processing mail queue with further remote/local mail delivery

sh /hsphere/local/var/qmail/rc &


Web Mail Clients: SqWebMail And Horde IMP

Since H-Sphere 2.1, two webmail clients are included in H-Sphere installation:

  • In 2.4.1 and later, Horde IMP webmail client is installed on each mail server. In older versions, it is installed on one of the H-Sphere web servers. See IMP Setup for details.

Apache Server For Web Mail

SqWebMail is a default webmail client that is installed with mail server and requires Apache.

If H-Sphere mail server is installed on the same box with Web server, they share one single Apache server for both services. If, however, mail server runs on a separate box, this mail server's Apache would be configured without support of Frontpage extension, SSL, Webshell, Modlogan, Webalizer, rotatelog, and the like.

For Apache configuration, please refer to Web Server Configuration guide.

Related Docs:   Introduction To H-Sphere Mail (v. 2.4 and up)

Home   Products   Services   News
© Copyright. . PSOFT. All Rights Reserved. Terms | Site Map