P
philb@
Guest
Ok, after fighting with a migration where a lot of mailboxes had SA disabled by default, I did some digging into the cause.
WARNING, YOU WILL BE DIRECTLY MANIPULATING DATA IN MYSQL IF YOU FOLLOW THIS PROCEDURE. IF YOU BREAK YOUR SERVER, IT'S YOUR PROBLEM, NOT MINE. MAKE A BACKUP FIRST.
There is a table in psa named sa_conf. it was missing the mail names for the accounts that were locked.
To view it, you can do this:
mysql -u admin -p
You will have to answer the password prompt with your Plesk admin password.
then
use psa;
next, you can view the table in question with
select * from sa_conf;
If the mailboxes that are locked away from SA are also missing from this list, that is the problem. Paste the following mysql command and run it and it will put all mailboxes that are defined on your machine into the table IF THEY ARE MISSING.
insert into sa_conf (mailname) select concat(mail.mail_name,'@',domains.name) from mail left join domains on domains.id = mail.dom_id where concat(mail.mail_name,'@',domains.name) not in (select mailname from sa_conf);
This command takes all of the mailbox names in the master mailbox table and joins it to the information in the domains table with an @ in the middle to form a full mailbox name.
Then, it inserts them into the sa_conf table only if they are not already there. If you run the command twice, it will insert no rows. You should be able to run this command at any time to insert the Spam Assassin control information into Plesk.
Once you have done this, run this command to see if your sa_conf information is now correct:
select * from sa_conf;
You should now see the missing mailboxes in the list.
You are done!
WARNING, YOU WILL BE DIRECTLY MANIPULATING DATA IN MYSQL IF YOU FOLLOW THIS PROCEDURE. IF YOU BREAK YOUR SERVER, IT'S YOUR PROBLEM, NOT MINE. MAKE A BACKUP FIRST.
There is a table in psa named sa_conf. it was missing the mail names for the accounts that were locked.
To view it, you can do this:
mysql -u admin -p
You will have to answer the password prompt with your Plesk admin password.
then
use psa;
next, you can view the table in question with
select * from sa_conf;
If the mailboxes that are locked away from SA are also missing from this list, that is the problem. Paste the following mysql command and run it and it will put all mailboxes that are defined on your machine into the table IF THEY ARE MISSING.
insert into sa_conf (mailname) select concat(mail.mail_name,'@',domains.name) from mail left join domains on domains.id = mail.dom_id where concat(mail.mail_name,'@',domains.name) not in (select mailname from sa_conf);
This command takes all of the mailbox names in the master mailbox table and joins it to the information in the domains table with an @ in the middle to form a full mailbox name.
Then, it inserts them into the sa_conf table only if they are not already there. If you run the command twice, it will insert no rows. You should be able to run this command at any time to insert the Spam Assassin control information into Plesk.
Once you have done this, run this command to see if your sa_conf information is now correct:
select * from sa_conf;
You should now see the missing mailboxes in the list.
You are done!