私の電子メール設定は正しいようですが、まだSendGridを介して他の場所から電子メールを送信することはできません。問題はSSL設定にあると思います。これが私が見つけたものです/var/log/mail.log
。
Aug 26 13:42:10 google-way postfix/smtpd[6274]: connect from unknown[177.68.227.182]
Aug 26 13:42:12 google-way postfix/smtpd[6274]: Anonymous TLS connection established from unknown[177.68.227.182]: TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)
Aug 26 13:42:13 google-way postfix/smtpd[6274]: NOQUEUE: reject: RCPT from unknown[177.68.227.182]: 454 4.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<[192.168.1.113]>
これは私のものですpostconf -n
:
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
config_directory = /etc/postfix
header_size_limit = 4096000
inet_interfaces = all
mailbox_size_limit = 0
mydestination = localhost
mydomain = mwdesenvolvimento.com.br
myhostname = mx.$mydomain
mynetworks = 127.0.0.0/8 104.197.230.12 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = $mydomain
readme_directory = no
recipient_delimiter = +
relayhost = [smtp.sendgrid.net]:2525
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot
smtpd_tls_CAfile = /etc/ssl/certs/root.mwdesenvolvimento.com.br.crt
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/mwdesenvolvimento.com.br.crt
smtpd_tls_key_file = /etc/ssl/private/mwdesenvolvimento.com.br.dec.key
smtpd_tls_loglevel = 1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = hash:/etc/postfix/virtual_aliases
virtual_mailbox_domains = $mydomain
virtual_transport = lmtp:unix:private/dovecot-lmtp
これは私のものですdoveconf -n
:
# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 3.16.0-4-amd64 x86_64 Debian 8.5 ext4
auth_mechanisms = plain login
mail_location = maildir:/var/vmail/%d/%n
namespace inbox {
inbox = yes
location =
mailbox Drafts {
special_use = \Drafts
}
mailbox Junk {
special_use = \Junk
}
mailbox Sent {
special_use = \Sent
}
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Trash {
special_use = \Trash
}
prefix =
}
passdb {
args = scheme=CRYPT username_format=%u /etc/dovecot/users
driver = passwd-file
}
protocols = imap lmtp
service auth-worker {
user = $default_internal_user
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0666
user = postfix
}
}
service imap-login {
inet_listener imap {
port = 0
}
inet_listener imaps {
port = 993
}
}
service lmtp {
unix_listener /var/spool/postfix/private/dovecot-lmtp {
group = postfix
mode = 0666
user = postfix
}
}
ssl = required
ssl_ca = </etc/ssl/certs/root.mwdesenvolvimento.com.br.crt
ssl_cert = </etc/ssl/certs/mwdesenvolvimento.com.br.crt
ssl_key = </etc/ssl/private/mwdesenvolvimento.com.br.dec.key
userdb {
args = uid=vmail gid=vmail home=/var/vmail/%d/%n
driver = static
}
ThunderBirdを介して電子メールを送信しようとしましたが、成功しませんでした。前に述べたように、それは問題だとは思わず、SendGrid
外部IPが電子メールを送信することを許可しません。サーバーから電子メールを送信すると機能します。
echo 'Test passed.' | mail -s Test-Email <email>