Qmail::Mysql

A Perl module for mysql database used by qmail-mysql.
Download

Qmail::Mysql Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Bruni Emiliano
  • Publisher web site:
  • http://search.cpan.org/~ebruni/

Qmail::Mysql Tags


Qmail::Mysql Description

A Perl module for mysql database used by qmail-mysql. Qmail::Mysql is a Perl module for MySQL database used by qmail-mysql.SYNOPSIS use Qmail::Mysql my $qmail = new Qmail::Mysql( sql_control_file => '/var/qmail/control/sqlserver', mailbox_base => '/var/spool/pop/users', password_type => 'Password', multihosting => 0, multihosting_join => '@' ); # add new domain as deliver local $qmail->rcpt_add('bar.com') # check if domain is a local domain $qmail->rcpt_exists('bar.com') # remove a domain as delivel local $qmail->rcpt_del('bar.com'); # add new mailbox (foo@bar.com) with pop3 password 'mypass' # pop3 user account is # 'foo' if multihosting => 0 or # 'foo@bar.com' if multihosting => 1 # (the '@' in the pop3 account can be changed using multihosting_join) # This command creates also a Maildir directory in # mailbox_base/xxxxxx # where xxxxxx is # 'foo' if multihosting => 0 or # 'bar.com/foo' if multihosting => 1 $qmail->mail_add('foo','bar.com','mypass'); # check to see if a mailbox already exists $qmail->mail_exists('foo','bar.com') # remove mailbox $qmail->mail_del('foo','bar.com'); # add an alias (alias@bar.com) is an alias for (real@bar.com) $qmail->alias_add('alias@bar.com','real@bar.com'); # check if this alias exists $qmail->alias_exists('alias@bar.com','real@bar.com') # remove this alias $qmail->alias_del('alias@bar.com','real@bar.com');The purpose of this module is to interface with the database structure used by the mysql patch of the qmail mailer daemon developed by Iain Patterson.This patch transfer the mailbox information of the smtp protocol and the authentication information of the pop3 protocol from some file in the filesystem into some tables of a mysql database.So lists of local deliver domains, the mail addresses, the aliases, the mailboxes of the smtp/pop3 qmail daemon if controlled by database tables instead of file.This module can be used to add/remove local deliver domains, to add/remove real local mailbox, to add/remove alias and mailing-lists.Thanks to Iain patch, all changes will be immediately see by qmail processes.To have more info about qmail-mysql patch take a look at Iain Patterson web site (http://iain.cx/qmail/).To connect to database this module uses the same account used by qmail processes. In the qmail-mysql patch documentation this user is set with "SELECT" only privilege over qmail database.To permit this module to read,add and delete qmail records standard privileges must be extended to "INSERT" and "DELETE" and "UPDATE".As mysql administrator user you can execute this sql query to extend the qmail privilage supposing that qmail user is 'qmail', that database is local and it's named 'qmail' too. mysql> GRANT SELECT,INSERT,UPDATE,DELETE ON `qmail` . * TO "qmail"@"localhost"; Requirements: · Perl


Qmail::Mysql Related Software