X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fsqlmail.pm;h=19505b4880c116cab0f85216c8893c30f7fdcad8;hb=674cb2d9d7105f4cc2871539b2e9f7088cdaa750;hp=64f72df07b1a79f807a2bf62f9dbc4bef05c05ee;hpb=cc6317796afe74fd6dcbc4712abfcb09ff199598;p=freeside.git diff --git a/FS/FS/part_export/sqlmail.pm b/FS/FS/part_export/sqlmail.pm index 64f72df07..19505b488 100644 --- a/FS/FS/part_export/sqlmail.pm +++ b/FS/FS/part_export/sqlmail.pm @@ -1,12 +1,50 @@ package FS::part_export::sqlmail; -use vars qw(@ISA); +use vars qw(@ISA %info); +use Tie::IxHash; +use Digest::MD5 qw(md5_hex); use FS::Record qw(qsearchs); use FS::part_export; -use Digest::MD5 qw(md5_hex); +use FS::svc_domain; @ISA = qw(FS::part_export); +tie my %options, 'Tie::IxHash', + 'datasrc' => { label => 'DBI data source' }, + 'username' => { label => 'Database username' }, + 'password' => { label => 'Database password' }, + 'server_type' => { + label => 'Server type', + type => 'select', + options => [qw(dovecot_plain dovecot_crypt dovecot_digest_md5 courier_plain + courier_crypt)], + default => ['dovecot_plain'], }, + 'svc_acct_table' => { label => 'User Table', default => 'user_acct' }, + 'svc_forward_table' => { label => 'Forward Table', default => 'forward' }, + 'svc_domain_table' => { label => 'Domain Table', default => 'domain' }, + 'svc_acct_fields' => { label => 'svc_acct Export Fields', + default => 'username _password domsvc svcnum' }, + 'svc_forward_fields' => { label => 'svc_forward Export Fields', + default => 'srcsvc dstsvc dst' }, + 'svc_domain_fields' => { label => 'svc_domain Export Fields', + default => 'domain svcnum catchall' }, + 'resolve_dstsvc' => { label => q{Resolve svc_forward.dstsvc to an email address and store it in dst. (Doesn't require that you also export dstsvc.)}, + type => 'checkbox' }, +; + +%info = ( + 'svc' => [qw( svc_acct svc_domain svc_forward )], + 'desc' => 'Real-time export to SQL-backed mail server', + 'options' => \%options, + 'nodomain' => '', + 'default_svc_class' => 'Email', + 'notes' => <<'END' +Database schema can be made to work with Courier IMAP, Exim and Dovecot. +Others could work but are untested. (more detailed description from +Kristian / fire2wire? ) +END +); + sub rebless { shift; } sub _export_insert { @@ -179,3 +217,5 @@ sub update_values { } +1; +