Deutsch
2014-10-22

Content

Konfiguration eines Mailservers unter Eisfair

Schwerpunkt liegt auf der Verteilung der E-Mails auf die verschiedenen Benutzer von einem zentralen POP3-Konto als Multidrop-Mailbox bei 1&1

 

Stand der Dinge:

Alle E-Mails sind als Weiterleitung in einem POP3-Postfach angekommen. Dieses Postfach wurde zentral von einem Mitarbeiter mit Outlook Express abgeholt. Dazu wählte er sich mit einem FLI4L-Router über ISDN ins Internet ein. Danach wurden E-Mails die für bestimmte Mitarbeiter gedacht waren ausgedruckt und ins Postfach gelegt.

 

Zielsetzung:

Um allen Mitarbeitern Zugriff auf Ihre E-Mail-Konten zu eröffnen sollte ein eigener E-Mail Server ins Firmennetzwerk integriert werden. Ausgewählt wurde das EISFAIR Projekt das alle nötigen Vorrausetzungen mitbringt.

 

* IMAP

* Webmail (damit jeder Mitarbeiter unabhängig vom Computer-Arbeitsplatz auf seine Mails zugreifen kann)

* endlich DSL

 

Installiert wurde auf einem Pentium 100 mit 32 MB RAM und einer 3,6 GB Festplatte der EISFAIR 1.0.4 mit fast allen wichtigen Paketen.

 

* installiert wurde das Mail-Paket (1.1.6) mit Webmail (1.0.2)

* bei unserem Provider 1&1 besteht eine eigene Domain „firma.de“

* alle E-mail adressen lauten also z.b. max.mustermann@firma.de

 

Alle ausgehenden Mails sollen über den smtp-Host von Puretec ausgeliefert werden (würde zwar theoretisch auch vom eigenen SMTP gehen, aber so wie ich das verstanden habe nehmen die Mailserver nur Mails von SMTPs an die sie „kennen“. Da wir immer eine wechselnde IP Adesse haben funzt das nicht) ->Siehe Smarthost

 

Ausführung

Alle Mail-User müssen als Eisfair-User bestehen, d.h. vorher User im Setup anlegen, bzw. es muss ein Alias definiert worden sein, der auf ein existierendes Postfach zeigt. Alle Accounts müssen in Kleinbuchstaben eingerichtet werden.

Für alle Mails die nicht an einen User direkt adressiert sind soll das öffentliche Postfach verwendet werden, das alle User einsehen können.Nicht alle Einträge werden in diesem Howto kommentiert. Dafür gibt es die umfangreiche Dokumentation. Die Einträge die ich hier kommentiere sind speziell für mein Projekt wichtig gewesen.

 

pop3: general settings

Pop3 und Imap wird gestartet

 

# pop3/imap: mail users and optional passwords

Es werden sechs Imap Postfächer angelegt

 

IMAP_PUBLIC_FOLDER

In diesen Ordner sollen alle E-mail weitergeleitet werden die an die Adresse office(at)firma.de adressiert sind. Auf diesen Ordner können alle Mitarbeiter zugreifen. Mit Squirrel-Mail als Webmail lässt sich dieser Ordner ohne Probleme in die Ordnerstruktur einbinden.

 

# fetchmail: general settings

Fetchmail wird gestartet und mit den entsprechenden Parametern versehen.

 

# fetchmail: accounts

In diesem Abschnitt wird mein POP3 Konto bei 1&1.de eingesetzt und der User-Name mit Passwort gesetzt.

 

FETCHMAIL_1_DOMAIN

Fetchmail soll die Mails für die ganze Domain abholen.

 

FETCHMAIL_1_ENVELOPE

Diese Funktion wird auf 'yes' gesetzt und damit die Multi-Drop-Mailbox genauer untersucht. Diese Funktion schaut genau nach an welche Adresse die E-Mail gerichtet war und stellt sie entsprechend zu. Durch den Parameter versucht Fetchmail den eigentlichen Empfänger aus verschiedenen anderen Header-Feldern

zu ermitteln.

 

FETCHMAIL_x_SERVER_AKA_y

Dies hilft Fetchmail zu erkennen welche Domains 'lokal' vorhanden sind und beschleunigen die Zustellung, da nicht explizit DNS-Abfragen durchgeführt werden müssen.

 

# smtp: general settings

Starten des SMTP

 

#smtp: local domains

Hier wurde eine dritte Domain hinzugefügt, nämlich die eigene.

 

smtp: relay from hosts

Hier wird definiert von welchen Hosts Mails angenommen werden die nach aussen weitergeleitet werden (Sicherheitsmassnahme).

 

smtp: smarthosts

Hier wird der smtp server von 1&1 definiert über den alle E-Mails nach aussen verschickt werden sollen. Ein smarthost für alle Mails.

 

SMTP_ALIASES

Hier werden die Aliases von meinen sechs Usern definiert. Sechs mal zwei Aliases plus einmal root ergibt 13.

 

 

mail.conf:

 

#------------------------------------------------------------------------------

# /etc/config.d/mail - configuration for mail services on EIS/FAIR

#

# Copyright (c) 2002 Frank Meyer <frank(at)eisfair.org>

#

# Creation: 28.04.2002 fm

# Last Update: 08.02.2003 jed

#

# This program is free software; you can redistribute it and/or modify

# it under the terms of the GNU General Public License as published by

# the Free Software Foundation; either version 2 of the License, or

# (at your option) any later version.

#------------------------------------------------------------------------------

 

#------------------------------------------------------------------------------

# pop3: general settings

#------------------------------------------------------------------------------

START_POP3='yes' # start POP3 server: yes or no

START_IMAP='yes' # start IMAP server: yes or no

 

POP3IMAP_CREATE_MBX='yes' # create mbx mailbox for imap

 

POP3IMAP_USE_MAILONLY_PASSWORDS='no' # use seperate mail passwords: yes or no

#------------------------------------------------------------------------------

# pop3/imap: mail users and optional passwords

#------------------------------------------------------------------------------

POP3IMAP_N='6' # set mail-accounts

POP3IMAP_1_USER='max' # username

POP3IMAP_1_PASS='' # optional mail only password

POP3IMAP_2_USER='emil'

POP3IMAP_2_PASS=''

POP3IMAP_3_USER='hans'

POP3IMAP_3_PASS=''

POP3IMAP_4_USER='erna'

POP3IMAP_4_PASS=''

POP3IMAP_5_USER='andi'

POP3IMAP_5_PASS=''

POP3IMAP_6_USER='lisa'

POP3IMAP_6_PASS=''

#------------------------------------------------------------------------------

# imap: shared and public folders

#

# Optional:

# Setup public or shared imap folders. This feature is not supported by

# some mail clients, but has succesfully tested with netscape messenger.

#------------------------------------------------------------------------------

 

IMAP_SHARED_PUBLIC_USERGROUP='users' # name of usergroup for shared and

# public folders - default: users

IMAP_SHARED_FOLDER_N='0' # number of shared folders to create

IMAP_SHARED_FOLDER_1_NAME='' # 1. folder to create

 

IMAP_PUBLIC_FOLDER_N='1' # number of public folders to create

IMAP_PUBLIC_FOLDER_1_NAME='office' # 1. folder to create

 

#------------------------------------------------------------------------------

# fetchmail: general settings

#------------------------------------------------------------------------------

START_FETCHMAIL='yes' # start FETCHMAIL client: yes or no

FETCHMAIL_PROTOCOL='POP3' # protocol to use, normally pop3

FETCHMAIL_LIMIT='1000000' # mail size limit. Default: 4 megabytes

FETCHMAIL_WARNINGS='86400' # send warnings once a day (in seconds)

FETCHMAIL_DAEMON='600' # check every 10 minutes (in seconds)

FETCHMAIL_TIMEOUT='90' # wait for server reply (in seconds)

 

#------------------------------------------------------------------------------

# fetchmail: accounts

#------------------------------------------------------------------------------

 

FETCHMAIL_N='1' # number of accounts to fetch

FETCHMAIL_1_SERVER='pop.1und1.com' # mail server to poll

FETCHMAIL_1_USER='pt123456-1234' # username and

FETCHMAIL_1_PASS='Your_Password' # password for this server

FETCHMAIL_1_FORWARD='' # local account to forward to

FETCHMAIL_1_SMTPHOST='' # smtp host to forward to,

# default is 'localhost'

FETCHMAIL_1_DOMAIN='yes' # if yes fetchmail gets mail for

# a whole domain.

FETCHMAIL_1_ENVELOPE='yes' # if yes, lookup envelope addresses

FETCHMAIL_1_SERVER_AKA_N='1' # number of dns aliases, default is '0'

FETCHMAIL_1_SERVER_AKA_1='firma.de' # 1. dns alias

FETCHMAIL_1_LOCALDOMAIN_N='0' # number of local domains,default is '0'

FETCHMAIL_1_LOCALDOMAIN_1='' # 1. local domain

FETCHMAIL_1_LOCALDOMAIN_2='' # 2. local domain

FETCHMAIL_1_PROTOCOL='' # set a different protocol

# default is FETCHMAIL_PROTOCOL

FETCHMAIL_1_PORT='' # set a different pop3 ip port

# default is 110

FETCHMAIL_1_AUTH_TYPE='password' # set a different authentication type

# default is 'any'

FETCHMAIL_1_KEEP='no' # if yes mail is left on the server

FETCHMAIL_1_FETCHALL='yes' # if yes all mail is fetched from the server

FETCHMAIL_1_SSL_PROTOCOL='none' # ssl protocol: none, ssl2, ssl3 or tls1

FETCHMAIL_1_SSL_TRANSPORT='no' # enable ssl transport

FETCHMAIL_1_SSL_FINGERPRINT='' # ssl fingerprint

 

#------------------------------------------------------------------------------

# smtp: general settings

#------------------------------------------------------------------------------

 

START_SMTP='yes' # start SMTP server: yes or no

SMTP_QUALIFY_DOMAIN='firma.de' # domain to be added to all unqualified

# addresses

SMTP_HOSTNAME='eisfair.firma.de' # canonical hostname of eisfair server

SMTP_QUEUE_INTERVAL='30' # queueing interval in minutes, usually 30

SMTP_QUEUE_OUTBOUND_MAIL='no' # set to yes if you are using a dialup ISP

# and you want to queue outbound mail until

# next queue run which must be initiated

# manually or cron-job

SMTP_LISTEN_PORT='smtp' # port on which Exim is listening for

# inbound traffic: should not be changed

# by default

SMTP_MAIL_TO_UNKNOWN_USERS='bounce' # how to handle mail to unknown mail users:

# bounce, copy or forward

# default is 'bounce'

SMTP_ALLOW_EXIM_FILTERS='no' # allow exim filters in .forward file: yes or no

 

SMTP_CHECK_SPOOL_SPACE='' # check if enough disk space for spool directory

# is available. Default is being set to 10Mb

SMTP_CHECK_SPOOL_INODES='' # check if enough inodes for spool directory

# are available. Default is being set to 100

# mail size limit. Default is being set to 50Mb

 

SMTP_REMOVE_RECEIPT_REQUEST='no' # remove external receipt request: yes or no

 

#------------------------------------------------------------------------------

# smtp: local domains

#------------------------------------------------------------------------------

 

SMTP_LOCAL_DOMAIN_N='3' # number of local domains

SMTP_LOCAL_DOMAIN_1='@' # 1. local domain, @ means SMTP_HOSTNAME

SMTP_LOCAL_DOMAIN_2='localhost' # 2. local domain

SMTP_LOCAL_DOMAIN_3='firma.de' # 3. local domain

 

#------------------------------------------------------------------------------

# smtp: relay to domains

#

# Optional:

# The folllowing setting specify domains for which your host is an incoming

# relay. If you are not doing any relaying, you should leave the list empty.

# However, if your host is an MX backup or gateway of some kind for some

# domains, you must set SMTP_RELAY_TO_DOMAIN_x to match those domains.

#------------------------------------------------------------------------------

 

SMTP_RELAY_TO_DOMAIN_N='0' # domains for which we are incoming relay

SMTP_RELAY_TO_DOMAIN_1='domain.de'

 

#------------------------------------------------------------------------------

# smtp: relay from hosts

#

# The following settings specify hosts that can use your host as an

# outgoing relay to any other host on the Internet. Such a setting

# commonly refers to a complete local network as well as the localhost.

#------------------------------------------------------------------------------

 

SMTP_RELAY_FROM_HOST_N='2' # hosts/nets from we accept outgoing mails

SMTP_RELAY_FROM_HOST_1='127.0.0.1'

SMTP_RELAY_FROM_HOST_2='10.0.0.0/24'

 

#------------------------------------------------------------------------------

# smtp: server authentication

#

# Optional:

# Set the type of server authentication.

# none - no authentication

# user - each user authenticates himself by his username/password

# server - all users authenticate themself by sending a global user/pass

#------------------------------------------------------------------------------

SMTP_AUTH_TYPE='user' # authentication: none, user, server

SMTP_AUTH_USER='' # if server: global username, else empty

SMTP_AUTH_PASS='' # if server: global password, else empty

 

#------------------------------------------------------------------------------

# smtp: smarthosts

#

# Optional:

# Send all outgoing messages to a smarthost (e.g. mail server of your isp).

#------------------------------------------------------------------------------

 

SMTP_SMARTHOST_ONE_FOR_ALL='yes' # use one smarthost for all accounts:

# if 'yes', the first entry will be read

# if 'no', user specific entries will be used

SMTP_SMARTHOST_DOMAINS='' # if SMTP_SMARTHOST_ONE_FOR_ALL='yes'

# then use it only for these domains

# (separated by ':')

SMTP_SMARTHOST_ROUTE_TYPE='domain' # if SMTP_SMARTHOST_ONE_FOR_ALL='no'

# then how to select

# smart host: by sender mail 'addr'ess

# or destination 'domain'

SMTP_SMARTHOST_N='1' # number of smarthost entries

SMTP_SMARTHOST_1_HOST='smtp.1und1.com' # smart host to send mail to,e.g.

# mail.gmx.net

SMTP_SMARTHOST_1_AUTH_TYPE='plain' # 'none', 'plain', 'login', 'md5' or

# 'msn'

SMTP_SMARTHOST_1_ADDR='' # if SMTP_SMARTHOST_ROUTE_TYPE='addr':

# sender

# mail address

SMTP_SMARTHOST_1_DOMAIN='' # if SMTP_SMARTHOST_ROUTE_TYPE='domain':

# destination domain

SMTP_SMARTHOST_1_USER='pt123456-1234' # if authentication required: username

SMTP_SMARTHOST_1_PASS='Your_Password' # if authentication required: password

SMTP_SMARTHOST_1_FORCE_AUTH='yes' # set to 'yes' to allow only

# authenticated connections

SMTP_SMARTHOST_1_FORCE_TLS='no' # set to 'yes' to allow

# only secure connections

#------------------------------------------------------------------------------

# smtp: aliases

#

# Here you can specify aliases

#

# General format:

# SMTP_ALIASES_x_ALIAS_y='name: user1[,user2,...]

#

# Example:

# SMTP_ALIASES_N='2'

# ...

# SMTP_ALIASES_2_DOMAIN='2nd.local.lan'

# SMTP_ALIASES_2_ALIAS_N='1'

# SMTP_ALIASES_2_ALIAS_1='frank: fm,foo@otherwhere.com'

#

# Mails to frank@domain.de will be delivered to local user fm and to

# user foo@otherwhere.com.

#------------------------------------------------------------------------------

SMTP_ALIASES_N='1' # number of domains: default: 1

SMTP_ALIASES_1_DOMAIN='' # domain name: will only be read if

# SMTP_ALIASES_N > 1

# and not SMTP_ALIASES_1_DOMAIN

SMTP_ALIASES_1_ALIAS_N='13' # number of aliases of 1. domain

SMTP_ALIASES_1_ALIAS_1='root: max' # 1. alias of 1. domain must

# be for user 'root'!

SMTP_ALIASES_1_ALIAS_2='mm: max' # 2. alias of 1. domain

SMTP_ALIASES_1_ALIAS_3='max.mustermann: max' # 3. alias of 1. domain

SMTP_ALIASES_1_ALIAS_4='hans.mustermann: hans' # 4. alias of 1. domain

SMTP_ALIASES_1_ALIAS_5='hm: hans' # 5. alias of 1. domain

SMTP_ALIASES_1_ALIAS_6='em: emil' # 6. alias of 1. domain

SMTP_ALIASES_1_ALIAS_7='emil.mustermnann: emil' # 7. alias of 1. domain

SMTP_ALIASES_1_ALIAS_8='erna.mustermann: erna' # 8. alias of 1. domain

SMTP_ALIASES_1_ALIAS_9='em: erna' # 9. alias of 1. domain

SMTP_ALIASES_1_ALIAS_10='andi.mustermann: andi' # 10. alias of 1. domain

SMTP_ALIASES_1_ALIAS_11='am: andi' # 11. alias of 1. domain

SMTP_ALIASES_1_ALIAS_12='lisa.mustermann: lisa' # 12. alias of 1. domain

SMTP_ALIASES_1_ALIAS_13='lm: lisa' # 13. alias of 1. domain

 

#------------------------------------------------------------------------------

# smtp: outgoing addresses

#

# Here you can specify an address translation table which is only available

# if SMTP_SMARTHOST_N has been set to a value greater than 0.

#

# General format:

# SMTP_OUTGOING_ADDRESSES_x='name: email address'

#

# Example:

# SMTP_OUTGOING_ADDRESSES_1='fm: frank@domain.de'

#

# Mail from local user 'fm' will be delivered by using sender address

# 'frank@domain.de'.

#------------------------------------------------------------------------------

SMTP_OUTGOING_ADDRESSES_N='0

SMTP_OUTGOING_ADDRESSES_1=''

SMTP_OUTGOING_ADDRESSES_2=''

#------------------------------------------------------------------------------

# smtp: incoming addresses

# Example:

# SMTP_HEADER_REWRITE_1_SOURCE='*@home.lan'

# SMTP_HEADER_REWRITE_1_DESTINATION='$1@domain.de'

# SMTP_HEADER_REWRITE_1_FLAGS='sF'

# The envelope from address and the sender of an incoming smtp mail from

# user 'frank@home.lan' will be rewritten to 'frank@domain.de'

#------------------------------------------------------------------------------

SMTP_HEADER_REWRITE_N='0' # number of rewrite rules

SMTP_HEADER_REWRITE_1_SOURCE='*@home.lan' # search mask

SMTP_HEADER_REWRITE_1_DESTINATION='valid@domain.de' # replace string

SMTP_HEADER_REWRITE_1_FLAGS='sF' # what to rewrite

#------------------------------------------------------------------------------

# smtp: mailing lists

# Here you can specify simple mailing lists

# Explanation of example below:

# A mail to 'eisfair@domain.de' will be delivered to all members in the list.

# The reply address will be changed to 'eisfair@domain.de'!

#------------------------------------------------------------------------------

#no mailing list

#------------------------------------------------------------------------------

# exiscan: virus scanning

# Here you can specify an additinal antivirus scanner Please make sure

# that you have installed a antivirus software prior you enable these feature.

#------------------------------------------------------------------------------

# exiscan nicht aktiviert

#------------------------------------------------------------------------------

# mail: send warning if TLS certificates will become invalid

#------------------------------------------------------------------------------

MAIL_CERTS_WARNING='yes' # send certs warning: yes or no

MAIL_CERTS_WARNING_SUBJECT='TLS certificates warning' # subject of warning mail

MAIL_CERTS_WARNING_CRON_SCHEDULE='3 1 1,16 * *' # cron configuration string

#------------------------------------------------------------------------------

# mail: send exim statistics

#------------------------------------------------------------------------------

MAIL_STATISTICS_INFOMAIL='no' # send statistics infomail: yes or no

MAIL_STATISTICS_INFOMAIL_SUBJECT='Mail server statistics' # subject of infomail

MAIL_STATISTICS_INFOMAIL_CRON_SCHEDULE='6 7 * * *' # cron configuration string

#------------------------------------------------------------------------------

# mail: log handling

# Here you can specify how many logs should be saved and in with interval.

# Example:

# MAIL_LOG_COUNT='10' - save the last 10 log files

# MAIL_LOG_INTERVAL='daily' - save one log file per day

#------------------------------------------------------------------------------

MAIL_DO_DEBUG_='no'

MAIL_LOG_COUNT='10' # number of log files to save

MAIL_LOG_INTERVAL='weekly' # interval: daily, weekly, monthly

#------------------------------------------------------------------------------

# End

#------------------------------------------------------------------------------

 

Vielen Dank an Jürgen Edner der mir meine Fragen im eisfair usenet beantwortet hat. Auch der oft benutzte Spruch zeigt sich bei Eisfair:

"Dies Software kostet nichts ist aber nicht umsonst". Das bedeutet vor allem für Anfänger man sollte viel Zeit einplanen und grundlegende Netzwerk-Kenntnisse besitzen bzw. sich aneignen.

 

Sebastian Proksch