J
jshanley
Guest
Original thread for 7.1.x here for Plesk 7.1.x on FreeBSD. The paths for Horde webmail have changed since 7.1.x, so I probably need to fix that up in the tips, below. Thanks goes out to everyone who posted suggestions/tips in the previous thread.
Don't forget to patch your Plesk server with the hotfixes! This will patch some security vulnerabilities, and fix some bugs. (Hotfix Page)
Hotfix list updated: Dec 20th 2005.
Plesk 7.5.4 on FreeBSD 5.3: Hotfixes: 1 2 3 4 5
Plesk 7.5.4 on FreeBSD 4.9: Hotfixes: 1 2 3 4 5
Improving SMTP speed/performance
Note: They may have fixed this in 7.5.x, but I haven't installed 7.5 on a clean system recently, so I don't remember. I'm leaving this here just in case.
Improving SMTP response time (connections):
By default, Plesk on FreeBSD is pretty slow at establishing SMTP connections. This is because it defaults to doing reverse-dns lookups for all SMTP connections, for no good reason. This can slow down your mail sessions significantly (the default timeout on the reverse DNS lookup is 26 seconds.. per connection, which means if there is no reverse-dns for the mailserver trying to connect to you, it will wait 26 seconds before letting the connection continue). We want to change this behaviour so it instantly connects all SMTP sessions.
Edit /etc/inetd.conf and scroll down to the bottom. The two lines you're looking for start with "smtp" and "smtps".
Here is a short example of what it looks like:
smtp stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env /usr/local/psa/qmail/bin/relaylock ( ... etc)
What you want to do is insert -Rt0 after the second "tcp-env" on both of these lines. Here is an example:
smtp stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env -Rt0 /usr/local/psa/qmail/bin/relaylock
smtps stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env -Rt0 /usr/local/psa/qmail/bin/relaylock
After doing this, kill and restart inetd for the changes to take effect.
Improving default bounce behaviour:
By default, Plesk does not handle double-bounces gracefully. We want to throw away double bounces (bounces that cannot be delivered). We can do this with:
echo "#" > /usr/local/psa/qmail/control/doublebounceto
Increasing the number of concurrent deliveries:
By default, Plesk limits mail to 10 local deliveries at a time, and 20 external deliveries at a time. This is usually insufficient for most hosts, so you can change that behaviour by increasing both to, say, 25. Note: It is best to adjust this according to your own server specs and your needs. For example, if you're running on a slow system with low ram, you probably don't want to increase this... etc.
echo "25" > /usr/local/psa/qmail/control/concurrencylocal
echo "25" > /usr/local/psa/qmail/control/concurrencyremote
After creating these files, restart the qmail service.
TODO: Fixing & Improving SpamAssassin Performance
the file /etc/sysconfig/spamassassin comes as:
SPAMDOPTIONS="-d -u qmailq -c -H /var/qmail"
where the options are:
-d daemon
-u run as user...
-c create users' preferences files
-H work directory...
But it can be improved with:
-x (server, don't check users' files)
-q (users' prefs stores in sql db)
-L (local, don't perform dns checks)
-m10 (10 childs)
so, a very fast and light (but not powerful) config would be:
SPAMDOPTIONS="-d -u qmailq -x -L -m5 -H /var/qmail"
It's important to add the -m10 or -m5 flag, because by default SpamAssassin is not limited - it can spawn 1,000 copies if you're not careful (bringing your server to it's knees). So I always limit the number of spamassassin copies that are allowed to run at once.
TODO: Accelerating the Admin Interface
Haven't tried this on 7.5.x, as the web interface performance increased dramatically between 7.1.x and 7.5.x already. I'll try this later using APC or eAccelerator.
Fixing Webmail Bugs
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
When a user uses the "Password" button/icon in webmail, it stupidly says "Changing password on Example poppassd server". Note: I think they fixed this on 7.5.x, I'll have to check one of my old servers, just in case. I'll leave the tip here until I verify.
Edit: /usr/local/psa/home/vhosts/webmail/horde/passwd/config/backends.php
change the line that says
'name' => 'Example poppassd server', ... to:
'name' => 'this server',
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
When a user uses the "Password" button/icon in webmail, it shows them just the first part of their username instead of the full [email protected] address as their username. So, changing their password doesn't work.
Edit: /usr/local/psa/home/vhosts/webmail/horde/passwd/config/conf.php
Find the line that says:
$conf['hooks']['default_username'] = false; ... and change it to
$conf['hooks']['default_username'] = true;
Now, create a new file called:
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
/usr/local/psa/home/vhosts/webmail/horde/config/hooks.php
In this file, paste the following
Now users can use the Password button in Webmail, and it will work correctly.
Don't forget to patch your Plesk server with the hotfixes! This will patch some security vulnerabilities, and fix some bugs. (Hotfix Page)
Hotfix list updated: Dec 20th 2005.
Plesk 7.5.4 on FreeBSD 5.3: Hotfixes: 1 2 3 4 5
Plesk 7.5.4 on FreeBSD 4.9: Hotfixes: 1 2 3 4 5
Improving SMTP speed/performance
Note: They may have fixed this in 7.5.x, but I haven't installed 7.5 on a clean system recently, so I don't remember. I'm leaving this here just in case.
Improving SMTP response time (connections):
By default, Plesk on FreeBSD is pretty slow at establishing SMTP connections. This is because it defaults to doing reverse-dns lookups for all SMTP connections, for no good reason. This can slow down your mail sessions significantly (the default timeout on the reverse DNS lookup is 26 seconds.. per connection, which means if there is no reverse-dns for the mailserver trying to connect to you, it will wait 26 seconds before letting the connection continue). We want to change this behaviour so it instantly connects all SMTP sessions.
Edit /etc/inetd.conf and scroll down to the bottom. The two lines you're looking for start with "smtp" and "smtps".
Here is a short example of what it looks like:
smtp stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env /usr/local/psa/qmail/bin/relaylock ( ... etc)
What you want to do is insert -Rt0 after the second "tcp-env" on both of these lines. Here is an example:
smtp stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env -Rt0 /usr/local/psa/qmail/bin/relaylock
smtps stream tcp nowait root /usr/local/psa/qmail/bin/tcp-env tcp-env -Rt0 /usr/local/psa/qmail/bin/relaylock
After doing this, kill and restart inetd for the changes to take effect.
Improving default bounce behaviour:
By default, Plesk does not handle double-bounces gracefully. We want to throw away double bounces (bounces that cannot be delivered). We can do this with:
echo "#" > /usr/local/psa/qmail/control/doublebounceto
Increasing the number of concurrent deliveries:
By default, Plesk limits mail to 10 local deliveries at a time, and 20 external deliveries at a time. This is usually insufficient for most hosts, so you can change that behaviour by increasing both to, say, 25. Note: It is best to adjust this according to your own server specs and your needs. For example, if you're running on a slow system with low ram, you probably don't want to increase this... etc.
echo "25" > /usr/local/psa/qmail/control/concurrencylocal
echo "25" > /usr/local/psa/qmail/control/concurrencyremote
After creating these files, restart the qmail service.
TODO: Fixing & Improving SpamAssassin Performance
the file /etc/sysconfig/spamassassin comes as:
SPAMDOPTIONS="-d -u qmailq -c -H /var/qmail"
where the options are:
-d daemon
-u run as user...
-c create users' preferences files
-H work directory...
But it can be improved with:
-x (server, don't check users' files)
-q (users' prefs stores in sql db)
-L (local, don't perform dns checks)
-m10 (10 childs)
so, a very fast and light (but not powerful) config would be:
SPAMDOPTIONS="-d -u qmailq -x -L -m5 -H /var/qmail"
It's important to add the -m10 or -m5 flag, because by default SpamAssassin is not limited - it can spawn 1,000 copies if you're not careful (bringing your server to it's knees). So I always limit the number of spamassassin copies that are allowed to run at once.
TODO: Accelerating the Admin Interface
Haven't tried this on 7.5.x, as the web interface performance increased dramatically between 7.1.x and 7.5.x already. I'll try this later using APC or eAccelerator.
Fixing Webmail Bugs
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
When a user uses the "Password" button/icon in webmail, it stupidly says "Changing password on Example poppassd server". Note: I think they fixed this on 7.5.x, I'll have to check one of my old servers, just in case. I'll leave the tip here until I verify.
Edit: /usr/local/psa/home/vhosts/webmail/horde/passwd/config/backends.php
change the line that says
'name' => 'Example poppassd server', ... to:
'name' => 'this server',
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
When a user uses the "Password" button/icon in webmail, it shows them just the first part of their username instead of the full [email protected] address as their username. So, changing their password doesn't work.
Edit: /usr/local/psa/home/vhosts/webmail/horde/passwd/config/conf.php
Find the line that says:
$conf['hooks']['default_username'] = false; ... and change it to
$conf['hooks']['default_username'] = true;
Now, create a new file called:
Note: The path to webmail files has changed since 7.1.x, I still need to change this tip to reflect that.
/usr/local/psa/home/vhosts/webmail/horde/config/hooks.php
In this file, paste the following
Code:
<?php
/**
* Horde Hooks configuration file.
**/
if (!function_exists('_passwd_hook_default_username')
) {
function _passwd_hook_default_username($userid)
{
return $userid;
}
}
/** DO NOT PLACE A ?> AT THE END OF THIS FILE **/
Now users can use the Password button in Webmail, and it will work correctly.