FreeBSD Plesk Tips

Improving SMTP speed/performance
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.

echo "25" > /usr/local/psa/qmail/control/concurrencylocal
echo "25" > /usr/local/psa/qmail/control/concurrencyremote

After creating these files, restart the qmail service.

Fixing Webmail Bugs
When a user uses the "Password" button/icon in webmail, it stupidly says "Changing password on Example poppassd server"

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',

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@domain.com 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']['defaultusername'] = false; ... and change it to
$conf['hooks']['default
username'] = true;

Now, create a new file called:

/usr/local/psa/home/vhosts/webmail/horde/config/hooks.php

In this file, paste the following

if (!functionexists('passwdhookdefaultusername'))
{
function _passwd
hookdefaultusername($userid)
{
return $userid;
}
}

Now users can use the Password button in Webmail, and it will work correctly.

Adding Spell Check to Webmail

First, install aspell or ispell from ports:

/usr/ports/textproc/ispell
/usr/ports/textproc/aspell

Edit: /usr/local/psa/home/vhosts/webmail/horde/imp/config/conf.php

Find the line:

$conf['utils']['spellchecker'] = ''; ... and replace it with something like
$conf['utils']['spellchecker'] = '/usr/local/bin/aspell';

FTP Connection Speed Tuning Initial FTP connections are extremely slow for many people, once again because by default, Plesk does a reverse-dns lookup on client IPs before connecting them. This is useless and makes your server look like it's running slow. To fix this:

Edit the file:

/usr/local/psa/ftpd/etc/proftpd.include

... and add the following lines to it:

IdentLookups off
UseReverseDNS off
Quotas on
AllowStoreRestart on
AllowRetrieveRestart on
TimeoutNoTransfer 900
TimeoutIdle 1800