qmail log files with correct timestamps

Qmail log file uses TAI64N time format. The first sixteen hex digits represent a 64-bit number which counts how many seconds have passed since the beginning of 1970, while the remaining eight hex digits are a 32-bit number which counts nanoseconds since the beginning of the second.

Here is how do correctly view log files with timestamps?

tai64nlocal < /var/log/qmail/qmail-send/current or
tail -f /var/log/qmail/qmail-smtpd/current | tai64nlocal


vpopmail - virtual domain package for qmail

Vpopmail provide an easy way to manage virtual email domains and non /etc/passwd email accounts on qmail server.

Features include

  • Support for 1 to 23 million virtual email domains using a "grow as it goes" balanced directory tree.
  • Support for 1 to 23 million email users per domain using the same balanced tree structure.
  • Automates all qmail configurations into handy and scriptable command line programs and documented API library calls.
  • Automates Unix user/group/other permissioning of directories and files.
  • Supports authenticated relay control of your qmail smtp server.
  • Virtual email file/directories can be assigned to any user/group or do the default vpopmail/vchkpw 89/89.
  • Does not require email user accounts in /etc/passwd
  • Supports name or IP based virtual domains
  • Optionally automates support for:
    • Storing clear text passwords to help tech support workers
    • Record last authentication and automates deletion of stale accounts.
    • Storing alias/forwards in mysql or oracle
  • Configurable logging based on real world admin's comments and requirements.
  • Support for Mysql, Oracle, PostgreSQL, /etc/passwd, /etc/shadow LDAP, Sybase, and default cdb authentication storage.
  • Delivers directly to Maildir for use with qmail-pop3d, .qmail files or any other Maildir program.
  • No need to have hundreds of .qmail files for virtual domains. Each domain gets it's own directory under vpopmail user with a separate password file for each domain.
  • Documented command line programs that can be used in scripts or for remote admin.
  • Documented C library for all vpopmail features and transactions.

vpopmail Requirements

Optional Packages

qmailadmin - Web-based admin interface for virtual domains




























Qmailadmin is a nice web based interface for administering
virtual domains once they are setup through Vpopmail (or Vqadmin). From Qmailadmin we can create mailboxes, aliases, fowards, mail robots, mailing lists.



Requirements

vdelivermail - deliver mail to a virtual user

vdelivermail deliver mail to a virtual user. vdelivermail is vpopmail's delivery agent. It handles delivery of messages, bouncing, catch-alls, etc. Called from the virtual domains .qmail-default file to deliver email to a virtual user.

Syntex:
vdelivermail [""] [default account]

OPTIONS

[""]
Blank double quote for backward compatibility

[default account for delivery]
If the email does match any .qmail-user file and also does not match any virtual domain user, this is the default delivery instructions. There are three values this may contain.
  • Full path to a vpopmail user directory
  • email address to forward email too
  • the string bounce-no-mailbox to bounce the email back to the sender.
Default is the postmaster account
Example:
vdlivermail postmaster@mycompany.com

.qmail-user file
john@mycompany.com
abc@mycompany.com

vconvert - convert one authentication method to another

vconvert convert one authentication method to another.

Syntex: vconvert [-e] [-c] [-m] [-S] [-v] [-d]

Optional:
The first option sets which format to convert FROM,
the second option sets which format to convert TO.

[-e] = etc format

[-c] =
cdb format

[-m ]
= sql format

[ -S]
= set sqwebmail passwords

[-v]
= version

[-d]
= debug info

Example:
vconvert -c -m -v

vsetuserquota - set a users hard quota limit

vsetuserquota set a users hard quota limit. --enable-hardquota=y must be set during vpopmail configuration for this to have any effect. Default configuration sets hard quota on. Default hard quota limit is 5oM.

Syntex:
vsetuserquota [email address] [quota in bytes]

Optional:

[email address]
The email address of the user.

[quota in bytes]
The hard quota limit in bytes. Abbrivations can be used for kilobytes and mega bytes. 5m will set the quota to 5 mega bytes. Or 2k will set the quota to 2k. NOQUOTA will turn off all quota checking for that user.


Example:
vsetuserquota john@mycompany.com 51200

For example to set 5 MB limit

vsetuserquota john@mycompany.com 5m

For 2k limit

vsetuserquota john@mycompany.com 2k

For NOQUOTA

vsetuserquota john@mycompany.com NOQUOTA

vpopbull - post a message to virtual domain users

vpopbull post a message to virtual domain users

Syntex:
vpopbull [-f filename ] [-e exclude email addresses file] [-v] [-n] [-c] [-h] [-s] [virtual domain ...]

Optional:
[-f filename]
File containing the email message to be posted.

[-e exclude email addresses file]
File containing a list of email addresses to exclude from posting.

[-v]
Verbose mode. Prints out each email address it is sending to.

[-n]
Don't actuall mail it. using -v and -n can be used to list out all virtual domain email accounts.

[-c]
Default, copy message to users directory.

[-h]
Make a hard link from email file to virtual users directory. Email file must be on the same physical device as the virtual users directories. This will save disk space.

[-s]
Make a soft link from the email file to the virutal users directory. This will save on disk space but will not remove the file when all users read it. If the original file is deleted, users will not be able to read the message.

[virtual domain ... ]
List of domains to send the message to. If this is not supplied then the message is sent to all virtual domains.

Example:
vpopbull -f Email_Msg.txt -e Exclude_Email_List.txt -v -c mycompany.com

vpasswd - change a virtual domain users password

vpasswd change a virtual domain users password.

Syntex:
vpasswd email_address [password] [-r]

Optional:
email_address
Email address of user which password needs to be changed.
[password]
Set the password for the user. If the password is not supplied on the command line then vpasswd will prompt standard in for the password. The password must be typed in twice.
[-r]
vpasswd with generate a random password

Example:
vadduser john@mycompany.com newpass

vdeluser - delete a virtual domain email account

vdeluser delete a virtual domain email account. This will completely removes a virtual domain email account from the system including all mails directories

Syntex:
vdeluser [email address ]

Optional:
[email address]
Fully qualified email account. For example: user@domain.com. If no domain is specified then the account is removed from the default virtual domain.

Example:
vdeluser john@mycompany.com

vadduser - add a virtual user to a domain

vadduser adds a new user to a virtual domain. The account becomes active immediately.

Syntex:
vadduser [email address] [password] [-a] [-q hard quota in bytes]

Optional:
[email address]
The new email address of the user. Requires the domain name as well as the user name. For example: user@domain.com. If the domain name is not specified the user is added to the default domain.

[password]
Set the password for the user. If the password is not supplied on the command line then vadduser will prompt standard in for the password. The password must be typed in twice.

[-a]
Set the account to use APOP instead of the default POP.

[-q quota in bytes]
Set the hard quota limit for the user. If not supplied then the default system hard quota limit is set. The default limit is either 50M or what ever is set via --enable-hardquota. If set to NOQUOTA then the user will have no quota limit.
Example:
vadduser john@mycompany.com newpass -q 51200

vqadmin - vpopmail system administrator admin CGI

Simply put, Vqadmin is a nice web based interface that will let us manage Vpopmail. Through the interface we can create new virtual domains, new users, net quotas, enable services and much more.

vqadmin
work with cgi which is authenticated using Apache style htpasswd files. htpasswd files is user based ACL which provides control over what actions can be performed, such as adding/deleting a domain or accessing user email account information to allow modification of user passwords and quotas.

vqadmin and qmailadmin work together. While qmailadmin can be used to allow users to administer their own domains, they are unable to create new domains. Creation or deletion of domains is normally associated with the owner/admins of the machine.

Features

  • Add / Delete virtual email domains
  • Change user passwords, quotas
  • Turn off account services such as pop, imap, web email or smtp relay
  • Written in C for speed
  • Uses html templates
  • Access control lists to limit groups of users to different levels of features
  • Support for multiple languages based on dictionary files. English language dictionary can be seen here

Requirements

Optional packages

vdeldomain - delete a virtual domain

vdeldomain completely removes a virtual domain from the system. Including updating all qmail files and removing all email users and thier directories.

vdeldomain [domain name]

Option:

[domain name] Name of the existing domain which is to remove


Example:

vdeldomain wrongdomain.com


This can be done through web based control panel vqadmin.

vaddaliasdomain - add a virtual user to a domain

vaddaliasdomain add a virtual user to a domain. Basically it link old domain to new domain with all the existing accounts on the old domain.

vaddaliasdomain [new domain] [old domain]

Option:

[new domain] Name of the new domain

[old domain] Name of the old domain

Example:

vaddaliasdomain yahoomail.com yahoo.com

This can be done through web based control panel vqadmin.

vadddomain - create a virtual domain

vadddomain is used to create the virtual domain. With this also all qmail files and system are automatically updated.

Syntex:
vadddomain [virtual domain ] [postmaster password] -a -q quota

OPTIONS
[virtual domain] Name of the new virtual domain
[postmaster password] The password for the postmaster account. If the password is not supplied on the command line then vadddomain will prompt for the password twice.
-a Use apop instead of pop.
-q quota Set the hard quota limit for the postmaster account.

Here is example:

# /usr/home/vpopmail/bin/vadddomain newdomainname.com
Please enter password for postmaster:
enter password again:

OR

# /usr/home/vpopmail/bin/vadddomain newdomainname.com pass4post

This can be done through web based control panel vqadmin.

Reject the mail from particular email id or domain

You can reject the mail from particular email id or domain name.

vi /var/qmail/control/badmailfrom

add
reject-mail-from@yahoo.com
@junkdomain.com

Now your qmail server will reject the mail from reject-mail-from@yahoo.com and any email from @junkdomain.com domain.

Disable reverse DNS lookups on SMTP connections

To disbale the reverse DNS lookups on SMTP connections in qmail, you need to edit qmail-smtpd supervise script.

That file is located at /var/qmail/supervise/qmail-smtpd/run.
Look for for following line:

/usr/local/bin/tcpserver -v -R -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \

...& replace with this..

/usr/local/bin/tcpserver -v -R -H -l "$LOCAL" -x /etc/tcp.smtp.cdb -c "$MAXSMTPD" \