Mailserver einrichten bitte um Hilfe

Schau Dir bitte nochmal das Howto von mir an:

Debian GNU/Linux etch Mailserver Howto - postfix, policyd-weight, dovecot imapd/pop3d

dort gibs unter:
2.1.3 SASL (Simple Authentication and Security Layer)

einige Einstellungen für SASL, bitte diese auch eintragen, ich finde bei Dir z.B. auch nirgends ein "smtpd_sasl_path = private/auth".

Wegen den Einträgen unter "mydestination", halb so schlimm, da steht nur für welche Domains sich postfix zuständig fühlt.

Nicht vergessen, Änderungen in der Config werden erst wargenommen wenn Du postfix mit /etc/init.d/postfix restart neu startest, bzw. reload.

Basti
 
Wieso steht denn nun dovecot in der main.cf? Ich denke du bist nach dem Tutorial vorgegangen? Im Tutorial wird Courier installiert... :eek:
 
In dem Tutorial steht doch kein Wort von Courier? :confused: Also in dem von mir geposteten :)
Welches verwendest Du denn jetzt?
 
Ja fuchzga,

im Howto wird courier installiert, dovecote war vorher schon vorhanden was mir allerdings nicht bekannt war.

Deswegen die Frage ob dovecote & courier sich nicht gegenseitig stören. Es liest sich hier aber für mich so als solle ich das ertmal aussen vorlassen?

OK ich hab jetzt die main.cf wie folgt geändert:
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = nsOVH.ovh.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = meine-domain.de, nsOVH.ovh.net, 12.34.56.789, localhost.meine-domain.de, localhost.localdomain, localhost
relayhost =
mynetworks = localhost
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
inet_interfaces = 12.34.56.789
smtp_use_tls = yes
smtpd_enforce_tls = no
smtpd_tls_auth_only = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
smtp_sasl_auth_enable = no
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination


smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/

Dann habe ich mich mit Thunderbird via pop3 Port 110 (dovecote) ohne verschlüsselte Verbindung verbunden - scheint auch zu klappen - Thunderbird meldet keinen Fehler. Dann wollte ich mir selber eine eMail schreiben beim Senden meldet Thunderbird mir dann:

Senden der Nachricht felgeschalgen.
Die Nachricht konnte nicht gesendet werden. Der Postausgangs-Server (SMTP) "smtp.meine-domain.de" ist entweder nicht verfügbar oder lehnt die Verbindung ab. etc etc

Mein mail.log sieht wie folgt aus:
Code:
Dec 28 16:00:26 ns204320 postfix/smtpd[11131]: warning: database /etc/aliases.db is older than source file /etc/aliases
Dec 28 16:00:26 ns204320 postfix/smtpd[11131]: warning: SASL: Connect to private/auth failed: No such file or directory
Dec 28 16:00:26 ns204320 postfix/smtpd[11131]: fatal: no SASL authentication mechanisms
Dec 28 16:00:28 ns204320 postfix/master[10582]: warning: process /usr/lib/postfix/smtpd pid 11131 exit status 1
Dec 28 16:00:28 ns204320 postfix/master[10582]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling
Dec 28 16:03:27 ns204320 postfix/smtpd[11378]: warning: database /etc/aliases.db is older than source file /etc/aliases
Dec 28 16:03:27 ns204320 postfix/smtpd[11378]: warning: SASL: Connect to private/auth failed: No such file or directory
Dec 28 16:03:27 ns204320 postfix/smtpd[11378]: fatal: no SASL authentication mechanisms
Dec 28 16:03:28 ns204320 postfix/master[10582]: warning: process /usr/lib/postfix/smtpd pid 11378 exit status 1
Dec 28 16:03:28 ns204320 postfix/master[10582]: warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

Schimpft mich ruhig aus, ich hab doch was vergessen oder übersprungen?

Gruß Micha

PS: Echt lieben Dank für Eure bemühungen ohne Euch würde ich verzweifeln!

Edit: ich hab zuerst dieses http://www.howtoforge.de/howto/der-perfekte-server-ubuntu-hardy-heron-ubuntu-804-lts-server/5/ verwendet
 
Last edited by a moderator:
Poste doch mal bitte die Ausgabe von:

Code:
 dpkg -l|grep sasl

Ob Du jetzt Dovecot oder Corier nimmst, ist ziemlich egal, allerdings solltest Du dich für eins von beiden entscheiden :)
 
Ja ich werde courier runter werfen wenn dovecote funktioniert!

hier die Ausgabe:
Code:
root@nsOVH:~# dpkg -l|grep sasl
ii  libsasl2-2                            2.1.22.dfsg1-18ubuntu2              Cyrus SASL - authentication abstraction libr
ii  libsasl2-modules                      2.1.22.dfsg1-18ubuntu2              Cyrus SASL - pluggable authentication module
ii  sasl2-bin                             2.1.22.dfsg1-18ubuntu2              Cyrus SASL - administration programs for SAS

da seh ich jetzt cyrus das ist doch schon wieder ne andere Baustelle oder?

Gruß Micha
 
Klar kein Ding hier die Ausgabe:
Code:
root@nsOVH:~# ps aux|grep sasl
root     10680  0.0  0.0  53568   884 ?        Ss   15:53   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     10681  0.0  0.0  53568   588 ?        S    15:53   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     10682  0.0  0.0  53568   476 ?        S    15:53   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     10683  0.0  0.0  53568   476 ?        S    15:53   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     10684  0.0  0.0  53568   476 ?        S    15:53   0:00 /usr/sbin/saslauthd -a pam -c -m /var/spool/postfix/var/run/saslauthd -r -n 5
root     20132  0.0  0.0   5164   872 pts/11   S+   17:42   0:00 grep sasl

Ich poste auch mal gleich die gaze saslauthd:
Code:
# (suggestion: SASL Authentication Daemon)
DESC="SASL Authentication Daemon"

# Short name of this saslauthd instance. Strongly recommended.
# (suggestion: saslauthd)
NAME="saslauthd"

# Which authentication mechanisms should saslauthd use? (default: pam)
#
# Available options in this Debian package:
# getpwent  -- use the getpwent() library function
# kerberos5 -- use Kerberos 5
# pam       -- use PAM
# rimap     -- use a remote IMAP server
# shadow    -- use the local shadow password file
# sasldb    -- use the local sasldb database file
# ldap      -- use LDAP (configuration is in /etc/saslauthd.conf)
#
# Only one option may be used at a time. See the saslauthd man page
# for more information.
#
# Example: MECHANISMS="pam"
MECHANISMS="pam"

# Additional options for this mechanism. (default: none)
# See the saslauthd man page for information about mech-specific options.
MECH_OPTIONS=""

# How many saslauthd processes should we run? (default: 5)
# A value of 0 will fork a new process for each connection.
THREADS=5

# Other options (default: -c -m /var/run/saslauthd)
# Note: You MUST specify the -m option or saslauthd won't run!
#
# See /usr/share/doc/sasl2-bin/README.Debian for Debian-specific information.
# See the saslauthd man page for general information about these options.
#
# Example for postfix users: "-c -m /var/spool/postfix/var/run/saslauthd"
#OPTIONS="-c -m /var/run/saslauthd"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

also START=yes ist vorhanden

Gruß Micha
 
Was bisserl störend ist, dass die letzte Einstellung die ich Dir geschrieben haben für das von mir gepostete Howto ist, Du aber vorher alles nach Deinem Howto erstellt hast.

Ich denke das hier ein ziemliches Chaos entstanden ist.

Hast Du ein Backup der originalen main.cf von Postfix?

Dann würde ich noch einmal komplett von vorne anfangen, diesmal aber wirklich nur nach einem Howto arbeiten.
 
Wenn man wie ich es gewünscht hab ein Backup angelegt hätte dann wäre es kein Problem aber leider hat man das sträflich vergessen naja und ich hab auch keins gemacht.

Ja ich weiss das ist das wichtigste überhaupt aber die main.cf im original müsste sich ja wohl irgendwie organisieren lassen oder?

Meinst Du denn wirklich ich bekomm das Problem behoben wenn ich die gegen die originale austausche?

Gruß Micha
 
Jetzt schalg mich ruhig tod aber ich glaube ich hab doch eins gemacht, weiss nicht ob Du das so ohne weiteres erkennst aber ich poste mal den Inhalt

Code:
main.cf
# The following parameters are used when installing a new Postfix version.
# 
# sendmail_path: The full pathname of the Postfix sendmail command.
# This is the Sendmail-compatible mail posting interface.
# 
sendmail_path =

# newaliases_path: The full pathname of the Postfix newaliases command.
# This is the Sendmail-compatible command to build alias databases.
#
newaliases_path =

# mailq_path: The full pathname of the Postfix mailq command.  This
# is the Sendmail-compatible mail queue listing command.
# 
mailq_path =

# setgid_group: The group for mail submission and queue management
# commands.  This must be a group name with a numerical group ID that
# is not shared with other accounts, not even with the Postfix account.
#
setgid_group =

# html_directory: The location of the Postfix HTML documentation.
#
html_directory =

# manpage_directory: The location of the Postfix on-line manual pages.
#
manpage_directory =

# sample_directory: The location of the Postfix sample configuration files.
# This parameter is obsolete as of Postfix 2.1.
#
sample_directory =

# readme_directory: The location of the Postfix README files.
#
readme_directory =

Ich hoffe sehr das ist wirklich die Urconfig.

Gruß Micha
 
Die sieht sehr leer aus ;) Sichere Deine jetzige Config, benenne die /etc/postfix/main.cf in main.cf.bak um, und mach auf der Konsole ein fröhliches "dpkg-reconfigure postfix", beantworte die Fragen nach bestem Wissen und Gewissen, und Du solltest wieder eine laufende Minimalinstallation besitzen :)

Du musst nur aufpassen dass Du wirklich "Internet-Server" auswählst, und den hostnamen richtig angibst.

Basti
 
Last edited by a moderator:
Hallo traced,

ok ich hab die alte main.cf umbenannt und "dpkg-reconfigure postfix" ausgeführt. Natürlich alle Fragen nach bestem Wissen und Gewissen beantwortet.

Wo ich mir nicht sicher bin ist will ich procmail zur Zustellung der eMails benutzen? Ich hab einfach mal nein gesagt.

Meine main.cf sieht nun wie folgt aus:
Code:
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = nsOVH.ovh.net
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = meine-domain.de, nsOVH.ovh.net, localhost.ovh.net, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4

Ich hoffe da hab ich jetzt nichts grundlegend falsch gemacht, das einzige wo ich mir nicht sicher war ist procmail, damit fang ich einfach nichts an.

Gruß Micha
 
OK, wenn Du postfix neustartest, kannst Du dann über PHP Mails verschicken? Erst wenn das wieder alles geht machts Sinn an der Konfiguration weiter zu basteln.
 
Hat alles was länger gedauert. Besuch kommt immer dann wenn man ihn nicht gebrauchen kann.

Wenn ich mich jetzt mit Thunderbird anmelde kommt kein Fehler wenn ich jedoch eine eMail verschicken will meldet Thunderbird folgendes:

Fehler beim Senden der Nachricht. Der Mailserver antwortete 5.7.1 <ich@gmx.de>: Relay accsess denied. Bitte überprüfen sie die E-Mail Adressen der Empfänger und wiederholen sie den Vorgang.

Wie soll ich nun weiter vorgehen?

Gruß Micha
 
Das Verhalten, dass Du siehst, ist schon mal gut. Bevor Du SMTP-AUTH einrichtest um auch von außerhalb des Servers Mails verschicken zu können (dazu findest Du hier im Forum einige Threads), solltest Du schauen, ob Du auf der Maschine lokal Mails verschicken kannst.
Code:
mailx ich@gmx.de
Als erstes wird nach dem Betreff gefragt, der Rest ist der Mail-Text. Beendet wird das Ganze in dem man in einer neuen Zeile einen einzelnen Punkt '.' gefolgt von der Eingabe-Taste eingibt.
 
Hallo LinuxAdmin (oha jetzt kümmert sich der Cheff persönlich um mich ;) ),

der eMailversand hat schon mal anstandslos geklappt:

Code:
root@nOVH:~# mail ich@gmx.de
Subject: test
test also root von der lokalen Maschine.
.
Cc:
root@ns2OVH:~#

die eMail hatte ich innerhalb einer halben Minute.

Gruß Micha
 
Also irgendwie komm ich nicht wirklich weiter... :(

Ich hab mich nun durch das schöne Howto gewühlt und nach bestem Wissen und Geweissen gehandelt.

Die dovecot.conf ist ja schon mal zum Haare raufen, etwas länger und unübersichtlicher geht die ja wohl nicht mehr...

Nun da muss ich auch wohl wieder Mist gemacht haben nur wo da.

Wenn ich dovecote neu starte meckert er mit mir:
Code:
/etc/init.d/dovecot restart
 * Restarting IMAP/POP3 mail server dovecot                                     Error: Can't use mail executable /usr/lib/dovecot/imap: No such file or directory
Fatal: Invalid configuration in /etc/dovecot/dovecot.conf

Ich werd echt noch irre mit der Geschichte...

Kann man die dovecot.conf nicht auf das wesentliche aus dem Howto reduzieren also quasi so:
Code:
protocols =  imap pop3
ssl_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
ssl_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
disable_plaintext_auth = yes
mail_location = maildir:%h/mails

auth default {

  mechanisms = plain

  userdb passwd {
  }

  passdb shadow {
  }

  user = root

  socket listen {
    client {
      path = /var/spool/postfix/private/auth
      mode = 0660
      user = postfix
      group = postfix
    }
  }

}

Danke für Eure Geduld mit mir!

Gruß Micha
 
Da bin ich nochmal.

Mir ist aufgefallen das beim installieren mit:
Code:
apt-get install postfix dovecot-imapd dovecot-pop3d

Ich eine Meldung erhalten habe bzg dovecot(imapd oder pop3d weiss ich nicht mehr). Es wurde vorgeschlagen dovecote-common zu installieren.

Weiss nicht ob da schon der Hund begraben liegt.

Ich hab jetzt mit Hilfe von:
Code:
dpkg --configure -a
dovecot-imapd installiert nun auch beim restart von dovecot keinen Fehler mehr erhalten.

Wenn ich mich nun mit Thunderbird anmelden will meldet er:
Fehler beim Senden des Benutzernamens. Der Mail-Server pop3.meine-domain.de antwortete: Plaintext authentication disallowed on non-secure connections.

Ok eigentlich will ich das ja auch so gemäß Howto aber wie muss ich Thunderbird denn nun einstellen?

Gruß Micha
 
Last edited by a moderator:
Moin,
wenn ich es jetzt recht verstehe, hast du das Howto von traced verwendet?
Hast du denn schon die Punkte TLS und SASL durchgearbeitet?

Wenn die Meldung kommt "Plaintext authentication disallowed on non-secure connections" warum stellst du nicht einfach auf secure-connections um?

Wenn du den Punkt TLs durchgeackert hast, dann hast du schon mal eine sichere SMTP verbindung.
Wenn du mit POP3 oder IMAP Mails abholen möchtest, musst du natürlich den Dienst umkonfigurieren, welcher für POP3 und IMAP zuständig ist.
Ist im Tutorial auch beschrieben.

Wenn du der Meinung bist, dass du alles richtig gemacht hast, musst du deinem Mailclient (Thunderbird) nur noch beibringen, dass er anstatt POP3/IMAP die Secure-Variante nutzen soll.

SASL wird dann interessant, wenn du Mails versenden möchtest. Denn dazu muss dein Versand-Server (also dein Postfix) wissen, dass man dir trauen darf. Also muss du dich dort authentifizieren.
Immerhin hast du ja in der main.cf diese Zeile aufgenommen:

Code:
smtpd_recipient_restrictions = permit_mynetworks, reject_unknown_recipient_domain, permit_sasl_authenticated, reject_unauth_destination

Der Postfix wird also nur Mails annehmen von den IP-Bereiche welche du in my_networks angegeben hast oder alle SASL-Authenticated Connections.
Alles andere wird vom Server gar nicht erst angenommen.
Wenn du also diese Sperre durchbrechen willst, dann musst du dich über SASL authentifizieren.

Wie gesagt.. SASL brauchst du später für den Mailversand. Schau erstmal, dass du POP3S und IMAPS hinbekommst, um überhaupt Mails abrufen zu können.

Last but not least: Du gibst im Mailclient einen Benutzernamen (mit Domain?) und ein Passwort ein. Diesen User hast du auf dem Mailserver angelegt?

Beste Grüsse. ;)
 
Back
Top