大网数据广告活动
服务器运维问答

Postfix with Docker: Error connecting to SMTP - 454 4.7.1: Relay access denied

· 52CE 我爱测

So I have the following Setup Ubuntu 16.04 Server with postfix installed, running BigBlueButton On that, I have a docker container with Greenlight which is basicly the frontend of BigBlueButton This Docker Container has the IP 17…

问题原文

原帖链接 · jogoe · CC BY-SA 4.0

So I have the following Setup

Ubuntu 16.04 Server with postfix installed, running BigBlueButton

On that, I have a docker container with Greenlight which is basicly the frontend of BigBlueButton

This Docker Container has the IP 172.18.0.3 (which I added to my networks at the postfix config file)

When I run

docker run --rm --env-file .env bigbluebutton/greenlight:v2 bundle exec rake conf:check

to check if the config and mail is working, I get the following output:

Checking environment: Passed
Checking Connection: Passed
Checking Secret: Passed
Checking SMTP connection: Failed
Error connecting to SMTP - 454 4.7.1 <[email omitted]>: Relay access denied

My Greenlight(Docker) SMTP Config in .env File:

SMTP_SERVER=mydomain.example.com
SMTP_PORT=25
SMTP_DOMAIN=mydomain.example.com
#SMTP_USERNAME=
#SMTP_PASSWORD=
#SMTP_AUTH=
SMTP_STARTTLS_AUTO=true

# Specify the email address that all mail is sent from
SMTP_SENDER=[email omitted]

# Specify the recipient for test emails (needed for providers like Microsoft, who are very
# strict about RFC 2606)
SMTP_TEST_RECIPIENT=[email omitted]

My postfix main.cf File:

# 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 = /usr/share/doc/postfix

# TLS parameters
smtpd_tls_cert_file=/etc/letsencrypt/live/mydomain.example.com/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/mydomain.example.com/privkey.pem
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.

mydomain = mydomain.example.com
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mydomain.example.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.example.com, localhost.example.com, localhost, localhost.localdomain, $mydomain, $myhostname
relayhost =
mynetworks = localhost, 127.0.0.1, 172.18.0.2, 172.18.0.3
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
virtual_mailbox_domains=mydomain.example.com
relay_domains = $mydestination
html_directory = /usr/share/doc/postfix/html

I have tried various changes to mynetworks setting, including setting it to 0.0.0.0 which to my knowledge should allow anyone to send mails - but it still didn't work.

EDIT:

This is my postfix log:

connect from unknown[172.17.0.2]
Nov 17 13:42:58 webinar postfix/smtpd[5604]: NOQUEUE: reject: RCPT from unknown[172.17.0.2]: 454 4.7.1 <[email omitted]>: Relay access denied; from=$ from=<[email omitted]> to=<[email omitted]> proto=ESMTP helo=<mydomain.example.com>

Nov 17 13:42:58 webinar postfix/smtpd[5604]: disconnect from unknown[172.17.0.2] ehlo=2 starttls=1 mail=1 rcpt=0/1 quit=1 commands=5/6

已采纳解答

原帖链接 · Timor · CC BY-SA 4.0

Are you certain that you got the IP addresses right? According to your postfix log, the sender is 172.17.0.2, not 172.18.0.3.

Could you add 172.17.0.2 to mynetworks and try again?

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2020-11-17)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。