VUser::Email::Postfix::SQL - vuser extension for managing postfix users and domain in SQL
[Extension Email::Postfix::SQL] dsn = dbi:mysql:database=email user = email password = secret # The various *_query settings here need to be defined to tell vuser how to # add, delete, etc accounts in the database. Any option passed on the commandline # can be inserted into the query with %-option_name. # Several macros are defined by VUser::Email::Postfix::SQL to make things easier. # %a = account name (user@domain) # %p = password # %n = name # %q = quota # %h = home # %d = domain (option, i.e. --domain) # These options are calculated from other options, hence the '$' in the macro # %$u = user part of the account (user) # %$d = domain part of the account (domain) # Add a user useradd_query = insert into Emails set username=%a, password=%p # Delete a user userdel_query = delete from Email where username=%a # Modify the user # The usermod_*_query's are used to change various portions of the users' # account information. usermod_account_query = update Email set username=%-newaccount where username = %a usermod_password_query = update Email set password=%p where username = %a usermod_name_query = update Email set name=%n where username = %a usermod_quota_query = update Email set quota = %q where username = %a usermod_home_query = update Email set home = %h where username = %a # Get user information. This query must return the following values in order # account, password, name, home directory, quota userinfo_query = select ... from Email where username = %a userlist_query = select ... from Email # The domain*_query allow %d and %$d to be the same. # Add a domain domainadd_query = insert into Domains set domain = %d, transport = 'virtual:' # Delete a domain domaindel_query = delete from Domain where domain = %d # Modify a domain domainmod_domain_query = update Domain set domain = %-newdomain where domain = %d # Get domain info. The query must return the following fields in order # domain domaininfo_query = select domain from Domain where domain = %d # Get domain list. The query must return the following fields in order # domain domainlist_query = select domain from Domain
Randy Smith <perlstalker@vuser.org>
This file is part of VUser-Email-Postfix-SQL. VUser-Email-Postfix-SQL is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. VUser-Email-Postfix-SQL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with VUser-Email-Postfix-SQL; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
To install VUser::Email::Postfix::SQL, copy and paste the appropriate command in to your terminal.
cpanm
cpanm VUser::Email::Postfix::SQL
CPAN shell
perl -MCPAN -e shell install VUser::Email::Postfix::SQL
For more information on module installation, please visit the detailed CPAN module installation guide.