Mysql – Postfix email server, using thesql for thenetworks

MySQLpostfix

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 main.cf
For dynamically allocated IP adresses, or employees of my clients working from home, this gives the problem that I have to manually adjust the main.cf 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/mysql-virtual-mailbox-domains.cf

virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf

virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,mysql:/etc/postfix
/mysql-email2email.cf

But if I use:

mynetworks = mysql:/etc/postfix/mysql-mynetworks.cf

which contains:

user = MailUserName
password = MailUserPassWord
hosts = 127.0.0.1
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.