Hi there,

I'm designing a mail system with virtual domains and have the following
requirement:

A virtual domain is able to send/receive mails to/from the Internet or
to/from custom "external domains".

For that i'm using a MySQL table called  "domain_external_domain_association"
which connects my virtual domains table and another external_domain table.

Somewhere in my set of smtpd_restrictions_classes there is one class that
uses a check_sender_access where i need to check if the sender domain
(external domain) is in this "domain_external_domain_association" when the
recipient domain is X (my virtual domain)

So the query looks like this:

query= SELECT
<http://postadmin.lab.mmely.de/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/select.html>
[OK
OR REJECT GOES HERE] FROM domain_external_domain_association AS deda JOIN
domain as d ON deda.domain_id = d.id JOIN external_domain as ed ON deda
.external_domain_id = ed.id WHERE d.name = 'HERE MY VDOMAIN' AND
<http://postadmin.lab.mmely.de/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/logical-operators.html#operator_and>
 deda.receive = 1 AND
<http://postadmin.lab.mmely.de/phpmyadmin/url.php?url=https://dev.mysql.com/doc/refman/5.5/en/logical-operators.html#operator_and>
 ed.name = '%d'

Also, the sql query explains the problem by itself :)

I think this is not possible to do, at least in the way i want to do it,
because i'm trying to use in the query some information that the
check_sender_access is not aware of.

Am i right? is there something i'm missing? A workaround?

Greetings and good start in the week!

Manuel Mely

Reply via email to