Plesk TLS

Posted by alex almazan Mon, 21 Jul 2008 08:21:22 GMT

The following syntax will help determine any issues with the certificates loaded for TLS: -
openssl s_client -connect 127.0.0.1:25 -starttls smtp -debug

Your mileage will vary

Plesk Mail reciept

Posted by alex almazan Mon, 14 Apr 2008 13:48:29 GMT

This command syntax evaluates the Plesk maillogs and gives an account of the domains recieveing the most mail

cat /usr/local/psa/var/log/maillog | grep -o 'to=.*@.*' | sed 's/to=.*@//' | sort | uniq -c | sort -rn | head 

Users and Groups

Posted by alex almazan Sun, 13 Apr 2008 07:53:00 GMT

/etc/passwd File contains the configuration info for loacl users in the following format(world readable):
username : x: UID:GID:GECOS:homedir:shell

/etc/shadow File contains the username (which must match /etc/passwd) and the users MD5 encrypted password (only readable by root)

/etc/group file contains the configuration for local groups in the following format

groupname :x: GID : secondary users

/etc/gshadow file contains a list of groups on the server and their MD5 encrypted passwords.

useradd used to add new users
usermod used to modify the attributes of the user
groupadd used to add new group to server
groupmod used to change group attributes
passwd used to create or change user passwords
chage command used to create/edit password aging

Locating files with Special Permissions/attributes

find . / -perm +4000 |less
find root owned
find / -perm +2000  | less
get all GID/SUiD
find / -perm +1000 (sticky bit)
can be (used to find 777)

Setuid Suid Set UserID is used on Unix systems for tasks that require higher privileges. Has greatest impact on executable files.

chmod u+s <file>
setgid
chmod g+s  
or
chmod 2770 /some/directory
assigns group ownership to directories

example

Configure the users mike,chris and jamie

make these users part of the ru group
useradd -s /sbin/nologin ru
useradd chris -G ru -p '    ' 
(grub-md5-crypt can be used to generate system passwords)

configure the directory /home/ru so that each user can read,create, and modify files.

chmod 2770 /home/ru 
or
chmod u+s /home/ru

Plesk log rotate

Posted by alex almazan Sun, 13 Apr 2008 06:46:00 GMT

Here is a query to be run against the psa database for rotating all logs for hosted Apache domains. Ensure that use issue ‘database psa’ prior to running the join

mysql>  select a.*,b.name from log_rotation a join domains b on a.id=b.id where turned_on="true";

Required Score and Plesk

Posted by alex almazan Sun, 13 Apr 2008 06:32:00 GMT

Plesk Spamassassin permits the establishment of ‘personal settings’ for individual configured mail users. Problems arise as the default configure ‘required_score’ value for calssifying spam defaults to ‘7’. This is a quick means of changing the score for all hosted mail users from 7.00 to 4.00:

Get to the SQL CLI as the Plesk admin user and inspect the current established settings

[root@server1 log]# mysql -uadmin -p`cat /etc/psa/.psa.shadow` psa

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 7578332 to server version: 4.0.18-Max

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select * from spamfilter_preferences where preference='required_score';

This should display all user settings. You may have to issue something similar to the following query to get those with a score of 4.00 or higher

mysql> select * from spamfilter_preferences where preference='required_score'&& value != '4.00';

Use an update statement to change the values in the database table

mysql>  update spamfilter_preferences set value='4.00' where value='7.00';

It is also adviseable to set spamassassin to reject messages tagged as spam. To do so, issue the following via the SQL cli.

mysql>update spamfilter set reject_spam='true' where reject_spam='false';

Once this is all in place, you must use ‘mchk’ to re-issue the .qmail files

[root@server1 log]#/usr/local/psa/admin/bin/mchk --with-spam

Once this is finished, issue

[root@server1 log]#service qmail restart && service psa-spamassassin restart && service xinetd restart && service courier-imap restart 

The scores should now be at the value selected.

Older posts: 1 2 3