我的Slicehost Ubuntu服务器上的主机名错误

像升级到Rails 2.2的许多人一样,我发送一封电子邮件时遇到了exception情况。 此版本的Rails或更高版本确实需要使用tls发送电子邮件。 生产日志文件中的消息说:

hostname was not match with the server certificate 

我做了大量的研究工作,尽我所能。 我把我的切片的主机名改为ohlalaweb.com。 如果我在CL上运行命令'hostname',我得到:

 ohlalaweb.com 

后缀似乎工作正常。 我可以发送电子邮件到我的Gmail,雅虎和谷歌应用程序的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密钥。

任何想法或build议?

ohlalaweb.com是一个域名,而不是主机名,至less它不应该是。 在“mail.ohlalaweb.com”中,主机名就像“邮件”一样。 证书validation失败,因为服务器名称与证书的CommonName字段中的内容不匹配。

最简单的解决scheme是更改您的服务器的名称以匹配证书的CommonName字段中的条目。