Home

| Home | Mailinglist | Download | License |

| Documentation | db/suite | db/common | db/base | db/relay | db/user | db/greylist |

qpsmtpd - Plugin db/user Documentation


NAME db/user

db/user - lookup existing recipients (users) plugin for the database plugin suite

go top


VERSION 2007.1

go top


DESCRIPTION

Enable user-level validation of addresses so that qpsmtpd can readily bounce invalid messages at the smtp level.

It does this by looking up the recipient address resp. user and host part of the email address in a database.

The inspiration of this module comes from a mailer setup with qpsmtpd and exim, where exim is used to manage virtual accounts in a database as described on http://flakey.info/mailserver/ or http://www.xmn-berlin.de/~marte/exim/exim4_mysql_amavis_spamassasin.html

go top


REQUIREMENTS

db/user requires the plugin db/common to be installed.

It requires the Perl modules

 Qpsmtpd::DSN

It's tested with qpsmtpd 0.32 and MySQL as database.

go top


CONFIGURATION

/etc/qpsmtpd/plugins

All other database plugins must follow the basic plugin db/base - e.g.:

 db/base
 db/relay
 db/user
 db/greylist

/etc/qpsmtpd/db_user

ParameterExampleOptional/Default
email_tableemail_table=emailtable
domain_tabledomain_table=emailtable
email_addressemail_address=
email_useremail_user=local_part
email_domainemail_domain=domain
email_enabledemail_enabled=is_enabledoptional
email_enabled_valueemail_enabled_value=yesoptional
domain_domaindomain_domain=domain

How the fields are used

go top


CONSTRUCTOR METHODS

init

Call: $self->init ( $qp )

Called from qpsmtpd on startup.

Calls isa_plugin('db/common') and db/common::init ( $qp ).

go top

db_init_config

Call: $self->db_init_config ( $config_fields, $config_fields_empty, $config_fields_default )

Called from db/common::init.

Sets the local config hashes. See CONFIGURATION.

go top

db_valid_config

Call: $self->db_valid_config ()

Called from db/common::init.

If the field email_address is given, email_user and email_domain are set to undef and vice versa.

If the field email_enabled is given, email_enabled_value must be present.

If notify_email is given, assures that notify_email and notify_from by calling db/common::db_valid_email.

Calls db/common::db_die on errors.

On errors in db_valid_config qpsmtpd won't start.

go top


HOOKS

hook_rcpt

Calls user_email_record and user_domain_record if db/common::db_rec is emtpy.

Returns:

db/common::db_declinedno decision, log entries:
Local address '...@...'if address belongs to a virtual user of our domain(s).
Foreign address '...@...'if address is not in our domain(s).
Qpsmtpd::DSN->mbox_disabledreject the message, log entry/message:
Mailbox '...@...' disabled, not accepting messagesif not email_enabled
Qpsmtpd::DSN->no_such_userreject the message, log entry/message:
Address '...@...' doesn't exist on this serverif user unknown
db/common::db_denysoft_erroron error.

go top


HELPER METHODS

user_email_record

Call: $self->user_email_record ( [ $msg ] )

Calls db/common::db_open.

Calls db_error and dies with the optional $msg or DB_ERROR.

go top

user_domain_record

Call: $self->user_domain_record ( [ $msg ] )

Calls db/common::db_open.

Calls db_error and dies with the optional $msg or DB_ERROR.

go top

go top


CREDITS

Thanks to Ask Bjoern Hansen for qpsmtpd.

http://smtpd.develooper.com/

go top


COPYRIGHT

(c) Ernesto 2007, ernesto@dienstleistung-kultur.de

http://dienstleistung-kultur.de/qpsmtpd/

go top


LICENCE

As per the qpsmtpd license.

go top


This is a service of dienstleistung-kultur.de            Mailsystem QPSMTPD            Comments to Ernesto at ernesto@dienstleistung-kultur.de            Impressum