ubuntuusers.de

Relay Access denied Postfix

Status: Gelöst | Ubuntu-Version: Server 16.10 (Yakkety Yak)
Antworten |

Aniely

Anmeldungsdatum:
13. Mai 2017

Beiträge: 4

Guten Abend, nachdem ich nun 2 Tage alles mögliche ausprobierte und einfach nichts funktioniert, muss ich doch um Hilfe bitten und euch fragen, auch wenn das schon sehr oft in dem Forum behandelt wurde. Aufgrund eines defektes musste sehr schnell ein neuer Mailserver aufgesetzt werden. Hierzu nahm ich Ubuntu, Dovecot und Postfix, zunächst einmal in den einfachsten Konfigurationen mit dem Ziel diese natürlich noch auszubauen. Der derzeitige Iststand: Man kann sich mit Outlook normal anmelden und Mails von intern und extern empfangen. Mails können aber nur von intern zu intern verschickt werden. Wenn ich es via Telnet versuche klappt der Login, aber beim verschicken einer Testmail außerhalb des Firmennetzwerkes erhalte ich die Meldung "Relay Access denied". Diese steht auch jeweils in den Logs. Nachfolgend meine Postfix Konfiguration. Wie kriege ich das hin, dass ich nicht nur quasi an mich selber Mails versenden kann?

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
#smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
myhostname = smtp.bartels-mikrotechnik.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, smtp.domainname, domainname.de, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

sebix Team-Icon

Ehemalige

Anmeldungsdatum:
14. April 2009

Beiträge: 5584

Aniely schrieb:

Wenn ich es via Telnet versuche klappt der Login, aber beim verschicken einer Testmail außerhalb des Firmennetzwerkes erhalte ich die Meldung "Relay Access denied".

Bitte kompletten In- und Output zeigen.

Diese steht auch jeweils in den Logs.

Was genau steht dort? Bitte moeglichst vollstaendig posten, nicht nur einzelne Zeilen.

Wie sieht die master.cf aus?

Aniely

(Themenstarter)

Anmeldungsdatum:
13. Mai 2017

Beiträge: 4

Hallo, danke für deine Antwort. Hoffe das reicht so?? Die Master.cf

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#
# Postfix master process configuration file.  For details on the format
# of the file, see the master(5) manual page (command: "man 5 master" or
# on-line: http://www.postfix.org/master.5.html).
#
# Do not forget to execute "postfix reload" after editing this file.
#
# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (no)    (never) (100)
# ==========================================================================
smtp      inet  n       -       y       -       -       smtpd
#smtp      inet  n       -       y       -       1       postscreen
#smtpd     pass  -       -       y       -       -       smtpd
#dnsblog   unix  -       -       y       -       0       dnsblog
#tlsproxy  unix  -       -       y       -       0       tlsproxy
submission inet n       -       y       -       -       smtpd
#  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       y       -       -       smtpd
#  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
#  -o smtpd_reject_unlisted_recipient=no
#  -o smtpd_client_restrictions=$mua_client_restrictions
#  -o smtpd_helo_restrictions=$mua_helo_restrictions
#  -o smtpd_sender_restrictions=$mua_sender_restrictions
#  -o smtpd_recipient_restrictions=
#  -o smtpd_relay_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       y       -       -       qmqpd
pickup    unix  n       -       y       60      1       pickup
cleanup   unix  n       -       y       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       y       1000?   1       tlsmgr
rewrite   unix  -       -       y       -       -       trivial-rewrite
bounce    unix  -       -       y       -       0       bounce
defer     unix  -       -       y       -       0       bounce
trace     unix  -       -       y       -       0       bounce
verify    unix  -       -       y       -       1       verify
flush     unix  n       -       y       1000?   0       flush
proxymap  unix  -       -       n       -       -       proxymap
proxywrite unix -       -       n       -       1       proxymap
smtp      unix  -       -       y       -       -       smtp
relay     unix  -       -       y       -       -       smtp
#       -o smtp_helo_timeout=5 -o smtp_connect_timeout=5
showq     unix  n       -       y       -       -       showq
error     unix  -       -       y       -       -       error
retry     unix  -       -       y       -       -       error
discard   unix  -       -       y       -       -       discard
local     unix  -       n       n       -       -       local
virtual   unix  -       n       n       -       -       virtual
lmtp      unix  -       -       y       -       -       lmtp
anvil     unix  -       -       y       -       1       anvil
scache    unix  -       -       y       -       1       scache
#
# ====================================================================
# Interfaces to non-Postfix software. Be sure to examine the manual
# pages of the non-Postfix software to find out what options it wants.
#
# Many of the following services use the Postfix pipe(8) delivery
# agent.  See the pipe(8) man page for information about ${recipient}
# and other message envelope options.
# ====================================================================
#
# maildrop. See the Postfix MAILDROP_README file for details.
# Also specify in main.cf: maildrop_destination_recipient_limit=1
#
maildrop  unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail argv=/usr/bin/maildrop -d ${recipient}
#
# ====================================================================
#
# Recent Cyrus versions can use the existing "lmtp" master.cf entry.
#
# Specify in cyrus.conf:
#   lmtp    cmd="lmtpd -a" listen="localhost:lmtp" proto=tcp4
#
# Specify in main.cf one or more of the following:
#  mailbox_transport = lmtp:inet:localhost
#  virtual_transport = lmtp:inet:localhost
#
# ====================================================================
#
# Cyrus 2.1.5 (Amos Gouaux)
# Also specify in main.cf: cyrus_destination_recipient_limit=1
#
#cyrus     unix  -       n       n       -       -       pipe
#  user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
#
# ====================================================================
# Old example of delivery via Cyrus.
#
#old-cyrus unix  -       n       n       -       -       pipe
#  flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
#
# ====================================================================
#
# See the Postfix UUCP_README file for configuration details.
#
uucp      unix  -       n       n       -       -       pipe
  flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
#
# Other external delivery methods.
ifmail    unix  -       n       n       -       -       pipe
  flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
bsmtp     unix  -       n       n       -       -       pipe
  flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -t$nexthop -f$sender $recipient
scalemail-backend unix  -       n       n       -       2       pipe
  flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} ${user} ${extension}
mailman   unix  -       n       n       -       -       pipe
  flags=FR user=list argv=/usr/lib/mailman/bin/postfix-to-mailman.py
  ${nexthop} ${user}

                         

Der Error Log:

May 13 20:07:12 smtp postfix/smtpd[2514]: NOQUEUE: reject: RCPT from unknown[192.168.1.23]: 454 4.7.1 <maildresse@gmx.de>: Relay access denied; from=<mir@meinefirma.de> to=<mailadresse@gmx.de> proto=ESMTP helo=<Janosch>
May 13 20:07:14 smtp postfix/smtpd[2514]: disconnect from unknown[192.168.1.23] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

sebix Team-Icon

Ehemalige

Anmeldungsdatum:
14. April 2009

Beiträge: 5584

Aniely schrieb:

Der Error Log:

May 13 20:07:12 smtp postfix/smtpd[2514]: NOQUEUE: reject: RCPT from unknown[192.168.1.23]: 454 4.7.1 <maildresse@gmx.de>: Relay access denied; from=<mir@meinefirma.de> to=<mailadresse@gmx.de> proto=ESMTP helo=<Janosch>
May 13 20:07:14 smtp postfix/smtpd[2514]: disconnect from unknown[192.168.1.23] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

Auf welchem Port hast du dich connected und hast du dich authentifiziert?

sebix schrieb:

Aniely schrieb:

Wenn ich es via Telnet versuche klappt der Login, aber beim verschicken einer Testmail außerhalb des Firmennetzwerkes erhalte ich die Meldung "Relay Access denied".

Bitte kompletten In- und Output zeigen.

Aniely

(Themenstarter)

Anmeldungsdatum:
13. Mai 2017

Beiträge: 4

Ich habe mynetworks nun das Netz: 192.168.1.0/24 hinzugefügt. Nun klappt der Mailversand ausschließlich aus dem Unternehmen raus. Aber wenn man es von Zuhause aus versucht, klappt es nach wie vor nicht.

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.1.0/24

Telnet von Zuhause aus:

Eingabe:

o smtp.firmendomain.de 25


Ausgabe:

220 smtp.firmendomain.de ESMTP Postfix (Ubuntu)
EHLO test.firmendomain.de
250-smtp.firmenddomain.de
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BitMINE
250 DSN
MAIL FROM:<ich@firmenname.de>
250 2.1.0 Ok
RCPT TO:<meinname@gmx.de>
454 4.7.1 <meinname@gmx.de>: Relay access denied

sebix Team-Icon

Ehemalige

Anmeldungsdatum:
14. April 2009

Beiträge: 5584

Aniely schrieb:

Ich habe mynetworks nun das Netz: 192.168.1.0/24 hinzugefügt. Nun klappt der Mailversand ausschließlich aus dem Unternehmen raus.

Ich wuerde nicht empfehlen, aus den internen Netzwerken keine Authentifizierung zu verlangen. Jede Schadsoftware im Netz koennte damit deinen Server sehr einfach zu einer Spamschleuder machen. Mit Authentifizierung ist es zumindest nicht dermassen trivial.

o smtp.firmendomain.de 25

Um Mails abzusenden, bitte submission auf Port 587 verwenden, wie du es auch selbst konfiguriert hast.

220 smtp.firmendomain.de ESMTP Postfix (Ubuntu)
EHLO test.firmendomain.de
250-smtp.firmenddomain.de
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BitMINE
250 DSN
MAIL FROM:<ich@firmenname.de>
250 2.1.0 Ok
RCPT TO:<meinname@gmx.de>
454 4.7.1 <meinname@gmx.de>: Relay access denied

Du authentifizierst dich nicht. Weiters empfehle ich dringenst, auf submission Starttls zu erzwingen. (Dann mit openssl s_client -connect example.com:587 -starttls smtp statt telnet/netcat testen)

Aniely

(Themenstarter)

Anmeldungsdatum:
13. Mai 2017

Beiträge: 4

Hallo, danke für deine Antwort. Nach einer Nacht Schlaf und etwas seelischem Abstand, kam ich auch dadrauf, dass man ohne Authentifizierung sich nicht einloggen kann. Sehr peinlich. Spamschutz und SSL etc.pp sind nun ebenfalls aktiviert. Ich danke dir nochmals für deine Antworten und deine Mühe.

Antworten |