PleskHacker http://pleskhacker.com Detailed documentation of the Plesk database Thu, 03 Jun 2010 13:00:52 +0000 en-US hourly 1 http://wordpress.org/?v=3.4.2 Enable user management of spam filteringhttp://pleskhacker.com/sql-queries/enable-user-management-of-spam-filtering/ http://pleskhacker.com/sql-queries/enable-user-management-of-spam-filtering/#comments Tue, 09 Dec 2008 01:24:44 +0000 major http://pleskhacker.com/?p=313 If you want to enable user-level management of spam filters in Plesk for all users that have spamassassin enabled, you can use this query:

INSERT INTO Permissions (id,permission,value) 
SELECT perm_id,'manage_spamfilter',true FROM mail WHERE spamfilter = true;

Thanks to Ortak ve Şirket Müdürü for the submission!

]]>
http://pleskhacker.com/sql-queries/enable-user-management-of-spam-filtering/feed/ 0
Find all databases and login credentialshttp://pleskhacker.com/sql-queries/find-all-databases-and-login-credentials/ http://pleskhacker.com/sql-queries/find-all-databases-and-login-credentials/#comments Tue, 09 Dec 2008 01:18:53 +0000 major http://pleskhacker.com/?p=308 If you need to list all of the MySQL databases managed by Plesk along with their corresponding domains and login credentials, you can use this handy query:

SELECT domains.name AS domain_name,
data_bases.name AS database_name, db_users.login, accounts.password
FROM data_bases, db_users, domains, accounts
WHERE data_bases.dom_id = domains.id
AND db_users.db_id = data_bases.id
AND db_users.account_id = accounts.id
ORDER BY domain_name;

Thanks to Juan Carlos Lopez for the suggestion!

]]>
http://pleskhacker.com/sql-queries/find-all-databases-and-login-credentials/feed/ 0
Find Plesk domains exceeding quotashttp://pleskhacker.com/sql-queries/find-domains-over-quota-in-plesk/ http://pleskhacker.com/sql-queries/find-domains-over-quota-in-plesk/#comments Fri, 26 Sep 2008 03:31:25 +0000 major http://pleskhacker.com/?p=299 Find domains that are over quota on disk space in Plesk:

SELECT domains.name, domains.real_size, Limits.value
FROM domains, Limits
WHERE domains.limits_id = Limits.id
AND domains.real_size > Limits.value
AND limit_name = 'disk_space'
AND Limits.value != -1
ORDER BY domains.name ASC;
]]>
http://pleskhacker.com/sql-queries/find-domains-over-quota-in-plesk/feed/ 0
Get Plesk FTP account passwordshttp://pleskhacker.com/sql-queries/get-ftp-account-passwords/ http://pleskhacker.com/sql-queries/get-ftp-account-passwords/#comments Fri, 26 Sep 2008 03:21:56 +0000 major http://pleskhacker.com/?p=294 Display all of the FTP usernames and passwords in Plesk:

SELECT REPLACE(sys_users.home,'/home/httpd/vhosts/','') AS domain,
sys_users.login,accounts.password FROM sys_users
LEFT JOIN accounts on sys_users.account_id=accounts.id
ORDER BY sys_users.home ASC;
]]>
http://pleskhacker.com/sql-queries/get-ftp-account-passwords/feed/ 0
Get e-mail account passwordshttp://pleskhacker.com/sql-queries/get-e-mail-account-passwords/ http://pleskhacker.com/sql-queries/get-e-mail-account-passwords/#comments Fri, 26 Sep 2008 03:13:15 +0000 major http://pleskhacker.com/?p=286 Get all e-mail account passwords:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts 
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
ORDER BY domains.name ASC,mail.mail_name ASC;

Get e-mail account passwords that are made up of only letters:

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
AND accounts.password RLIKE BINARY '^[a-z]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Get e-mail account passwords that are made up of only letters

SELECT CONCAT_WS('@',mail.mail_name,domains.name),accounts.password
FROM domains,mail,accounts
WHERE domains.id=mail.dom_id AND accounts.id=mail.account_id 
AND accounts.password RLIKE  '^[0-9]+$'
ORDER BY domains.name ASC,mail.mail_name ASC;

Find domains that are using catch-all accounts:

SELECT d.name AS domains, p.value AS catchall_address
FROM Parameters p, DomainServices ds, domains d
WHERE d.id = ds.dom_id AND ds.parameters_id = p.id AND p.parameter = 'catch_addr'
ORDER BY d.name
]]>
http://pleskhacker.com/sql-queries/get-e-mail-account-passwords/feed/ 0
Add SpamAssassin filtering for all Plesk usershttp://pleskhacker.com/sql-queries/add-spam-filtering-for-all-plesk-users/ http://pleskhacker.com/sql-queries/add-spam-filtering-for-all-plesk-users/#comments Fri, 26 Sep 2008 03:10:29 +0000 major http://pleskhacker.com/?p=282 Enable SpamAssassin for all domains in Plesk:

UPDATE mail SET spamfilter = 'true' WHERE postbox = 'true';

Rewrite the mail configuration files:

/usr/local/psa/admin/bin/mchk --with-spam
]]>
http://pleskhacker.com/sql-queries/add-spam-filtering-for-all-plesk-users/feed/ 0
Enable piped logs in Apachehttp://pleskhacker.com/sql-queries/enable-piped-logs-in-apache/ http://pleskhacker.com/sql-queries/enable-piped-logs-in-apache/#comments Fri, 26 Sep 2008 02:56:20 +0000 major http://pleskhacker.com/?p=271 Run the following MySQL query:

REPLACE INTO psa.misc (param,val) VALUES ('apache_pipelog', 'true');

Rebuild the Apache configuration files:

/usr/local/psa/admin/sbin/websrvmng -av

Restart Apache:

/etc/init.d/httpd restart
]]>
http://pleskhacker.com/sql-queries/enable-piped-logs-in-apache/feed/ 0
psa.spamfilter_preferenceshttp://pleskhacker.com/all-tables/psaspamfilter_preferences/ http://pleskhacker.com/all-tables/psaspamfilter_preferences/#comments Fri, 26 Sep 2008 02:32:43 +0000 major http://pleskhacker.com/?p=269 Overview
The spamfilter_preferences table contains detailed preferences for spam filtering per e-mail account.

Column Descriptions
prefid – primary key that is automatically incremented
spamfilter_id – links to id in spamfilter table
preference – keyword parameter
value – value which corresponds to the keyword parameter

Table Structure

CREATE TABLE `spamfilter_preferences` (
 `prefid` int(10) unsigned NOT NULL auto_increment,
 `spamfilter_id` int(10) unsigned NOT NULL default '0',
 `preference` varchar(30) character set ascii NOT NULL default '',
 `value` varchar(255) character set utf8 NOT NULL default '',
 PRIMARY KEY  (`prefid`),
 KEY `spamfilter_id` (`spamfilter_id`,`preference`,`value`)
) ENGINE=InnoDB AUTO_INCREMENT=1531 DEFAULT CHARSET=latin1
]]>
http://pleskhacker.com/all-tables/psaspamfilter_preferences/feed/ 0
psa.spamfilterhttp://pleskhacker.com/all-tables/psa_spamfilter/ http://pleskhacker.com/all-tables/psa_spamfilter/#comments Fri, 26 Sep 2008 02:28:44 +0000 major http://pleskhacker.com/?p=266 Overview
The spamfilter table contains the basic configuration for spam filtering per e-mail account.

Column Descriptions
id – primary key that is automatically incremented
username – e-mail account that has spam filtering enabled
preferencestrue if the e-mail account has account-level preferences, otherwise false
reject_spamtrue if spam should be thrown away, otherwise false

Table Structure

CREATE TABLE `spamfilter` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `username` varchar(128) character set ascii NOT NULL default '',
 `preferences` enum('false','true') NOT NULL default 'false',
 `reject_spam` enum('false','true') NOT NULL default 'false',
 PRIMARY KEY  (`id`),
 UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=636 DEFAULT CHARSET=latin1
]]>
http://pleskhacker.com/all-tables/psa_spamfilter/feed/ 0
psa.BackupsObjectshttp://pleskhacker.com/all-tables/domains-all-tables/psabackupsobjects/ http://pleskhacker.com/all-tables/domains-all-tables/psabackupsobjects/#comments Fri, 26 Sep 2008 02:25:07 +0000 major http://pleskhacker.com/?p=264 Overview
The BackupsObjects table contains information about completed backups.

Column Descriptions
id – primary key that is automatically incremented
obj_id – links to id in clients or domains table, depending on obj_type column
obj_type – type of data being backed up; can be client or domain

Table Structure

CREATE TABLE `BackupsObjects` (
 `id` int(10) unsigned NOT NULL auto_increment,
 `obj_id` int(10) unsigned NOT NULL default '0',
 `obj_type` enum('client','domain') NOT NULL default 'client',
 PRIMARY KEY  (`id`,`obj_id`,`obj_type`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1
]]>
http://pleskhacker.com/all-tables/domains-all-tables/psabackupsobjects/feed/ 0