Mengirim email di dalam wadah docker ke host smtp yang menjalankan postfix

Pada server yang saya jalankan keduanya docker gambar dan postfix smtp server. Server smtp dapat diakses melalui localhost dan tidak dipasang dalam wadah apa pun.

Masalahnya adalah saya dapat mengirim email melalui terminal menggunakan sendemail di luar tetapi saya tidak dapat mengirim email melalui terminal yang menjalankan sendemail di dalam wadah apa pun.

Konfigurasi postfix adalah sebagai berikut:

# 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/mailnamesmtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)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 = 4hreadme_directory = no# TLS parameterssmtpd_tls_cert_file=/etc/letsencrypt/live/ellak.org/fullchain.pemsmtpd_tls_key_file= /etc/letsencrypt/live/ellak.org/privkey.pemsmtpd_use_tls=yessmtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scachesmtp_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_destinationmyhostname = guest8.ellak.gralias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesmyorigin = /etc/mailnamemydestination = mail.ellak.org, guest8.ellak.gr, localhost.ellak.gr, localhost#Virtual alias domainsvirtual_alias_domains = ellak.org# RELAY Optionsrelayhost = [mail1.ellak.gr]:587smtp_sasl_auth_enable = yessmtp_sasl_security_options = noanonymoussmtp_sasl_password_maps = hash:/etc/postfix/sasl_passwdsmtp_use_tls = yessmtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crtlocal_recipient_maps = proxy:unix:passwd.byname $alias_mapssmtp_tls_note_starttls_offer = yes#Network Access Optionsmynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.0.0/16mailbox_size_limit = 0recipient_delimiter = +inet_interfaces = allrelay_domains = *

Di dalam wadah yang saya jalankan:

sendemail -s 172.17.0.1:25 -f no-reply@ellak.org -t katanophoros@gmail.com -u Hello -m Hello

Dan output kesalahan berikut:

Nov 27 19:51:14 7e56b4e22e09 sendemail[1988]: WARNING => The recipient <katanophoros@gmail.com> was rejected by the mail server, error follows:Nov 27 19:51:14 7e56b4e22e09 sendemail[1988]: WARNING => Received:  454 4.7.1 <katanophoros@gmail.com>: Relay access deniedNov 27 19:51:14 7e56b4e22e09 sendemail[1988]: ERROR => Exiting. No recipients were accepted for delivery by the mail server.

Pada log postfix yang saya dapatkan adalah:

Nov 27 21:42:54 guest8 postfix/smtpd[14979]: NOQUEUE: reject: RCPT from unknown[172.18.0.5]: 454 4.7.1 <katanophoros@gmail.com>: Relay access denied; from=<no-reply@ellak.org> to=<katanophoros@gmail.com> proto=ESMTP helo=<7e56b4e22e09>Nov 27 21:42:54 guest8 postfix/smtpd[14979]: lost connection after RCPT from unknown[172.18.0.5]Nov 27 21:42:54 guest8 postfix/smtpd[14979]: disconnect from unknown[172.18.0.5]Nov 27 21:46:14 guest8 postfix/anvil[14982]: statistics: max connection rate 2/60s for (smtp:172.18.0.5) at Nov 27 21:42:54Nov 27 21:46:14 guest8 postfix/anvil[14982]: statistics: max connection count 1 for (smtp:172.18.0.5) at Nov 27 21:42:41Nov 27 21:46:14 guest8 postfix/anvil[14982]: statistics: max cache size 1 at Nov 27 21:42:41

Apakah anda punya ide bagaimana saya akan mengirim email di dalam wadah docker?

172.18.0.5 tidak termasuk dalam mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.17.0.0/16

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.16.0.0/12

ini termasuk semua subnet 172.16 pribadi.