Dovecot and IP check at the user connection (auth-worker problems: no IP...)
Hi to all, I'm using Postfix and Dovecot for my little server. I'm experimenting many false user caming fron the entire world to access to my account. I'm only in a country and I would like to restrict accesso to user coming from IPs located in my country.
Since the access is granteg by mysql and SQL in passdb and userdb, I've created a table with only the IPs of my country and check the user remote IP. The trick is working well when I try to access to my account beacuse the variable "%r" is not empy... But...
But when there is a delivery of a new message, the auth-worker have no IP and the check fail: auth-worker<5>: sql(user@my.domain): unknown user
and the new message, coming in my box from other servers come back to the sender as "unknown user"
There is a way to user a different query in this auth-worker process (I guess is using the same SQL with the IP-check)? Or "force" an IP (like 127.0.0.1) in the auth-worker invocation?
Thanks in advance for any advice.
Thanks to all for paying attention... I've found a solution :-) The SQL query are two: one fo password and other for user... is enough to check the IP on the first only...
And all run like a rocket!
participants (1)
-
ik7xja@gmail.com