• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

erste Schritte mit Linux Mail-Server

OP
P

#patrick

Member
die user in der sasldb konnte ich doch mit sasllistuser2 anzeigen lassen -oder? Bin wohl schon ein wenig verwirrt, jedesfalls sagt er immer command not found wenn ich sasllistuser2 eingebe.

/var/log/messages:
Aug 5 10:01:01 LinuxMail master[30279]: process 7778 exited, status 0
Aug 5 10:01:43 LinuxMail master[7807]: about to exec /usr/lib/cyrus/bin/imapd
Aug 5 10:01:43 LinuxMail imap[7807]: executed
Aug 5 10:01:43 LinuxMail imapd[7807]: accepted connection
Aug 5 10:01:43 LinuxMail PAM-warn[30314]: function=[pam_sm_authenticate] service=[imap] terminal=[<unknown>] user=[patrick] ruser=[<unknown>] rhost=[<unknown>]
Aug 5 10:01:43 LinuxMail saslauthd[30314]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Aug 5 10:01:43 LinuxMail saslauthd[30314]: AUTHFAIL: user=patrick service=imap realm= [PAM auth error]
Aug 5 10:01:43 LinuxMail imapd[7807]: login: [10.16.20.104] patrick plaintext
Aug 5 10:01:43 LinuxMail imapd[7807]: seen_db: user patrick opened /var/lib/imap/user/p/patrick.seen
Aug 5 10:01:43 LinuxMail imapd[7807]: Connection reset by peer, closing connection
Aug 5 10:01:43 LinuxMail imapd[7807]: accepted connection
Aug 5 10:01:43 LinuxMail PAM-warn[30310]: function=[pam_sm_authenticate] service=[imap] terminal=[<unknown>] user=[patrick] ruser=[<unknown>] rhost=[<unknown>]
Aug 5 10:01:43 LinuxMail saslauthd[30310]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Aug 5 10:01:43 LinuxMail saslauthd[30310]: AUTHFAIL: user=patrick service=imap realm= [PAM auth error]
Aug 5 10:01:43 LinuxMail imapd[7807]: login: [10.16.20.104] patrick plaintext
Aug 5 10:01:43 LinuxMail imapd[7807]: open: user patrick opened INBOX
Aug 5 10:02:43 LinuxMail master[30279]: process 7807 exited, status 0
deute ich so: Authentifizierungsmethode für SMTP wird nicht unterstützt - also genau dass, was du unter ACHTUNG schon vermutet hast. Das kann ich wahrscheinlich in der smtpd.conf einstellen ? Aber wo war die doch gleich ...?
 

oc2pus

Ultimate Guru
nein, der OE schickt dann plain text (unverschlüssel) zu dem Postfix, macht aber nix, da internes Netz.

ist "patrick" als user in der sasldb2 drin ?

sasldblistusers2 listet die user auf.
TIP: wenn du den Namen eines Befehl nicht genau weist, dann schreib sasl und drücke dann die TAB-Taste (2x) dann zeigt linux dir alle Befehle an welche mit sasl beginnen ;)
 
OP
P

#patrick

Member
sauber, das mit TAB hatte ich schon gelesen - und auch wieder vergessen - ... egal, auf jeden Fall tauchen root, cyrus und patrick auf, alle mit userPassword.

Das müsste soweit ok sein.
 

oc2pus

Ultimate Guru
langsam: beachte wenn du mit imap auf deinen Server zugreifst, landest du bei cyrus. dazu muss es einen cyrus account geben.

wenn du mit smtp auf deinen Server zugreifst, landest du im postfix, dazu muss es einen Eintrag in sasldb2 geben.

und bitte nicht alles auf einmal ;)
entscheide was du jetzt zuerst haben willst: Zugriff auf IMAP-Postfach, oder Mail senden via postfix ....
 
OP
P

#patrick

Member
ok, verstanden. Postfix -> sasl2 user erforderlich. Der user patrick existiert, wie sasldblistusers2 zeigt. Wenn ich von der Konsole mittels telnet 25 localhost eine Mail verschicke kommt sie im cyrus-Postfach an und ich kann sie mit OE sehen.

Ganz viel scheint - aus meiner Sicht nicht mehr zu fehlen. Ich wollte jetzt eigentlich eine Email an mich selber schicken um den Versand von Mails zu testen - der Zugriff auf IMAP scheint ja zu klappen.

Jetzt ist nur die Frage, was zu tun ist, damit ich über OE mit Postfix eine Mail verschicken kann.
 
OP
P

#patrick

Member
ich glaube, mein Postfix läuft nicht mehr ... mit ps ax | grep postfix bekomme ich nur die Zeile mit dem Aufruf zurück .. das erklärt natürlich auch, warum ich keine Mails verschicken kann.

rcpostfix start wird ohne Fehler ausgeführt, ein 'done' erscheint und es wird nichts in /var/log/messages ausgegeben. Allerdings wird Postfix wohl auch nicht gestartet, denn ps... bleibt weiter leer
 

oc2pus

Ultimate Guru
ok, dann lernst du jetzt schon wieder was:
die mail-Proggis (postfix, ...) schreiben nach /var/log/mail

also musst du diese beobachten ;)

NACHTRAG:
und zum zweiten:
mit ps ax | grep postfix geht nicht ;)
postfix ist ein sammelsurium von Programmen...

entweder ps ax | grep master oder
netstat -lntp und schauen wer mit port 25 arbeitet (master)
 
OP
P

#patrick

Member
nicht das du mich jetzt für totel bescheuert hälst, aber ps ax |grep postfix und dazu /var/log/messages steht so in der Anleitung die ich von linux-tin habe ...

folgendes habe ich jetzt ermittelt:
LinuxMail:~ # ps ax |grep master
1627 ? S 0:00 /usr/local/pgsql/bin/postmaster -D /var/pgsql/data
30279 ? S 0:00 [master]
2324 ? S 0:00 [master]
8188 pts/1 S 0:00 grep master
LinuxMail:~ # netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1696/
tcp 0 0 0.0.0.0:139 0.0.0.0:* LISTEN 1753/smbd
tcp 0 0 0.0.0.0:110 0.0.0.0:* LISTEN 30279/
tcp 0 0 0.0.0.0:143 0.0.0.0:* LISTEN 30279/
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1220/
tcp 0 0 0.0.0.0:2000 0.0.0.0:* LISTEN 30279/
tcp 0 0 0.0.0.0:10000 0.0.0.0:* LISTEN 1766/perl
tcp 0 0 0.0.0.0:6000 0.0.0.0:* LISTEN 1557/X
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2324/
tcp 0 0 0.0.0.0:697 0.0.0.0:* LISTEN 1364/ypbind
tcp 0 0 :::80 :::* LISTEN 29668/httpd
tcp 0 0 :::22 :::* LISTEN 1370/sshd
tcp 0 0 :::5432 :::* LISTEN 1627/postmaster
so wie ich das sehe arbeitet an Post 25 keiner. Außerdem ist heir die IP 127.0.0.1 vorgegeben - würde das nicht bedeuten, dass nur Anfragen von localhsot an Port 25 angenommen werden ?!
 

oc2pus

Ultimate Guru
mag ja sein das das bei tin so steht ;)
aber wir wollen weiter kommen ....

also tail -f /var/log/mail in einer Konsole

dann rcpostfix restart
wenn dort Fehler stehen, hier posten.
 
OP
P

#patrick

Member
oh man, das scheint ja noch was zu werden ... ich hatte mich erst gefragt, warum es hier soviele Beiträge zum Thema Mailserver gibt, wenn doch so eine umfangreiche Anleitung existiert ... aber das ist wohl doch kniffeliger als ich gedacht habe.

Hier die Meldungen wenn ich rcpostfix reload eingebe:
Aug 5 11:15:02 LinuxMail postfix/cleanup[8016]: 0230119F74: message-id=<20040805091502.0230119F74@LinuxMail.local>
Aug 5 11:15:02 LinuxMail postfix/qmgr[7980]: 0230119F74: from=<>, size=2247, nrcpt=1 (queue active)
Aug 5 11:15:02 LinuxMail postfix/pipe[8019]: 0230119F74: to=<root@LinuxMail.local>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:30:01 LinuxMail postfix/pickup[7979]: 039B719F63: uid=0 from=<root>
Aug 5 11:30:01 LinuxMail postfix/cleanup[8088]: 039B719F63: message-id=<20040805093000.039B719F63@LinuxMail.local>
Aug 5 11:30:01 LinuxMail postfix/qmgr[7980]: 039B719F63: from=<root@LinuxMail.local>, size=607, nrcpt=1 (queue active)
Aug 5 11:30:01 LinuxMail postfix/pipe[8091]: 039B719F63: to=<root@LinuxMail.local>, orig_to=<root>, relay=cyrus, delay=1, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:30:01 LinuxMail postfix/cleanup[8088]: 4C9E019F74: message-id=<20040805093001.4C9E019F74@LinuxMail.local>
Aug 5 11:30:01 LinuxMail postfix/qmgr[7980]: 4C9E019F74: from=<>, size=2247, nrcpt=1 (queue active)
Aug 5 11:30:01 LinuxMail postfix/pipe[8091]: 4C9E019F74: to=<root@LinuxMail.local>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:45:00 LinuxMail postfix/pickup[7979]: 5021119EFD: uid=0 from=<root>
Aug 5 11:45:00 LinuxMail postfix/cleanup[8211]: 5021119EFD: message-id=<20040805094500.5021119EFD@LinuxMail.local>
Aug 5 11:45:00 LinuxMail postfix/qmgr[7980]: 5021119EFD: from=<root@LinuxMail.local>, size=607, nrcpt=1 (queue active)
Aug 5 11:45:00 LinuxMail postfix/pipe[8214]: 5021119EFD: to=<root@LinuxMail.local>, orig_to=<root>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:45:00 LinuxMail postfix/cleanup[8211]: 9F9A319F4C: message-id=<20040805094500.9F9A319F4C@LinuxMail.local>
Aug 5 11:45:00 LinuxMail postfix/qmgr[7980]: 9F9A319F4C: from=<>, size=2247, nrcpt=1 (queue active)
Aug 5 11:45:00 LinuxMail postfix/pipe[8214]: 9F9A319F4C: to=<root@LinuxMail.local>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:59:00 LinuxMail postfix/pickup[7979]: AE1C119F4C: uid=0 from=<root>
Aug 5 11:59:00 LinuxMail postfix/cleanup[8226]: AE1C119F4C: message-id=<20040805095900.AE1C119F4C@LinuxMail.local>
Aug 5 11:59:00 LinuxMail postfix/qmgr[7980]: AE1C119F4C: from=<root@LinuxMail.local>, size=574, nrcpt=1 (queue active)
Aug 5 11:59:01 LinuxMail postfix/pipe[8229]: AE1C119F4C: to=<root@LinuxMail.local>, orig_to=<root>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 11:59:01 LinuxMail postfix/cleanup[8226]: 04AD919F74: message-id=<2004080LinuxMail:~ # tail -f /var/log/mail
Aug 5 11:59:01 LinuxMail postfix/cleanup[8226]: 04AD919F74: message-id=<20040805095901.04AD919F74@LinuxMail.local>
Aug 5 11:59:01 LinuxMail postfix/qmgr[7980]: 04AD919F74: from=<>, size=2214, nrcpt=1 (queue active)
Aug 5 11:59:01 LinuxMail postfix/pipe[8229]: 04AD919F74: to=<root@LinuxMail.local>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 12:00:00 LinuxMail postfix/pickup[7979]: CD9B319F4C: uid=0 from=<root>
Aug 5 12:00:00 LinuxMail postfix/cleanup[8226]: CD9B319F4C: message-id=<20040805100000.CD9B319F4C@LinuxMail.local>
Aug 5 12:00:00 LinuxMail postfix/qmgr[7980]: CD9B319F4C: from=<root@LinuxMail.local>, size=607, nrcpt=1 (queue active)
Aug 5 12:00:01 LinuxMail postfix/pipe[8229]: CD9B319F4C: to=<root@LinuxMail.local>, orig_to=<root>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 12:00:01 LinuxMail postfix/cleanup[8226]: 013B419F74: message-id=<20040805100001.013B419F74@LinuxMail.local>
Aug 5 12:00:01 LinuxMail postfix/qmgr[7980]: 013B419F74: from=<>, size=2247, nrcpt=1 (queue active)
Aug 5 12:00:01 LinuxMail postfix/pipe[8229]: 013B419F74: to=<root@LinuxMail.local>, relay=cyrus, delay=0, status=bounced (data format error. Command output: root: Mailbox does not exist )
Aug 5 12:03:05 LinuxMail postfix/master[2324]: reload configuration
Bei rcpostfix start gibt er nur 'done' aus - keine Einträge unter /var/log/mail
 

oc2pus

Ultimate Guru
ok, du hast noch jede Menge mails an root@blabla in der queue rumstehen.

1.) entweder sorgst du dafür das mails an root umgeleitet werden an einen realen user. Dazu musst du die /etc/aliases editieren und folgendes reinschreiben:
root: <user der die emails von root bekommen soll>
# Basic system aliases that MUST be present.
postmaster: root
und dann postmap /etc/aliases aufrufen, rcpostfix reload nicht vergessen

oder

2.) du erstellst für root einen cyrus-account
 
OP
P

#patrick

Member
jupp, habe ich gemacht - muss zu meiner Schande gestehen, dass ich rot angelegt hatte ... habe jetzt rot gelöscht und root in aliases eingefügt. Wenn ich jetzt reloade kommt in /var/log/mail auch nur noch eine Zeile mit "... reload configuration".

Aber der Fehler beim Senden bleibt bestehen.
 

oc2pus

Ultimate Guru
in deiner /etc/postfix/main.cf gibt es eine Option

BeispieL:
mynetworks = 192.168.0.0/16, 127.0.0.0/8
damit sagst du von wo aus postfix emails annehemn darf, wenn da bei dir nur 127.0.0.1 steht musst du das ergänzen um deine Netzwerk-IP

bei Änderung rcpostfix reload ;)
 
OP
P

#patrick

Member
da steht meine IP schon drin.

hier mein main.cf
readme_directory = /usr/share/doc/packages/postfix/README_FILES
mail_spool_directory = /var/mail
canonical_maps = hash:/etc/postfix/canonical
virtual_maps = hash:/etc/postfix/virtual
relocated_maps = hash:/etc/postfix/relocated
transport_maps = hash:/etc/postfix/transport
sender_canonical_maps = hash:/etc/postfix/sender_canonical
masquerade_exceptions = root
masquerade_classes = envelope_sender, header_sender, header_recipient
myhostname = LinuxMail.local
mynetworks = 10.16.0.0/16, 127.0.0.0/8
program_directory = /usr/lib/postfix
inet_interfaces = 10.16.20.186 127.0.0.1
defer_transports = smtp
disable_dns_lookups = no
relayhost =
mailbox_command = /usr/lib/cyrus/bin/deliver
mailbox_transport = cyrus
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
strict_rfc821_envelopes = no
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
smtp_sasl_auth_enable = yes
smtpd_sasl_auth_enable = yes
smtpd_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 51200000
message_size_limit = 10240000
 

oc2pus

Ultimate Guru
myhostname = linux.acme.com
mydomain = acme.com
myorigin = $mydomain
mynetworks = 192.168.0.0/16, 127.0.0.0/8
mydestination = $myhostname, $mydomain, localhost.$mydomain, mail.$mydomain

die sind alle wichtig und müssen gesetzt sein ;)

ansonsten das was in /var/log/mail steht wenn du eine email an deinen Server sendest ...
 

oc2pus

Ultimate Guru
dann prüf nochmal deine Client Einstellungen....

du kannst aber auch auf der linuxbox mal eingeben
mail -s <irgend-ein-subject> patrick@deine.domain <return-taste>
<hier den mail-text>
.
<return>

wichtig ist der "." ==> EndOfText

damit sendest du eine mail mit dem Betreff an den user patrick@deine.domain

wenn das geht, liegt es an deinem OE Client
 
OP
P

#patrick

Member
jetzt treten plötzlich wieder Fehler in /var/log/mai auf - wo vorher garantiert keine waren.

Aug 5 14:05:13 LinuxMail postfix/smtp[9220]: fatal: specify a password table via the `smtp_sasl_password_maps' configuration parameter
Aug 5 14:05:14 LinuxMail postfix/master[2324]: warning: process /usr/lib/postfix/smtp pid 9220 exit status 1
Aug 5 14:05:14 LinuxMail postfix/master[2324]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
kurz nachdem ich postfix reloade. Die Mail von der Konsole mit mail -s bleibt in der mailq hängen.
 

oc2pus

Ultimate Guru
smtp_sasl_password_map = ? was steht da bei dir?
deaktiviere den EIntrag mal.

die ganzen smtp_* EInträge regeln den outgoing mail Verkehr. Du willst doch aber nur lokale mails schicken?
wie rufst du denn genau dieses mail -s ... auf ? hast du da eine externe domain angegeben ?
 
Oben