Mysql – Postfix email server, using thesql for thenetworks


I have my own server, with postfix as mailserver. My clients have to be able to use this mailserver as well. They use software written in c# to send emails, but since my last upgrade the smtp authentication doesn't work properly so I have to use the myNetwork setting in
For dynamically allocated IP adresses, or employees of my clients working from home, this gives the problem that I have to manually adjust the everytime a mail is rejected by the mail server.

I allready use MySQL for users and domains so the configuration should be OK:

virtual_mailbox_domains = mysql:/etc/postfix/

virtual_mailbox_maps = mysql:/etc/postfix/

virtual_alias_maps = mysql:/etc/postfix/,mysql:/etc/postfix

But if I use:

mynetworks = mysql:/etc/postfix/

which contains:

user = MailUserName
password = MailUserPassWord
hosts =
dbname = MailDatabase
query = Select IPNummer from MyNetworks where IPNummer = '%s'
expansion_limit = 100

I get the following error on sending an email:
Temporary lookup failure

Of course I've googled extensively, but the usual suspects like the encoding have been tried and give no result.

If anybody can give a pointer to the solution I would be very gratefull.

Best Answer

but since my last upgrade the smtp authentication doesn't work properly

You need to fix this.

mynetworks is not meant to grant outsiders free reign on your mail server system; you should restrict it to localhost 99% of the time.