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

Mails der eigenen Domain lokal zustellen

Status
Für weitere Antworten geschlossen.

danau

Member
Habe einen Suse 9.1 PE Mailserver mit Postfix, Fetchmail und QPopper. Der Linux-Server funktioniert nach anfänglichen Einstellungsproblemen (bin kein Linux-Profi) jetzt ganz gut. :D Aber eine Sache gefällt mir noch nicht recht: :?

Werden E-Mails der eigenen Domain verschickt, so hätte ich gern, dass diese nicht erst an der ISP (z.B. web.de) geschickt und dann vom Mailserver wieder abgeholt und zugestellt werden, sondern direkt lokal verteilt werden.

Es müsste also eine Möglichkeit geben, dem Mailserver zu sagen, dass alle E-Mails mit der Empfängeradresse der Domain MeineDomain.de lokal zugestellt werden. Gibt's da eine Möglichkeit?
 

oc2pus

Ultimate Guru
# The mydestination parameter specifies the list of domains that this
# machine considers itself the final destination for.
#
# These domains are routed to the delivery agent specified with the
# local_transport parameter setting. By default, that is the UNIX
# compatible delivery agent that lookups all recipients in /etc/passwd
# and /etc/aliases or their equivalent.
#
# The default is $myhostname + localhost.$mydomain. On a mail domain
# gateway, you should also include $mydomain.
#
# Do not specify the names of virtual domains - those domains are
# specified elsewhere (see VIRTUAL_README).
#
# Do not specify the names of domains that this machine is backup MX
# host for. Specify those names via the relay_domains settings for
# the SMTP server, or use permit_mx_backup if you are lazy (see
# STANDARD_CONFIGURATION_README).
#
# The local machine is always the final destination for mail addressed
# to user@[the.net.work.address] of an interface that the mail system
# receives mail on (see the inet_interfaces parameter).
#
# Specify a list of host or domain names, /file/name or type:table
# patterns, separated by commas and/or whitespace. A /file/name
# pattern is replaced by its contents; a type:table is matched when
# a name matches a lookup key (the right-hand side is ignored).
# Continue long lines by starting the next line with whitespace.
#
# See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
#

also setze mal den mydestination Parameter ;)
 
OP
D

danau

Member
Danke für die schnelle Antwort! Ich vermute der mydestination Parameter ist in der main.cf zu setzen ?
 

oc2pus

Ultimate Guru
ja, in der /etc/postfix/main.cf um ganz genau zu sein ;)

nach der Änderung postfix reload nicht vergessen!
 
OP
D

danau

Member
oc2pus schrieb:
ja, in der /etc/postfix/main.cf um ganz genau zu sein ;)

nach der Änderung postfix reload nicht vergessen!

Das habe ich jetzt mal getestet... Mit dem Ergebnis, dass ich nun keine E-Mails mehr versenden kann. Es kommt folgender Fehler auf Mailclient-Seite (Outlook-Express):

Die Nachricht konnte nicht gesendet werden, da einer der Empfänger vom Server nicht akzeptiert wurde. Die nicht akzeptierte E-Mail-Adresse ist 'testuser@meinedomain.de'. Betreff 'testuser', Konto: 'Daniel Auerbach', Server: 'mailserver', Protokoll: SMTP, Serverantwort: '450 <daniel.auerbach@meinedomain.de>: Sender address rejected: User unknown in local recipient table', Anschluss: 25, Secure(SSL): Nein, Serverfehler: 450, Fehlernummer: 0x800CCC79

Was stimmt denn da nicht :?:
 

oc2pus

Ultimate Guru
was dein Client da so ausspuckt ist nett, aber wir brauchen die Server-Meldungen :)

wenn du eine email sendest, beobachte das server-log mit:
tail -f /var/log/mail

und die postfix Konfigurationsdatei... (ohne Kommentare und Leerzeilen)
cat /etc/postfix/main.cf | grep -v "^#" | grep -v "^$"
 
OP
D

danau

Member
Also der Befehl
oc2pus schrieb:
tail -f /var/log/mail
bringt:
Jan 24 13:14:48 linux postfix/smtpd[23815]: connect from pc19.intern[192.168.1.119]
Jan 24 13:14:48 linux postfix/smtpd[23815]: NOQUEUE: reject: RCPT from pc19.intern[192.168.1.119]: 450 <daniel.auerbach@meinedomain.de>: Sender address rejected: User unknown in local recipient table; from=<daniel.auerbach@meinedomain.de> to=<testuser@meinedomain.de> proto=ESMTP helo=<pc19>
Jan 24 13:14:49 linux postfix/smtpd[23815]: disconnect from pc19.intern[192.168.1.119]


und dann noch einen anderen Fehler der damit wahrscheinlich nichts zu tun hat:
Jan 24 13:15:00 linux popper[23818]: (v4.0.5) Unable to get canonical name of client 192.168.5.173: Unknown host (1) [pop_init.c:1087]

oc2pus schrieb:
und die postfix Konfigurationsdatei... (ohne Kommentare und Leerzeilen)
cat /etc/postfix/main.cf | grep -v "^#" | grep -v "^$"
bringt:

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
unknown_local_recipient_reject_code = 450


debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = maildrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/packages/postfix/samples
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 = linux.site
program_directory = /usr/lib/postfix
inet_interfaces = all
masquerade_domains =
mydomain = meinedomain.de
mynetworks = 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24, 192.168.4.0/24, 192.168.5.0/24, 192.168.6.0/24, 192.168.9.0/24, 127.0.0.0/24
mydestination = $myhostname,localhost.$mydomain,$mydomain
defer_transports =
disable_dns_lookups = no
relayhost = meinedomain.de
content_filter = vscan:
mailbox_command = /usr/bin/procmail
mailbox_transport =
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 = no
smtpd_use_tls = no
smtp_use_tls = no
alias_maps = hash:/etc/aliases
mailbox_size_limit = 0
message_size_limit = 10240000
smtp_sasl_security_options =
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
 

oc2pus

Ultimate Guru
an 24 13:14:48 linux postfix/smtpd[23815]: NOQUEUE: reject: RCPT from pc19.intern[200.1.1.119]: 450 <daniel.auerbach@ratiomobil.de>: Sender address rejected: User unknown in local recipient table; from=<daniel.auerbach@ratiomobil.de> to=<testuser@ratiomobil.de> proto=ESMTP helo=<pc19>

tja, dein postfix kennt den daniel.auerbach@ratiomobil nicht
==> sender adress rejected 450

als Tip:
wie legitimieren sich deine user gegenüber postfix ?
was steht in der "local recipient table" ?
 
OP
D

danau

Member
oc2pus schrieb:
wie legitimieren sich deine user gegenüber postfix ?
Die Anmeldung erfolgt ohne Kennwortauthentifizierung. Es wird nur geprüft, ob der Versender innerhalb des lokalen Netzes liegt, d.h. z.B. 192.168.1.0/24. Sollte ich das ändern in Kennwortauthentifizierung?

oc2pus schrieb:
was steht in der "local recipient table" ?

Habe schon gesucht, aber nichts gefunden. Wo steht die "local recipient table" oder in welcher Datei :?:
 

oc2pus

Ultimate Guru
warum öffnest du nicht einfach mal deine /etc/postfix/main.cf und suchst nach dem Wort "local_recipient" ....du wirst erstaunt sein was du alles findest :)
 
OP
D

danau

Member
Na dann werde ich mal die /etc/postfix/main.cf öffnen... Die habe ich zwar oben schon gepostet aber vielleicht meinst Du ja die Kommentarzeilen?! :roll:
 
Status
Für weitere Antworten geschlossen.
Oben