[Mimedefang] mimedefang && BerkeleyDB

Dmitry Sokolov demian at elnet.ru
Mon Dec 16 09:14:00 EST 2002


Dirk Mueller <dmuell at gmx.net> wrote:
> Hi, 
> 
> I'm unsuccessfully trying to use the BerkelyDB with MIMEDefang. I tie 
> globally a DB to a variable: 
> 
> use BerkeleyDB;
> $dbenv = new BerkeleyDB::Env -Flags => DB_INIT_CDB | DB_INIT_MPOOL;
> tie %db_email, "BerkeleyDB::Hash",
>     -Filename => "/var/spool/MIMEDefang/email.db",
>     -Env => $env;
> 
> using the concurrent access options, and then adding and fetching email 
> addresses from it (it is to keep track of existing email addresses so that I 
> don't have to query the actual mail servers each time a mail passes the mail 
> gateway). However, it seems that new entries are not immediately visible 
> to other, parallel running Mimedefang processes. 
> 
> Are there known caveats when using this combination?
> 
> 
> 
> -- 
> Dirk (received 86 mails today)
> _______________________________________________
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Try it...

 $home="/var/spool/MIMEDefang";
 $filename="email.db";

 my $env = new BerkeleyDB::Env
               -Home => $home,
               -Flags => DB_CREATE|DB_INIT_CDB|DB_INIT_MPOOL,



 $db = tie %db, 'BerkeleyDB::Hash',
               -Env => $env,
               -Filename   => $filename,
               -Flags => DB_CREATE,


 Functions put,get,del: 

 $db->db_put($key,$value);
 $db->db_get($key,$value);
 $db->db_del($key);

 

-- 
Dmitry Sokolov
--------------------
NOC of Elvis-Telecom
email: demian at elnet.ru
+7 095 7772466



More information about the MIMEDefang mailing list