Re: [AMaViS-user] postfix delivers mail twice when amavisd-new is reloading

This is a discussion on Re: [AMaViS-user] postfix delivers mail twice when amavisd-new is reloading within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; Vlada, > read_hash(\%whitelist_sender, '/etc/amavis/whitelist_sender_GENERATED'); > in my amavisd.conf and generate this file periodically from other > ...


Go Back   Usenet Forums > Anti-Spam and Anti-Virus Related Forums > Amavis User

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-16-2005
Mark Martinec
 
Posts: n/a
Default Re: [AMaViS-user] postfix delivers mail twice when amavisd-new is reloading

Vlada,

> read_hash(\%whitelist_sender, '/etc/amavis/whitelist_sender_GENERATED');
> in my amavisd.conf and generate this file periodically from other
> sources. Then I always call /usr/sbin/amavisd-new reload
> ...The F0B149C056 stayed in the queue and 14 minutes later it was really
> delivered again and removed. So the mail is processed more than once, as
> the log message warned me.


> Previously I tried to find a way without the amavis reload:
> use BerkeleyDB;
> tie(%whitelist_sender, 'BerkeleyDB::Hash',
> -Filename=>'/etc/amavis/whitelist.db', -Flags=>DB_RDONLY)
> or die "Can't open whitelist db: $! $BerkeleyDB::Error";
> but I'm not fluent sufficiently in Perl or this way is impossible -- it
> didn't work.


In principle this could work, as amavisd really does a db lookup
each time - but it practice it probably does not work, because
to properly handling one-writer/many-readers simultaneous access
to a bdb a more sophisticated interface and locking mechanism
to BerkeleyDB is needed and a simple 'tie' does not offer it.
One can provide replacement routines for a tie, but I don't
have an example nor have ever tried it. Solutions welcome.

> May I ask for how to solve my problem? (I'd really prefer the way of not
> changing the distribution software or update to other than stable debian
> packages.)


For the moment the only truly dynamic and fast solution is
to use SQL-based lookups, perhaps only for white/black list
if this is all that is needed. Instead of preparing a file
whitelist_sender_GENERATED, your script can update records
in a database. A perfect and simple SQL database for your
purpose is SQLite, which does not require any server setups,
as the whole database is contained in a file.

Mark


-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
AMaViS-user mailing list
AMaViS-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/...fo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:50 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0