Jump to content
Froxlor Forum
  • 0

Amavisd-new + Froxlors virtual domains


SZoellner

Question

Hi

is anyone using Amavis and Froxlor? There is the possibility to read the @local_domains_acl from the MySQL-Database, but I don't know how.

The syntax is something like this, but that doesn't work for Froxlor of course:

@lookup_sql_dsn = (['DBI:mysql:database=mailserver;host=127.0.0.1;port=3306', 'mailuser', 'mailuser']);

$sql_select_policy = 'SELECT name FROM virtual_domains WHERE CONCAT("@",name) IN (%k)';

That will be executed in the DB:

SELECT name

FROM virtual_domains

WHERE CONCAT("@",name)

IN (

'john@example.com',

'john',

'@example.com',

'@.example.com',

'@.com',

'@.')

I've tried

@lookup_sql_dsn = (['DBI:mysql:database=syscp;host=127.0.0.1;port=3306', 'syscp', 'password']);

$sql_select_policy = 'SELECT email FROM mail_users WHERE CONCAT("@",email) IN (%k)';

but that doesn't work.

Does anyone know the correct query?

Thank you for your help

Simon

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

I looked up a tutorial i previously used at http://workaround.or...am-and-viruses.

 

Here the domain is queried instead of the mail address.

@lookup_sql_dsn = (
['DBI:mysql:database=froxlor;host=127.0.0.1;port=3306',
 'froxlor',
 'MYSQL_PASSWORD']);
$sql_select_policy = 'SELECT domain FROM panel_domains WHERE CONCAT("@",domain) IN (%k)';

 

 

I also monitored the query, amavis sends a list in %k, so both queries should work.

SELECT domain FROM panel_domains WHERE CONCAT("@",domain) IN ('example@example.com','@example.com','@.example.com','@.com','@.')

Link to comment
Share on other sites

Ok, I've found the solution myself. This is how it works:

@lookup_sql_dsn = (['DBI:mysql:database=syscp;host=127.0.0.1;port=3306', 'syscp', 'password']);

$sql_select_policy = 'SELECT email FROM mail_users WHERE CONCAT(email) IN (%k)';

I think @local_domains_acl must be defined before the sql thing but I'm not sure...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.



×
×
  • Create New...