On 05-19-2021 4:07 am, mauri...@caloro.ch wrote:
Thanks meny time for your answer
Please i need little more help, friedly ask for little help to recieve
any
feedback from following request.
Think possible here mailbox_domain will have been used a few times, but
on
me setup I am not so successful.
I am sorry but i don't understand your question.
What is it you need help with?
I see a couple of issues in your reply...
query = SELECT domain FROM domain WHERE domain = '%s'
It looks like you named both your table and column the same thing
"domain". It is better to not use the same name to avoid confusion. Even
if it is a simple difference like naming the table "domains" and the
column "domain" just so its clear to humans and mysql which one you are
talking about.
MariaDB [postfixadmin]> SELECT domain FROM domain WHERE domain = '%s';
Empty set (0.000 sec)
Typing this into the mysql console will never work. The %s is just the
variable that postfix uses. Postfix will replace the %s with the domain
it is searching for. It is only used in the postfix file so you can tell
postfix where to insert the domain in your custom query.
In postfix file you put:
SELECT domain FROM domain WHERE domain = '%s';
Postfix will substitute the %s like this:
SELECT domain FROM domain WHERE domain = 'example.com';
Then postfix sends this to mysql for an answer:
SELECT domain FROM domain WHERE domain = 'example.com';
Mysql will never see the '%s' from postfix, so when you type it manually
in mysql for testing mysql doesn't know what to do with it. Mysql will
search your table for a literal "%s" match.
MariaDB [postfixadmin]> SELECT domain FROM domain;
+-------------------+
| domain |
+-------------------+
| ALL |
| example.ch |
+-------------------+
2 rows in set (0.001 sec)
One of your rows in your database has "ALL". This is invalid, you will
never get an email from "user@ALL" over the internet. This will not
break postfix but it will never get used and will be ignored. You can
remove it with:
DELETE FROM domain WHERE domain = "ALL" LIMIT 1;