Re: [AMaViS-user] RE:SQL Lookups.

This is a discussion on Re: [AMaViS-user] RE:SQL Lookups. within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; Benedict, > OK, I see how mailaddr works, with its 3 fields, > ID (auto increment) A unique identifier of ...


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 05-20-2006
Mark Martinec
 
Posts: n/a
Default Re: [AMaViS-user] RE:SQL Lookups.

Benedict,

> OK, I see how mailaddr works, with its 3 fields,
> ID (auto increment)


A unique identifier of the record. Simplest is auto-increment,
but could be allocated in any other way.

> priority (What does this do?)


Equivalent to a field users.priority for recipients,
but in case of table mailaddr it applies to senders.

If several entries match a sender's address, the one with the
highest priority is used. E.g. an address like user@example.com
would match all the following mailaddr records (if they existed
in a database):
user@example.com
@example.com
@.example.com
@.com
@.

One would normally assign highest priority to the most specific
entry, i.e. user@example.com, and lowest to a least specific record,
a catchall @. in the above list. Just stick to suggested priorities
from examples.

It is not often that one would set something like the following,
but to be flexible this is possible:
- whitelist all from @example.com,
- except for foe@example.com, which is to be blacklisted.
It would be imperative that foe@example.com record would have
higher priority than an @example.com record.

> email. (fine, but obviously this is not meant to be unique.)


It need not be unique, but to use database effectively it pays
off to re-use existing records and not just blindly always
allocate new id and create copies of some common sender addresses.
This is in a domain of software that manages the wblist part
of the database, amavisd-new does not care how you allocate IDs.

> However, I need to understand how users and mailaddr relate to wblist.
>
> that has the following 3 fields:
> rid (int)
> sid (int)
> wb (var char)
>
> Now, I presume that rid and sid relate to the primary indexes of users and
> maildir (which auto increment) but which one is which?


Looking at a default SELECT clause clarifies it:

$sql_select_white_black_list :

SELECT wb
FROM wblist LEFT JOIN mailaddr ON wblist.sid=mailaddr.id
WHERE (wblist.rid=?) AND (mailaddr.email IN (%k))
ORDER BY mailaddr.priority DESC

So wblist.sid joins with sender's id mailaddr.id,
and wblist.rid matches recipients users.id.

> What format should wb be in? I can see that a positive or negative number
> hear would white or black list someone, is that how it works?


- 'W' or 'Y' whitelists a sender (for this particular recipient or his domain)
- 'B' or 'N' blacklists it
- a space neither blacklists nor whitelists it, and stops further search
(e.g. make foe@example.com neutral, despite @example.com being blacklisted)
- a number is a score boost, which is added to whatever SA computes;
it can be a positive or a negative number, possibly with decimals:
positive value adds more score points making mail more spammy,
negative score boost favorizes a sender;

Hard whitelisting is less desirable as spam may abuse valid friendly
sender address - better to just add few negative score points to friends.
Blacklisting is still useful, although I prefer to always just use
soft-b/w-listing, i.e. always use numbers.

Mark


-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=...057&dat=121642
_______________________________________________
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 06:41 PM.


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