Configure fail2ban to use route instead of iptables to block connections

Fail2ban route command

Fail2ban uses iptables by default to block incoming connections when they exceed the max.  login retries. The iptables rules used by fail2ban might conflict with other firewall rules, so it might be necessary to reconfigure fail2ban to use the route command for blocking incoming connections. Fail2ban ban using route command To reconfigure fail2ban for using ... Read more

Redirect domains without www (e.g. domain.com) to www.domain.com with apache rewrite rules

Apache www redirect rule

If all your visitors shall access your website with a URL like www.domain.com and not without www, use the following apache rewrite rule for redirecting them. RewriteEngine On RewriteCond %{HTTP_HOST} !^www RewriteRule (.*) http://www.%{HTTP_HOST}$1 [L,R] The apache rewrite rule can be added in a .htaccess file in the website root directory or if you use ... Read more

Send all outgoing email trough one IP address in postfix

When a server has more than one IP address, then postfix will use all IP addresses randomly to send out emails. This can cause your emails to be listed as SPAM on other servers because the sending IP does not match the reverse IP of the server hostname. The solution is to bind postfix to ... Read more

How to open winmail.dat files on Ubuntu and Debian Linux

The winmail.dat file is a container file format used by Microsoft Outlook to send attachments in rich-text formatted emails. To open winmail.dat on Linux, use the tnef utility. Installation sudo apt-get install tnef Usage Open a shell window, navigate to the directory where the winmail.dat file is saved,  then execute the command: tnef winmail.dat to ... Read more

How to Backup/Clear/Restore a SpamAssassin Bayes Database

SpamAssassin Bayes Database

Sometimes you might have to work with the Spamassin Bayes Token database. This is the database that is used by the SpamAssassin Self Learning (Bayesian) Classifier to store the ham and spam tokens. This tutorial will show you how to make a backup of that database. E.g. when you want to move it to a ... Read more