내 Slicehost Ubuntu 서버의 호스트 이름 오류

내 Slicehost Ubuntu 서버의 호스트 이름 오류

Rails 2.2로 업그레이드한 많은 사람들처럼 저도 이메일을 보낼 때 예외가 발생했습니다. 이 Rails 이상 버전에서는 이메일을 보내려면 TLS를 사용해야 합니다. 생산 로그 파일의 메시지는 다음과 같습니다.

hostname was not match with the server certificate

나는 이것에 대해 많은 연구와 작업을 수행했으며 내가 할 수 있는 모든 것을 했습니다. 내 슬라이스의 호스트 이름을 ohlalaweb.com으로 변경했습니다. CL에서 'hostname' 명령을 실행하면 다음과 같은 결과가 나타납니다.

ohlalaweb.com

Postfix는 잘 작동하는 것 같습니다. CL에서 내 Gmail, Yahoo 및 Google 앱 Gmail 계정으로 문제 없이 이메일을 보낼 수 있습니다. 다음은 cat /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

smmtpd_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/ohlalaweb.pem
smtpd_tls_key_file=/etc/ssl/certs/ohlalaweb.pem
smtpd_use_tls=yes
# SA created next line to force postfix to use self create certificate
smtpd_tls_auth_only=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.

myhostname = ohlalaweb.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = localhost.localdomain, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

ohlalaweb.com 호스트 이름으로 SSL 키를 다시 생성했습니다.

어떤 아이디어나 제안이 있나요?

답변1

ohlalaweb.com은 호스트 이름이 아니라 도메인 이름입니다. 적어도 호스트 이름은 아니어야 합니다. 호스트 이름은 'mail.ohlalaweb.com'의 'mail'과 같습니다. 서버 이름이 인증서의 CommonName 필드에 있는 이름과 일치하지 않기 때문에 인증서 유효성 검사에 실패합니다.

가장 쉬운 해결 방법은 인증서의 CommonName 필드 항목과 일치하도록 서버 이름을 변경하는 것입니다.

관련 정보