Mailcatcher因EOF错误而失败

时间:2017-10-31 16:41:16

标签: php sendmail

我在服务器上使用mailcatcher。

我的php.ini看起来像 -

[mail function]
; For Unix only.  You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/local/bin/catchmail --smtp-ip 10.1.23.157 --smtp-port 1080 -f test@mytestemails.test

我的错误看起来像 -

/usr/share/ruby/net/protocol.rb:153:in `read_nonblock': end of file reached (EOFError)
    from /usr/share/ruby/net/protocol.rb:153:in `rbuf_fill'
    from /usr/share/ruby/net/protocol.rb:134:in `readuntil'
    from /usr/share/ruby/net/protocol.rb:144:in `readline'
    from /usr/share/ruby/net/smtp.rb:932:in `recv_response'
    from /usr/share/ruby/net/smtp.rb:555:in `block in do_start'
    from /usr/share/ruby/net/smtp.rb:942:in `critical'
    from /usr/share/ruby/net/smtp.rb:555:in `do_start'
    from /usr/share/ruby/net/smtp.rb:520:in `start'
    from /usr/local/share/gems/gems/mail-2.6.3/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!'
    from /usr/local/share/gems/gems/mail-2.6.3/lib/mail/message.rb:2141:in `do_delivery'
    from /usr/local/share/gems/gems/mail-2.6.3/lib/mail/message.rb:238:in `deliver'
    from /usr/local/share/gems/gems/mailcatcher-0.6.5/bin/catchmail:71:in `<top (required)>'
    from /usr/local/bin/catchmail:23:in `load'
    from /usr/local/bin/catchmail:23:in `<main>'

我正在尝试使用 -

发送电子邮件
mail('me@testexample.com', 'testing', 'This is a test');

我可以访问mailcatcher并且服务正在运行。如何解决我的错误?

1 个答案:

答案 0 :(得分:0)

问题是我没有在配置中包含/ usr / bin / env。

sendmail_path = /usr/bin/env /usr/local/bin/catchmail --smtp-ip 10.1.23.157 --smtp-port 1080 -f test@mytestemails.test

这解决了这个问题。