Plesk: Train SpamAssassin and apply to all accounts server-wide

Ripped from here

chose an email account on the server to act as the model for SpamAssassin training. Using IMAP, create a SPAM and a HAM folder for this account. Copy messages that are spam into the SPAM folder and likewise for HAM. Run the following commands on the command-line, substituting the domain and user names where appropriate:

sa-learn –spam /var/qmail/mailnames/domain/user/Maildir/.SPAM/*

sa-learn –ham /var/qmail/mailnames/domain/user/Maildir/.HAM/*

After sufficient training, you’ll need to copy the resulting bayes_* files into each email account directory on the server (if you want to use this model’s training data server-wide, of course). Consider using the following one-liner to do this:

find /var/qmail/mailnames -type d -mindepth 2 -maxdepth 2 -exec cp -f /var/qmail/mailnames/domain/user/.spamassassin/bayes_* {}/.spamassassin/ \;

The above assumes a .spamassassin directory for each user

Posted in plesk | Leave a comment

Plesk: Configure domain to use external mail server

From inside the control panel at the domain’s DNS section:

Remove the default CNAME record for mail.domain.com.

Then create an A record for mail.domain.com to point to the IP address of the external mail server.

Since remote mailserver functionality is not currently supported by PSA, all instances of that domain must be removed from the virtualdomains and rcpthosts files located in the /usr/local/psa/qmail/control/ directory. These files are located in the /var/qmail/control/ directory for the RPM build.

Once the changes have been made PSA needs to be stopped then started.

Posted in plesk | Tagged , | 2 Comments

Plesk: Improve SMTP speed

Edit
/etc/xinetd.d/smtp_psa

Add “-Rt0″ to “server_args”.
It will then look like this:

server_args = -Rt0 /var/qmail/bin/relaylock /var/qmail/bin/qmail-smtpd /var/qmail/bin/smtp_auth /var/qmail/bin/true /var/qmail/bin/cmd5checkpw /var/qmail/bin/true

Save the file, and restart xinetd:
/etc/init.d/xinetd restart

Posted in plesk | 4 Comments

Linux: proftpd, iptables, and passive ftp

Should work for FC, RHEL, CENTOS, and any other Redhat derivative distro:

Here is the quick fix. Edit 2 files and restart proftpd and iptables. This resolved all my FTP issues for all my clients in one nice swoop on my CENTOS 5 server.

edit /etc/sysconfig/iptables-config

IPTABLES_MODULES=”ip_nat_ftp”

edit /etc/proftpd.conf

#replace xxx.xxx.xxx.xxx with your server IP

MasqueradeAddress xxx.xxx.xxx.xxx

#for passive data channels

PassivePorts 1024 65535

Posted in linux | 2 Comments