Alright, so I now have a functioning mail server after following this tutorial. I would like to extend the functionality a little bit.
Primarily, I have added an 'enabled' field to the 'user' table in the database. It is assigned a tiny integer which I store either a 0 for disabled or 1 for enabled.
I would like Postfix to use this additional field in the query. I would eventually like to do the same thing with entire domains, but my priority right now is at the user level.
I thought the appropriate file that needed revision to extend the functionality was /etc/postfix/mysql-virtual_mailboxes.cf. I tried both of the following and performed a restart of Postfix. I then tested my login through Squirrelmail after setting the value of the 'enabled' field to 0 on a test account. I could still login which isn't what I was expecting.
Code:
user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s' AND enabled=1
hosts = 127.0.0.1
Code:
user = mail_admin
password = mail_admin_password
dbname = mail
query = SELECT CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/') FROM users WHERE email='%s'
hosts = 127.0.0.1
additional_conditions = and enabled=1
Any help would be appreciated.
Thanks.
Recent comments
1 day 15 hours ago
1 day 17 hours ago
2 days 5 hours ago
2 days 8 hours ago
2 days 12 hours ago
2 days 18 hours ago
3 days 4 hours ago
3 days 5 hours ago
3 days 14 hours ago
3 days 15 hours ago