Huangbin,
> I have "@storage_sql_dsn = ([DBI:mysql:xxx]);" configured in amavisd,
> the question is, how can i know which record in sql table "msgs" is
> incoming or outgoing message?
I'm glad you found a solution for your immediate problem.
A general answer to your question involves some SQL magic,
unfortunately the information is only available indirectly.
There are four possible outcomes:
originating recipient
from inside is local
no no shouldn't happen (open relay)
no yes inbound mail
yes no outbound mail
yes yes internal-to-internal
To check whether a recipient is local, one can compare
maddr.domain (where maddr.id=msgrcpt.rid) to a set of
local domains.
To check whether mail is originating from internal networks or
coming from authenticated roaming/home users, one can check
msgs.policy to contain one of your policy bank names which are
loaded when a message is originating.
I realize this can get quite ugly, so I took it to heart and
provided with 2.7.0-pre11 two new boolean (Y/N) fields:
msgs.originating and msgrcpt.is_local, which you can
test according to the table above.
Mark
------------------------------------------------------------------------------
Forrester recently released a report on the Return on Investment (ROI) of
Google Apps. They found a 300% ROI, 38%-56% cost savings, and break-even
within 7 months. Over 3 million businesses have gone Google with Google Apps:
an online email calendar, and document program that's accessible from your
browser. Read the Forrester report: http://p.sf.net/sfu/googleapps-sfnew
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
Please visit http://www.ijs.si/software/amavisd/ regularly
For administrativa requests please send email to rainer at openantivirus dot
org