我最近build立了一个由postfix和dovecot组成的邮件服务器。 昨天我加了nginx和roundcube 。 SPF,DKIM,DMARC,rDNSlogging全部完成。 Gmail会将我的邮件视为有效邮件并将其发送到我的收件箱。 一切正在工作。 除了一点烦人的事情。
当我使用Android的内置MUA或其他MUA时,一切都还好。 当我想用roundcube发送邮件时,问题就开始了。 邮件仍然被validation并正确传递,但没有主题。 不知何故,圆环正在失去主题领域,并发送我的电子邮件没有主题。
我一直在寻找一个连续7个小时的答案,但是看起来我是世界上唯一遇到这个问题的人。 这使我认为我的服务器或configuration什么是错误的,但我四重检查了我所有的configuration,我仍然无能为力。
任何帮助将是非常有用的。 在此先感谢您的时间。
我的邮件服务器在一个768MB RAM的OpenVZ盒子上,运行CentOS 7 Minimal。 后缀版本:2.10.1 Dovecot版本:2.2.10 Roundcube版本:1.1.0
我的postconf -n输出:
alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 disable_vrfy_command = yes html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man mydestination = localhost myhostname = mail.example.com newaliases_path = /usr/bin/newaliases.postfix non_smtpd_milters = unix:/var/run/opendkim/opendkim.sock queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES sample_directory = /usr/share/doc/postfix-2.10.1/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_data_restrictions = reject_unauth_pipelining smtpd_delay_reject = no smtpd_helo_required = yes smtpd_helo_restrictions = reject_unknown_helo_hostname, reject_non_fqdn_helo_hostname, reject_invalid_helo_hostname smtpd_milters = unix:/var/run/opendkim/opendkim.sock smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_relay_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_sender_restrictions = reject_unknown_sender_domain smtpd_tls_auth_only = yes smtpd_tls_cert_file = /etc/pki/dovecot/certs/dovecot.pem smtpd_tls_key_file = /etc/pki/dovecot/private/dovecot.pem smtpd_use_tls = yes strict_rfc821_envelopes = yes unknown_local_recipient_reject_code = 550 virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf virtual_transport = lmtp:unix:private/dovecot-lmtp
config/config.inc.php我的Roundcubeconfiguration摘录:
$config['debug_level'] = 5; $config['db_dsnw'] = 'mysql://user:pass@localhost/database'; $config['default_host'] = 'tls://localhost'; $config['default_port'] = 993; $config['smtp_server'] = 'tls://localhost'; $config['smtp_port'] = 587; $config['ip_check'] = true; $config['identities_level'] = 3; $config['des_key'] = 'some key'; $config['mime_types'] = '/usr/share/nginx/html/roundcube/mime.types'; $config['preview_pane'] = true;
我已经find了解决我自己的问题。
以下是程序/ steps / mail / sendmail.inc中的第507-513行。
// encoding subject header with mb_encode provides better results with asian characters if (function_exists('mb_encode_mimeheader')) { mb_internal_encoding($message_charset); $headers['Subject'] = mb_encode_mimeheader($headers['Subject'], $message_charset, 'Q', "\r\n", 8); mb_internal_encoding(RCUBE_CHARSET); }
这是提到$headers['Subject']variables的两个地方之一。 另一个是设置variables的第196行。
既然我和我的客户都不和亚洲人物有任何关系,我决定对这个代码块进行评论,看看会发生什么,瞧! 主题开始工作。 看来roundcube有一个奇怪的bug。 我希望这有助于某个人。