Vpopmail

From Qmailwiki
Revision as of 15:15, 2 February 2005 by 68.78.194.78 (Talk)
Jump to: navigation, search

Contents

About

vpopmail is a set of API that manages virtual user accounts on a qmail system, and handles delivery for these virtual users. The command-line utilities, and Qmailadmin all use the vpopmail API, provided by the vpopmail library to manage the system.

Features

Roaming Users

Command-line utilities

All binaries for user management are, by default, under /home/vpopmail/bin. Almost all the binaries in this directory can be executed, without arguments, to display a usage.

vadddomain

Adds a new domain to the mailserver

vadddomain: usage: vadddomain [options] virtual_domain [postmaster password]
options: -v prints the version
         -q quota_in_bytes (sets the quota for postmaster account)
         -b (bounces all mail that doesn't match a user, default)
         -e email_address (forwards all non matching user to this address [*])
         -u user (sets the uid/gid based on a user in /etc/passwd)
         -d dir (sets the dir to use for this domain)
         -i uid (sets the uid to use for this domain)
         -g gid (sets the gid to use for this domain)
         -O optimize adding, for bulk adds set this for all
            except the last one
         -r[len] (generate a len (default 8) char random postmaster password)

 [*] omit @-sign to deliver directly into user's Maildir: '-e postmaster'

vdeldomain

Deletes a domain from the mailserver, all users, and all mail under this domain

vdeldomain: usage: [options] domain_name
options: -v (print version number)

vadduser

Adds a mailbox to a domain

vadduser: usage: [options] email_address [passwd]
options: -v (print the version)
         -q quota_in_bytes (sets the users quota, use NOQUOTA for unlimited)
         -c comment (sets the gecos comment field)
         -e standard_encrypted_password
         -n no_password
         -r[len] (generate a len (default 8) char random password)

vdeluser

Deletes a mailbox from a domain, including all mail for that user

vdeluser: usage: [options] email_address
options: -v (print version number)

vdominfo

Return basic information about one or all domains hosted on the server

vdominfo: usage: [options] [domain]
options: -v (print version number)
         -a (display all fields, this is the default)
         -n (display domain name)
         -u (display uid field)
         -g (display gid field)
         -d (display domain directory)
         -t (display total users)

Note that to return the usage with vdominfo, you must type

vdominfo -h

vuserinfo

Return information about user accounts

vuserinfo: usage: [options] email_address
options: -v (print version number)
         -a (display all fields, this is the default)
         -n (display name field)
         -p (display crypted password)
         -u (display uid field)
         -g (display gid field)
         -c (display comment field)
         -d (display directory)
         -q (display quota field)
         -Q (display quota usage)
         -C (display clear text password)
         -l (display last authentication time)
         -D domainname (show all users on this domain)

vmoduser

Modify user settings and flags

vmoduser: usage: [options] email_addr or domain ( for the entire domain )
options: -v ( display the vpopmail version number )
         -n ( don't rebuild the vpasswd.cdb file )
         -q quota ( set quota )
         -c comment (set the comment/gecos field )
         -e encrypted_passwd (set the password field )
         -C clear_text_passwd (set the password field )
the following options are bit flags in the gid int field
         -u ( set no dialup flag )
         -d ( set no password changing flag )
         -p ( set no pop access flag )
         -s ( set no smtp access flag )
         -w ( set no web mail access flag )
         -i ( set no imap access flag )
         -b ( set bounce mail flag )
         -o ( set override domain limits flag )
         -r ( set no external relay flag )
         -a ( grant qmailadmin administrator privileges)
         -0 ( set V_USER0 flag )
         -1 ( set V_USER1 flag )
         -2 ( set V_USER2 flag )
         -3 ( set V_USER3 flag )
         -x ( clear all flags )
         -f ( disable spamassassin)
         -F ( delete spam)

Notes

The vmoduser command is very useful for more advanced user options. Each user has a set of flags that can be set on them. For instance, 'No webmail' will disallow them to use a webmail interface, and 'No POP3' will not allow them to download mail via POP. Generally people use these flags to nudge customers who haven't paid, or to provide specific services to users who are paying for specific services (ie: webmail or pop3, etc). You can also set a flag which disallows them to send mail. Other than user flags, one can also set quotas with this command.

vpopbull

Short for vpopmail bulletin, vpopbull mass-mails local users an email.

usage: vpopbull [options] -f [email_file] [virtual_domain] [...]
       -v (print version number)
       -V (verbose)
       -f email_file (file with message contents)
       -e exclude_email_addr_file (list of addresses to exclude)
       -n (don't mail. Use with -V to list accounts)
       -c (default, copy file)
       -h (use hard links)
       -s (use symbolic links)

Notes

The vpopbull command solves a number of problems with trying to mail all your users. Firstly, you dont need to maintain a list of all your user accounts to email to. Secondly, emailing users through the actual qmail server would be inefficient. vpopbull drops messages directly into their Maildir directories where they can be picked up by POP3, webmail, etc, making the operation a simple copy operation instead of an actual mailing operation.

The email sent must be a fully valid email message, including From, and Subject headers, followed by a blank line, followed by the message. The one exception is that a To header should not be included.

From: <example@example.com>
Subject: Server maintenance

Dear example.com users,

   We will be performing maintenance on the mail server tomorrow morning.
The maintence window will be between 3am and 5am.

Thank you for your patience,
The example.com Staff

More complicated messages, including ones with attachments, etc, can also be made, however the specifics of generating a multipart message is out of the scope of this document.

Other binaries

You will probably notice that there are binaries in the bin directory that aren't listed above. These binaries are either used by vpopmail to handle delivery or other aspects of the mail system management, or they are used by more advanced users or users who are migrating data between databases.

clearopensmtp

When vpopmail has been compiled with the --enable-roaming-users=y flag enabled, this binary is run out of the crontab every 5 minutes to update the list of IPs that are no longer allowed to send mail. This is a binary used by the Roaming Users feature of vpopmail.

dotqmail2valias

When vpopmail has been compiled with the --enable-valias=y flag, this binary will find all dotqmail files under vpopmail and convert them to valias entries in the database.

Other Features

Here is a list of features that are not so commonly used, but definately have their place.

valias

valias provides use of special delivery instructions normally found in dotqmail, from a database. Depending upon systems, this may or may not increase efficiency.

Personal tools