Search left

Archive for the ‘Debian’ Category


Courier-IMAP-SSL/TLS: Thunderbird error



The problem: Using an IMAP TLS mail account on Thunderbird could give an error:

Thunderbird can’t connect securely to because the site uses a security protocol which isn’t enabled.

Why: Looking at the the maillog (tail -f /usr/local/psa/var/log/maillog) we got:

imapd: couriertls: accept: error:1408A10B:SSL routines:SSL3_GET_CLIENT_HELLO:wrong version number

Solution: Edit /etc/courier-imap/imapd-ssl and check the values to match this:

# TLS_PROTOCOL sets the protocol version.
TLS_PROTOCOL=SSL23

# TLS_STARTTLS_PROTOCOL is used instead of TLS_PROTOCOL for the IMAP STARTTLS extension, as opposed to IMAP over SSL on port 993.
TLS_STARTTLS_PROTOCOL=TLS1

It seems that these two TLS protocol directives do not want to be identical.

Reload the IMAP daemon and QMail daemon, and the problem shoud be gone:

/etc/init.d/qmail restart
/etc/init.d/courier-imap restart

Have fun :)


Posted on October 7th, 2009 in Debian, Linux, Plesk | 1 Comment »



How to recalculate traffic and disk usage in Plesk Unix



The problem: There are some updates on client files, but the changes are not seen in Plesk interface.

Why: Plesk counts statistics once a day (at 4:07 AM by default) with the help of the {Plesk_installation_dir}/admin/sbin/statistics utility, but not every time when you look at domain statistics. (see http://kb.parallels.com/en/752).

The solution: To update traffic and disk usage for all clients, run:

/usr/local/psa/admin/sbin/statistics

To update traffic and disk usage for a single domain, run:

/usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=domainname.com

Now, refresh Plesk interface to see the changes :)


Posted on September 21st, 2009 in Debian, Linux, Plesk | No Comments »



Plesk 8.6.0 inetd changes



On 28 July 2008, Parallels have released Parallels Plesk Control Panel 8.6.0.

It seems (for unknown reasons) that they changed from xinetd config files to the old inetd style. There’s no more /etc/xinetd.d/smtp_psa files and alike, instead Plesk is now using /etc/inetd.conf.

Keep this in mind when upgrading from ealier version, could save some time and problems :)


Posted on August 13th, 2008 in Debian, Linux, Plesk | 1 Comment »



How to trim/pack Spamassassin´s auto-whitelist



The problem: if a mailbox has spam filtering enabled, Spamassasin creates and maintain an auto-whitelist for each of it, and this file increases in time. Generally, every admin wants to trim it or limit it’s size.

Solution 1: On Debian Etch servers running Plesk / QMail & Spamassassin, each mail user has it’s own config files /var/qmail/mailnames/domain/user/.spamassassin. You can add bayes_expiry_max_db_size to each user local.cf or default.cf, but it’s not a global solution and it’s hard to maintain to new users.

Solution 2: Another approach is to run a job (let’s say weekly) to automatically trim the auto-whitelist for all mail users on the server. It’s fast, easy … and you can forget about this in the cron job ;)

After a bit of googling, we found a script to trim old and unused records from an auto-whitelist file here. (in the rest of the article, we’ll assume that the above script is saved as /root/bin/trim-spamassasin-auto-whitelist and it’s made executable with chmod +x)

So far, so good, but the above script works on only one given auto-whitelist.

We can use some bash/sh scripting to find all the mail users settings and apply the trimming to every file, as follows:

#!/bin/sh

# Trim old records and unused space from mail users's .spamassasin/auto-whitelist
# (c) 2008 Frontline softworks, www.frontline.ro
# Visit http://sandbox.frontline.ro for updates

# Trim Utility Location
# Get if from http://www.deepnet.cx/~kdeugau/spamtools/trim_whitelist
TrimUtility='/root/bin/trim-spamassasin-auto-whitelist'

# Users mail storage folder
UsersMail='/var/qmail/mailnames/'

# Auto-whitelist file name
AutoFileName='auto-whitelist'

# Find all Plesk users auto-whitelist
for file in `find $UsersMail -type f -name $AutoFileName`; do
    # Run the trim tool on this mailbox
    # See http://www.deepnet.cx/~kdeugau/spamtools/trim_whitelist
    $TrimUtility $file;

    # After the file is trimmed, there is an '-old' file which we don't need it anymore
    if [ -e $file'-old' ]; then
        rm $file'-old';
    fi;
done

Save the above script in /etc/cron.weekly and wait for the weekly run.

Have fun playing …


Posted on May 13th, 2008 in Debian, Linux, Plesk | 1 Comment »



How to run the SMTP server on another port



The problem: Many ISP’s block port 25 for outgoing mail. So if you are running a Linux/Unix Plesk based server (or, in fact, any kind of SMTP server), your clients can be in a situation where they can receive mail (POP3/110) from your server, but they can’t send mail (SMTP/25) from their mail client using your server.
Note: Generally, the ISP will “kindly” give you the opportunity to use their SMTP/IMAP server, but this can be a risk.

Solution 1: Tell you clients to use Plesk’s Webmail. Or not … and skip to the second solution :)

Solution 2: Use another port for the SMTP server, keeping the server to accept connections on standard port 25.
In this way, the SMTP / Plesk’s Qmail server will accept connections on two different ports, using a simple port redirection. We’ll use one iptables rule, with 587 as the second port, like this:

sudo iptables -t nat -A PREROUTING -p tcp --dport 587 -i eth0 -j REDIRECT --to-ports 25

Also, it would be a good idea to add this to add it to system startup or to your firewall, to avoid loosing these settings after reboot.
For example, on any Debian based system, you can add it to /etc/rc.local:

sudo echo "# Port redirection from port 587 to 25, on eth0
/sbin/iptables -t nat -A PREROUTING -p tcp --dport 587 -i eth0 -j REDIRECT --to-ports 25" >> /etc/rc.local

Notes:
1: You can choose any other port, replace 587 with the port you want to use.
2: Don’t forget to open this port in your firewall.
3. Don’t forget to tell your clients about this, and maybe … be a sport and give them a helping hand in the long process of configuring the mail client :D

Have fun playing …


Posted on February 14th, 2008 in Debian, Linux, Plesk | No Comments »



 



Footer left Footer right