Поскольку облако Google не позволяет отправлять электронные письма с виртуальных машин, порт 25 заблокирован, я использую стороннюю службу Mailjet с виртуальной машиной для отправки электронной почты, я использую контейнер докеров для установки postfix и тестирования работы Mailjet.
echo 'Test passed.'
| mail -s Test-Email EMAIL@EXAMPLE.COM
, Почта получает Mailjet.Проблема * При отправке тестового письма echo 'Test passed.' | mail -s Test-Email username@gmail.com
почта отправляется на Mailjet
проблема в том, что он отправляется с использованием root@mydomain.com
, который Mailjet просит меня подтвердить, я настроил support@mydomain.com в Mailjet, чтобы тот же адрес support@mydomain.com вместо root@mydomain.com, пробовал, многие решения не работали,
Хотите изменить адрес отправки root@mydomain.com = support@mydomain.com*
Прикрепленная конфигурация и журналы
/var/log/mail.log
May 14 17:57:38 mydomain postfix/qmgr[1446]: 891A3199F: removed
May 14 18:04:51 mydomain postfix[2587]: Postfix is running with backwards-compatible default settings
May 14 18:04:51 mydomain postfix[2587]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:04:51 mydomain postfix[2587]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:04:51 mydomain postfix/postfix-script[2593]: fatal: the Postfix mail system is already running
May 14 18:04:58 mydomain postfix[2709]: Postfix is running with backwards-compatible default settings
May 14 18:04:58 mydomain postfix[2709]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:04:58 mydomain postfix[2709]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:04:58 mydomain postfix/postfix-script[2715]: fatal: the Postfix mail system is already running
May 14 18:05:17 mydomain postfix[2831]: Postfix is running with backwards-compatible default settings
May 14 18:05:17 mydomain postfix[2831]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:05:17 mydomain postfix[2831]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:05:17 mydomain postfix/postfix-script[2837]: fatal: the Postfix mail system is already running
May 14 18:05:30 mydomain postfix/pickup[1445]: 4506C2086: uid=0 from=<root@mydomain.com>
May 14 18:05:30 mydomain postfix/cleanup[2845]: 4506C2086: message-id=<20180514180530.4506C2086@mydomain.com>
May 14 18:05:30 mydomain postfix/qmgr[1446]: 4506C2086: from=<root@mydomain.com>, size=352, nrcpt=1 (queue active)
May 14 18:05:30 mydomain postfix/smtp[2847]: warning: database /etc/postfix/generic.db is older than source file /etc/postfix/generic
May 14 18:05:31 mydomain postfix/smtp[2847]: 4506C2086: to=<username@gmail.com>, relay=in.mailjet.com[104.xxx.xx.xx]:2525, delay=1.7, delays=0.02/0.01/1.3/0.33, dsn=2.0.0, status=sent (250 OK queued as 64ced0eb-ab23-498b-be32-2c267c128ce4)
May 14 18:05:31 mydomain postfix/qmgr[1446]: 4506C2086: removed
grep postfix / var / log / системный журнал
May 14 17:57:38 mydomain postfix/qmgr[1446]: 891A3199F: removed
May 14 18:04:51 mydomain postfix[2587]: Postfix is running with backwards-compatible default settings
May 14 18:04:51 mydomain postfix[2587]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:04:51 mydomain postfix[2587]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:04:51 mydomain postfix/postfix-script[2593]: fatal: the Postfix mail system is already running
May 14 18:04:58 mydomain postfix[2709]: Postfix is running with backwards-compatible default settings
May 14 18:04:58 mydomain postfix[2709]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:04:58 mydomain postfix[2709]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:04:58 mydomain postfix/postfix-script[2715]: fatal: the Postfix mail system is already running
May 14 18:05:17 mydomain postfix[2831]: Postfix is running with backwards-compatible default settings
May 14 18:05:17 mydomain postfix[2831]: See http://www.postfix.org/COMPATIBILITY_README.html for details
May 14 18:05:17 mydomain postfix[2831]: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
May 14 18:05:17 mydomain postfix/postfix-script[2837]: fatal: the Postfix mail system is already running
May 14 18:05:30 mydomain postfix/pickup[1445]: 4506C2086: uid=0 from=<root@mydomain.com>
May 14 18:05:30 mydomain postfix/cleanup[2845]: 4506C2086: message-id=<20180514180530.4506C2086@mydomain.com>
May 14 18:05:30 mydomain postfix/qmgr[1446]: 4506C2086: from=<root@mydomain.com>, size=352, nrcpt=1 (queue active)
May 14 18:05:30 mydomain postfix/smtp[2847]: warning: database /etc/postfix/generic.db is older than source file /etc/postfix/generic
May 14 18:05:31 mydomain postfix/smtp[2847]: 4506C2086: to=<username@gmail.com>, relay=in.mailjet.com[104.199.96.85]:2525, delay=1.7, delays=0.02/0.01/1.3/0.33, dsn=2.0.0, status=sent (250 OK queued as 64ced0eb-ab23-498b-be32-2c267c128ce4)
May 14 18:05:31 mydomain postfix/qmgr[1446]: 4506C2086: removed
кот /etc/postfix/main.cf
# 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
virtual_alias_maps = hash:/etc/postfix/virtual
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
myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mydomain.com, localhost.com, localhost
relayhost = in.mailjet.com:2525
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
#default_transport = error
#relay_transport = error
inet_protocols = all
smtp_tls_security_level = encrypt
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_generic_maps = hash:/etc/postfix/generic
кот / и т.д. / псевдонимы
# See man 5 aliases for format
postmaster: root
root: support@mydomain.com
кошка / etc / mailname
mydomain.com
Я новичок в конфигурации postfix после того, как попробовал много решений, не смог найти душу, спасибо за любую помощь.