Since iRedMail-0.9.1, it's able to restrict mail users to login from specified IP addresses or networks.
Allowed IP/networks must be separated by comma. If the user tries to log in elsewhere, the authentication will fail the same way as if a wrong password was given.
Below sample usage shows how to restrict mail user
firstname.lastname@example.org to login
from only IP address
172.16.244.1 or network
sql> USE vmail; sql> UPDATE mailbox SET allow_nets='172.16.244.1,192.168.1.0/24' WHERE email@example.com';
To remove this restriction (allow to login from anywhere), just set
value of SQL column
mailbox.allow_nets to NULL. WARNING: It must be NULL,
not empty string.
To allow user
firstname.lastname@example.org to login from IP
172.16.244.1 and network
192.168.1.0/24, please add new attribute
allowNets to this user:
To remove this restriction, just remove attribute
allowNets for this user.