Filter mail attachments in Postfix

You can prevent Postfix from sending and receiving mails containing certain mail attachments – such as .exe, .bat, .pif files etc. Therefore you just have to add the following line to /etc/postfix/main.cf:  mime_header_checks=pcre:/etc/postfix/header_check Now we have to create the header_check file that we're referencing above. It contains a regular expression and therefore you need postfix-pcre installed: […]


Installing PureFTPd with MySQL Backend on Gentoo

The FTP accounts will be stored in a mysql database table.  First let's install pureftpd: USE="pam ssl mysql" emerge pure-ftpd Once the installation is finished, there are 2 main configuration files in /etc/conf.d:   /etc/conf.d/pure-ftpd IS_CONFIGURED="yes" # the server won't start up if set to "no" SERVER="-S 21" # server port MAX_CONN="-c 30" # maximum number […]


ProFTPd with MySQL Backend on Debian

First of all we install the needed packages: apt-get install proftpd proftpd-mysql mysql-server The configuration files of the proftpd server are in /etc/proftpd.   First we edit the file /etc/proftpd/modules.conf and insert/uncomment the following lines: LoadModule mod_sql.c LoadModule mod_sql_mysql.c   Then we should create the mysql database and the table that will contain the proftpd users: CREATE DATABASE […]


SFTP Server with chroot on Debian

On Debian Etch, if you want to have a chroot'ed environment, a simple way to implement this is using mySecureShell. First we need to install some dependancies: apt-get install libssl0.9.7 ssh openssh-server   Then we install mySecureShell itself: wget https://www.devops.zone/wp-content/uploads/attachments/mysecureshell_0.95_i386.deb dpkg -i mysecureshell_0.95_i386.deb Now, to activate the new shell for a user, to have to modify the […]


Connecting to SSH via public keys

A secure way to connect to distant servers without using a password all the time is connecting via public keys. On the source system we first need to create the key pairs using: ssh-keygen -t rsa (on Linux and Mac you do not need to install anything, on Windows, you should use PuttyGen) If you're doing […]


Postfix mit mySQL Courier-Konfiguration

postfix,mysql,courier,imap,smtp,main.cf,auth,aliases,destination,recipient_canonical,sender_canonical,transport,forwarding Vorbemerkung: Dieses Tutorial ist mit dem CourierIMAP-Tutorial kombinierbar.   Mit apt-get install postfix postfix-mysql kann man die benötigten Pakete installieren. Dies ist eine Beispielkonfiguration von Postfix mit mySQL als Backend:   /etc/postfix/main.cf smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no append_dot_mydomain = no delay_warning_time = 2h bounce_queue_lifetime = 1d transport_retry_time = 10s trigger_timeout […]


Courier IMAP mit mySQL

Ok, zu allererst installieren wir die benötigten Pakete: apt-get install courier-authdaemon courier-authlib courier-authlib-mysql courier-base courier-imap   Nachfolgend erläutere ich eine Multi-Domain-Konfiguration für den Courier-IMAP-Server. Die Authentifizierung der Benutzer erfolgt über mySQL. So wird das Anlegen und Verwalten neuer Benutzer stark vereinfacht.   Die mySQL-Tabelle für die Benutzerauthentifierung sieht in dieser Konfiguration folgendermaßen aus: CREATE TABLE […]


Debian apt Basics

Here I'd like to show the most important commands for the installation of packages and updates on your Debian system. The package manager on Debian is apt.   The repositories from which you can install packages and updates is /etc/apt/sources.list. Here's an example:   /etc/apt/sources.list: deb http://ftp.de.debian.org/debian/ etch main deb-src http://ftp.de.debian.org/debian/ etch main deb http://security.debian.org/ […]


Web Projects with Subversion

In this tutorial I'd like to show how you can setup subversion for your web projects. I've installed it on Debian Etch, but this Tutorial also works on newer versions (Lenny, Squeeze).   For the installation you need root privileges. First of all the necessary packets have to be installed: apt-get install subversion subversion-tools   […]


The file /etc/mtab explained

  All mounted drives on your system with their options are listed in the file /etc/mtab. This file is automatically generated and updated.   The options in the right order: Drive Mount point File system Options Dump Check   An example: dev/sda2 / ext3 rw,errors=remount-ro 0 0 tmpfs /lib/init/rw tmpfs rw,nosuid,mode=0755 0 0 proc /proc […]