📄 vpopmail.html
字号:
files, mysql (small version) and mysql (large version. </P><P>Most current vpopmail users would probably be interested in how toconvert current domains into mysql domains. To make it simple toconvert an entire machine to mysql, use the following command:vconvert -c -s This will go through all the domains in~vpopmail/domains directory and read each vpasswd file and load thecontents into the vpopmail.vpopmail mysql table. The vpasswd file isleft untouched for safety. Vconvert can also be run against one ormore domains at a time. This is done by running the command as so:vconvert \c \s domain1 domain2 ...</P><P>To convert all users (except root and system accounts) into amysql domain run the following command: vconvert -e -s domain. Thisreads all /etc/passwd accounts and creates mysql entries using theirpasswords. The passwords can be in either /etc/passwd or /etc/shadow.These passwords should work under vchkpw authentication program. </P><H3>Security and pop server under tcpserver</H3><P>If all of your pop email accounts are under virtual domains, youcan increase the security of your pop server by running it under theuid and gid of vpopmail/vchkpw using the tcpserver -u and -g options.</P><H3>Commands</H3><P STYLE="margin-bottom: 0in"><BR></P><H3>Quota's</H3><P STYLE="margin-bottom: 0in"><BR></P><H3>Bouncing mail</H3><P STYLE="margin-bottom: 0in"><BR></P><H3><a name="directorystructure">Directory structure</a></H3><H4>Overall vpopmail directory structure</H4><P>Vpopmail gets it's own home directory. Under this directory thereare the following:</P><DL> <DD>bin - contains all the binaries</DD><DD> lib - contains the libvpopmail.a file</DD><DD> include - contains the C header files</DD><DD> users - for backward compatibility for people who mix /etc/passwd users with vpopmail users in one domain</DD><DD> domains - where all the virtual domains are kept.</DD></DL><H4>Virtual domain user directory structure</H4><P>Vpopmail uses an adaptive directory structure based on a statefile ".dir-control" which is automatically managed by thecore vpopmail api functions "vadduser" and "vdeluser".For sites with 100 users or less, all user directories are stored inthe virtual domain directory. For sites that go above 100 users theadaptive directory structure goes into effect. The basic idea is tobreak up the user Maildir directories across multple directories andsub directories so that there are never more than 100 userdirectories in a single directory.</P><P>The default directory setup allows for 62 directories in 3 levelsand 100 user directories per directory. The total number of userdirectories is equal to 100 + (62 * 100) + (62 * 62 * 100) + (62 * 62* 62 * 100) = over 24 million directories. This should be more thansufficent for any site and probably goes beyond the technology ofdirectory structures. </P><P>If you are going to be storing large numbers of user directories,make sure you set your file system to have a higher than normalpercentage of inodes. </P><P>Vpopmail will automatically create these directories and subdirectories as needed and populate each directory with up to 100 useraccounts. As soon as a directory reaches 100 users it will create thenext directory or sub directory and store the new users directorythere. </P><P>Look in the source code release directory contrib/ for acontributed directory reorganization program.</P><H3>Internationalization</H3><P>There is two messages that get inserted into emails. These areboth for bounced messages. The first is for no such user and thesecond is for user over quota. Site administrators can customizethese messages by creating a .over-quota.msg and .no-user.msg file ina virtual domain directory or in the main virtual domain directory.If a .over-quota.msg file or .no-user.msg file are not found in thevirtual domain directory, then they are checked for in the mainvirtual domain directory. If they are not found there, then thedefault compiled message is included in the bounce message.</P><H3>dot-qmail processing</H3><P STYLE="margin-bottom: 0in">Every virtualdomain get's it's owndirectory under ~vpopmail/domains. Qmail's user/assign file gets anentry for each domain that</P><P STYLE="margin-bottom: 0in">points qmail-local deliveries into thisdirectory. Therefore, all normal .qmail file processing works in eachvirtual domain. .qmail files just need the user name extension towork, i.e. .qmail-joe for user joe. Ezmlm uses .qmail files forprocessing, so it will work under vpopmail.</P><P STYLE="margin-bottom: 0in"><BR></P><P>If no user matches a .qmail file then the .qmail-default file isprocessed. This file contains the vdelivermail program. This programreads the authentication database (mysql or vpasswd.cdb) anddeliveres the mail into the users directory. The last parameter ofvdelivermail can be a maildir owned by vpopmail/vchkpw so that alldefault mail reception ends up there. Or it can have an emailaddress, and all default mail is forwarded to this address. Last butnot least, the last parameter to vdelivermail can be the text<FONT FACE="courier, monospace">bounce-no-mailbox.</FONT><FONT FACE="times, serif">This will bounce all non matching emails back to the sender.</FONT></P><H3>qmailadmin</H3><P STYLE="margin-bottom: 0in">Qmailadmin provides a web basedinterface for managing vpopmail domains. As of version 0.26, it usesthe vpopmail api. Which means it can manage mysql or vpasswd.cdbauthentication. It allows for adding pop users, managingforwards/aliases, ezmlm mailing lists and autoresponders.</P><H3>sqwebmail</H3><P STYLE="margin-bottom: 0in">Sqwebmail is a web based email client.It reads and writes directly to the users Maildirs. It can talk tovpopmail vpasswd files. We have a modified version of 0.24 on<A HREF="http://www.inter7.com/vpopmail">http://www.inter7.com/vpopmail</A>which uses vpopmail api. It also supports setting the users passwordand lets the user forward their mail. Hopefully these changes will beintergrated into the standard distribution :)</P><H3>courier-imap</H3><P STYLE="margin-bottom: 0in">Courier-imap is a IMAP server thatsupports Maildirs. It's current release supports vpopmail vpasswdfiles. We will be integrating the vpopmail api into the maindistribution soon.</P><H3>mysql authentication</H3><P STYLE="margin-bottom: 0in"><BR></P><H3>cdb authentication</H3><P STYLE="margin-bottom: 0in"><BR></P><H3><A name="vpopmail-api">vpopmail API</a></H3><P>As of version 3.4.10 vpopmail builds a library located in~vpopmail/lib/libvpopmail.a . Linking this library into yourapplication will provide access to the following C functions. Theassociated header files are located in ~vpopmail/include.</P><H4>int vadddomain( char *domain)</H4><DL> <DD>domain = the new virtual domain</DD><DD STYLE="margin-bottom: 0.2in"> <BR><BR> </DD></DL><H4>int vdeldomain( char *domain )</H4><DL> <DD STYLE="margin-bottom: 0.2in">domain = virtual domain to delete</DD></DL><H4>int vadduser( char *user, char *domain, char *password, int apop)</H4><DL> <DD>user = new user name</DD><DD> domain = virtual domain</DD><DD> password = clear text password</DD><DD STYLE="margin-bottom: 0.2in"> apop = 0 for pop and 1 for apop</DD></DL><H4>int vdeluser( char *user, char *domain)</H4><DL> <DD>user = user to delete</DD><DD STYLE="margin-bottom: 0.2in"> domain = virtual domain</DD></DL><H4>int vpasswd( char *user, char *domain, char *password)</H4><DL> <DD>user = user to change password for</DD><DD> domain = virtual domain</DD><DD STYLE="margin-bottom: 0.2in"> password = clear text password </DD></DL><H4>int vsetuserquota( char *user, char *domain, char *quota)</H4><DL> <DD>user = user name to change quota for</DD><DD> domain = virtual domain</DD><DD STYLE="margin-bottom: 0.2in"> char = quota in bytes. M/m and K/k abbrieviations apply. 5M 5m and 5000000 all equal 5 million bytes hard quota</DD></DL><H3>vpopmail authentication API</H3><H4>int vauth_addomain( char *domain)</H4><DL> <DD STYLE="margin-bottom: 0.2in">domain = domain name to add to authentication system</DD></DL><H4>int vauth_deldomain( char *domain)</H4><DL> <DD STYLE="margin-bottom: 0.2in">domain = domain name to delete from authentication system</DD></DL><H4>int vauth_adduser( char *user, char *domain, char *crypted_password,char *dir, int apop)</H4><DL> <DD>user = user to add from authentication system</DD><DD> domain = domain name</DD><DD> crypted_password = encrypted password</DD><DD> dir = full path to directory where users Maildir is stored.</DD><DD STYLE="margin-bottom: 0.2in"> apop = 0 for POP and 1 for APOP</DD></DL><H4>int vauth_deluser( char *user, char *domain)</H4><DL> <DD>user = user to delete from authentication system</DD><DD STYLE="margin-bottom: 0.2in"> domain = domain name</DD></DL><H4>int vauth_password( char *user, char *domain, char *crypted_password)</H4><DL> <DD>user = user to change password in authentication system</DD><DD> domain = domain name</DD><DD STYLE="margin-bottom: 0.2in"> crypted_password = the encrypted password</DD></DL><H4>int vauth_setquota( char *user, char *domain, char *quota)</H4><DL> <DD>user = user to set quota for in authentication system</DD><DD> domain = domain name</DD><DD STYLE="margin-bottom: 0.2in"> quota = quota in bytes or using M/m or K/k abbrieviations. 5M = 5m = 5000000 </DD></DL><H4>struct *passwd vauth_getpw( char *user, char *domain)</H4><DL> <DD>user = user name to retrieve password entry from authentication system</DD><DD STYLE="margin-bottom: 0.2in"> domain = domain name</DD></DL><H4>int vauth_setpw( struct *passwd, char *domain)</H4><DL> <DD>passwd = pointer to a passwd structure to store in authentication system. </DD><DD STYLE="margin-bottom: 0.2in"> domain = domain name for this passwd structure</DD></DL><H4>struct *vauth_user( char *user, char *domain, char *password, char*apop)</H4><DL> <DD>user = user name to authenticate</DD><DD> domain = domain name</DD><DD> password = clear text password</DD><DD STYLE="margin-bottom: 0.2in"> apop = not used in version 3.4.10</DD></DL><H4>struct *vauth_getall( char *domain, int first, int sort_it )</H4><DL> <DD>domain = domain name to retrieve password structure from authentication system</DD><DD> first = 1 to get first record, 0 = get next record </DD><DD> sort_it = 1 to have the user list sorted alphabetically. This has no effect on vpasswd/cdb method, since all users are added alphabetically. With mysql it adds an order by pw_name to the query.</DD></DL><H4>int vget_limits( char *domain, struct vlimits *limits )</H4><DL> <DD>domain = domain name to get limits for</DD> <DD>limits = name of limits structure</DD></DL><H4>int vset_limits( char *domain, struct vlimits *limits )</H4><DL> <DD>domain = domain name to set limits for</DD> <DD>limits = name of limits structure</DD></DL><H4>int vdel_limits( char *domain )</H4><DL> <DD>domain = domain name to delete limits for</DD> <DD>limits = name of limits structure</DD></DL><P STYLE="margin-bottom: 0in"><BR></P></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -