List Info

Thread: SQL Lookups.




SQL Lookups.
user name
2006-05-19 14:48:12
Just a follow on question,

OK, I see how mailaddr works, with its 3 fields, 
ID (auto increment)
priority (What does this do?)
email. (fine, but obviously this is not meant to be unique.)

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?

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?

Kind regards

Benedict White




-------------------------------------------------------
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=lnk&kid0709&bid&
amp;3057&dat1642
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
SQL Lookups.
user name
2006-05-20 00:41:46
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 userexample.com
would match all the following mailaddr records (if they
existed
in a database):
  userexample.com
  example.com
  .example.com
  .com
  .

One would normally assign highest priority to the most
specific
entry, i.e. userexample.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 foeexample.com, which is to be blacklisted.
It would be imperative that foeexample.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 foeexample.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=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
AMaViS-user mailing list
AMaViS-userlists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amavis-user

AMaViS-FAQ:http://www.amav
is.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/ho
wto/
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )