Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/268.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从PHP发送邮件会给出无法路由的地址_Php_Email_Smtp_Exim4 - Fatal编程技术网

从PHP发送邮件会给出无法路由的地址

从PHP发送邮件会给出无法路由的地址,php,email,smtp,exim4,Php,Email,Smtp,Exim4,我有一个运行PHP和Exim4的Debian服务器(当然还有其他东西)。 PHP应用程序每天发送1000封电子邮件,所有这些都很好,但是我现在有了一个新客户,我的PHP/Exim4无法发送到此帐户 PS我添加了--at--来阻止爬虫查找地址 我检查了exim4日志,发现: 这看起来好像路由工作得很好。我再次尝试应用程序电子邮件,但仍然收到无法路由的地址错误 然后我尝试从同一台服务器发送命令行电子邮件 echo“Test message”| mail-s“Test message”az--at--

我有一个运行PHP和Exim4的Debian服务器(当然还有其他东西)。 PHP应用程序每天发送1000封电子邮件,所有这些都很好,但是我现在有了一个新客户,我的PHP/Exim4无法发送到此帐户

PS我添加了--at--来阻止爬虫查找地址

  • 我检查了exim4日志,发现:
  • 这看起来好像路由工作得很好。我再次尝试应用程序电子邮件,但仍然收到无法路由的地址错误

  • 然后我尝试从同一台服务器发送命令行电子邮件

    echo“Test message”| mail-s“Test message”az--at--mentonegrammar

  • 这封电子邮件工作正常并按要求送达,但来自我的PHP应用程序的电子邮件仍然失败

  • 我检查了应用程序:
  • 如前所述,此服务器和应用程序成功发送了1000封电子邮件

  • Mentone语法的IT人员没有表示在接收任何其他电子邮件时有任何问题

  • 总之,我一直在返回exim4日志中的“Unroutable address”(不可路由地址)错误,以及指示该地址可路由的调试输出。我忍不住想Exim4配置有什么问题——但我就是不知道


    有人能给我指一下正确的方向吗?

    解决方案是在m's。应用程序的原始条目有“mentonegrammar”,而我稍后的测试中有“mentonegrammar”。我的浏览器会记住不正确的申请条目并自动填写表格,我没有注意到


    感谢krisFR在ServerFault中的回答。

    exim问题在服务器故障方面可能会做得更好:有没有简单的方法将其转移到ServerFault区域?
    2014-04-02 08:48:10 1WV7TW-0001Em-Od <= support --at-- sobs.com.au H=localhost [127.0.0.1] P=esmtp S=1215 
    2014-04-02 08:48:11 1WV7TW-0001Em-Od ** az --at-- mentonegrammmar: Unrouteable address 
    2014-04-02 08:48:11 1WV7TW-0001Em-Od Completed
    
    Exim version 4.80 uid=0 gid=0 pid=12506 D=fbb95cfd
    Berkeley DB: Berkeley DB 5.1.29: (October 25, 2011)
    Support for: crypteq iconv() IPv6 GnuTLS move_frozen_messages DKIM
    Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch nis nis0 passwd
    Authenticators: cram_md5 plaintext
    Routers: accept dnslookup ipliteral manualroute queryprogram redirect
    Transports: appendfile/maildir/mailstore autoreply lmtp pipe smtp
    Fixed never_users: 0
    Size of off_t: 8
    Compiler: GCC [4.7.2]
    Library version: GnuTLS: Compile: 2.12.20
    Runtime: 2.12.20
    Library version: PCRE: Compile: 8.31
    Runtime: 8.30 2012-02-04
    Total 13 lookups
    WHITELIST_D_MACROS: "OUTGOING"
    TRUSTED_CONFIG_LIST: "/etc/exim4/trusted_configs"
    changed uid/gid: forcing real = effective
    uid=0 gid=0 pid=12506
    auxiliary group list: none
    seeking password data for user "uucp": cache not available
    getpwnam() succeeded uid=10 gid=10
    changed uid/gid: calling tls_validate_require_cipher
    uid=101 gid=103 pid=12507
    auxiliary group list: none
    tls_validate_require_cipher child 12507 ended: status=0x0
    configuration file is /var/lib/exim4/config.autogenerated
    log selectors = 00000ffc 00612001
    trusted user
    admin user
    seeking password data for user "mail": cache not available
    getpwnam() succeeded uid=8 gid=8
    user name "root" extracted from gecos field "root"
    originator: uid=0 gid=0 login=root name=root
    sender address = root --at-- ds6419.hostname.net.au
    Address testing: uid=0 gid=103 euid=0 egid=103
    Testing az --at-- mentonegrammar
    Considering az --at-- mentonegrammar
    routing az --at-- mentonegrammar
    -------- hubbed_hosts router --------
    local_part=az domain=mentonegrammar
    checking domains
    expansion of "${if exists{/etc/exim4/hubbed_hosts}{partial-lsearch;/etc/exim4/hubbed_hosts}fail}"
    forced failure: assume not in this list
    hubbed_hosts router skipped: domains mismatch
    -------- dnslookup_relay_to_domains router --------
    local_part=az domain=mentonegrammar
    checking domains
    search_open: dsearch "/etc/exim4/virtual"
    search_find: file="/etc/exim4/virtual"
    key="mentonegrammar" partial=-1 affix=NULL starflags=0
    LRU list:
    5/etc/exim4/virtual
    End
    internal_search_find: file="/etc/exim4/virtual"
    type=dsearch key="mentonegrammar"
    file lookup required for mentonegrammar
    in /etc/exim4/virtual
    lookup failed
    mentonegrammar.net in "@:localhost:dsearch;/etc/exim4/virtual"? no (end of list)
    mentonegrammar.net in "empty"? no (end of list)
    mentonegrammar.net in "! +local_domains : +relay_to_domains"? no (end of list)
    dnslookup_relay_to_domains router skipped: domains mismatch
    -------- dnslookup router --------
    local_part=az domain=mentonegrammar
    checking domains
    cached no match for +local_domains
    cached lookup data = NULL
    mentonegrammar in "! +local_domains"? yes (end of list)
    R: dnslookup for az@mentonegrammar
    calling dnslookup router
    dnslookup router called for az --at-- mentonegrammar
    domain = mentonegrammar
    DNS lookup of mentonegrammar (MX) succeeded
    DNS lookup of mail.mentonegrammar (AAAA) gave NO_DATA
    returning DNS_NODATA
    DNS lookup of mail.mentonegrammar (A) succeeded
    58.96.103.231 in "0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :255.255.255.255"? no
    (end of list)
    fully qualified name = mentonegrammar
    host_find_bydns yield = HOST_FOUND (2); returned hosts:
    mail.mentonegrammar 58.96.103.231 MX=5
    set transport remote_smtp
    queued for remote_smtp transport: local_part = az
    domain = mentonegrammar
    errors_to=NULL
    domain_data=NULL localpart_data=NULL
    routed by dnslookup router
    envelope to: az --at-- mentonegrammar
    transport: remote_smtp
    host mail.mentonegrammar [58.96.103.231] MX=5
    search_tidyup called
    =============== Exim pid=12506 terminating with rc=0 ===============
    az --at-- mentonegrammar
    router = dnslookup, transport = remote_smtp
    host mail.mentonegrammar [58.96.103.231] MX=5
    
    $mime = new Mail_mime();
    $formattedHeaders = $mime->headers($headers);
    $mime->setHTMLBody($body);
    $content = $mime->get(array('html_charset' => 'utf-8'));
    $smtp = Mail::factory("smtp", array());
    $result = $smtp->send($headers["To"], $formattedHeaders, $content);