getgrav / grav-plugin-email

Grav Email Plugin
http://getgrav.org
MIT License
37 stars 29 forks source link

"Expected response code 220 but got code "", with message """ #83

Closed shinsei90 closed 6 years ago

shinsei90 commented 6 years ago

Dear Developers!

I am receiving this error for a few weeks. I tried to find out what could be the problem, but I didn't find anything useful. We are using Ubuntu server 64-bit 16.04 with Sendmail.

Here is my plugin configuration:

enabled: true
from: <our@email.adress>
from_name: gpu.wigner.mta.hu/contact
to: <our@email.adress>
to_name: gpu.wigner.mta.hu/contact
mailer:
  engine: sendmail
  smtp:
    server: localhost
    port: 25
    encryption: none
  sendmail:
    bin: '/usr/sbin/sendmail -bs'
content_type: text/plain
debug: false

and the rest of the error:

Environment & details:

GET Data empty

POST Data

data array:3 [▶]
g-recaptcha-response "03ANcjospbQcYoEKpXTy-Vk7tFSGViO7gzwR25qWCS3iNho8MzZzFwJFp3TlAi2dmH1vUI2YdNDp2pg3jHFG9zaIVoyFBeaDLM09iGUjs9iXvHhMTAF1oU64g30rIo6RWyUKcaTMe0afLOLqCfF49sWAwsgBxv1qGBuuQO-rDOEK1DztLoyKsRhhzsdN9YLQatZVGtq7DPXLQU3_qWdHzz9loWZDrqQOIKQ5BPc79_O6LWKUqIlKxoCQJv2Wou50yvoXDzk50ibZKS--6y8h5MYj9-ofweHEeldVbWnU4QlQ0KDn85AcOUSG9VtHE9--44me0w8gxco5zQjth-PYG-bUAQJUKyTvWJLERwo31ALmZ__Oayt5ok_6eDVLUNfib2hZws_sxDEiBYE1KJwQgCLVtglwFYysHimdf0Yokm3EqGYdRP1QHdaXbei8WKm0bnCesOLt4UqaEIch9yNyw9VMxjs39EDX43Tyvg_RRZIBnfe6XuUus4vqM"
form-name "contact"
unique_form_id "9FaGDViCNJ86ckv41wyB"
form-nonce "e4e6279eb62fcafb77ef724390b88e4e"

Files empty

Cookies

gpu-site-fb9ca33-admin "u57d3k71ccucjmjdgtdeq1drd2"
gpu-site-fb9ca33 "qk9e2uk4nqtsgno8emlm8ei180"
grav-tabs-state "{"tab-content.options.advanced.services":"data.content","tab-content.options.advanced.clients":"data.content","tab-content.options.advanced.columns":"data.columns","tab-content.options.advanced.map":"data.map","tab-content.options.advanced":"data.content","tab-login.registration.Security":"data.login","tab-content.options.advanced.blog":"data.content"}"
_ga "GA1.2.1302796144.1502956560"

Session

redirect_after_login "/contact-us"
user User {}
messages Message {}
files-upload null

Server/Request Data

REDIRECT_STATUS "200"
HTTP_HOST "gpu.wigner.mta.hu"
HTTP_ACCEPT "text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8"
HTTP_ACCEPT_ENCODING "gzip, deflate"
HTTP_ACCEPT_LANGUAGE "en-gb"
CONTENT_TYPE "application/x-www-form-urlencoded"
HTTP_ORIGIN "http://gpu.wigner.mta.hu"
HTTP_USER_AGENT "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6"
HTTP_CONNECTION "keep-alive"
HTTP_UPGRADE_INSECURE_REQUESTS "1"
HTTP_REFERER "http://gpu.wigner.mta.hu/hu/contact-us"
CONTENT_LENGTH "720"
HTTP_COOKIE "gpu-site-fb9ca33-admin=u57d3k71ccucjmjdgtdeq1drd2; gpu-site-fb9ca33=qk9e2uk4nqtsgno8emlm8ei180; grav-tabs-state={%22tab-content.options.advanced.services%22:%22data.content%22%2C%22tab-content.options.advanced.clients%22:%22data.content%22%2C%22tab-content.options.advanced.columns%22:%22data.columns%22%2C%22tab-content.options.advanced.map%22:%22data.map%22%2C%22tab-content.options.advanced%22:%22data.content%22%2C%22tab-login.registration.Security%22:%22data.login%22%2C%22tab-content.options.advanced.blog%22:%22data.content%22}; _ga=GA1.2.1302796144.1502956560"
PATH "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
SERVER_SIGNATURE "
Apache/2.4.18 (Ubuntu) Server at gpu.wigner.mta.hu Port 80
\n"
SERVER_SOFTWARE "Apache/2.4.18 (Ubuntu)"
SERVER_NAME "gpu.wigner.mta.hu"
SERVER_ADDR "148.6.155.1"
SERVER_PORT "80"
REMOTE_ADDR "148.6.182.100"
DOCUMENT_ROOT "/var/www/gpu"
REQUEST_SCHEME "http"
CONTEXT_PREFIX ""
CONTEXT_DOCUMENT_ROOT "/var/www/gpu"
SERVER_ADMIN "admin@email.adress"
SCRIPT_FILENAME "/var/www/gpu/index.php"
REMOTE_PORT "53801"
REDIRECT_URL "/hu/contact-us"
GATEWAY_INTERFACE "CGI/1.1"
SERVER_PROTOCOL "HTTP/1.1"
REQUEST_METHOD "POST"
QUERY_STRING ""
REQUEST_URI "/hu/contact-us"
SCRIPT_NAME "/index.php"
PHP_SELF "/index.php"
REQUEST_TIME_FLOAT 1519643306.601
REQUEST_TIME 1519643306

Environment Variables empty

Registered Handlers

  1. Whoops\Handler\PrettyPageHandler
  2. Whoops\Handler\CallbackHandler

I would be grateful for any help!

julienvanderkluft commented 6 years ago

I have the same issue, I'm looking for a way to fix it and I don't find anything useful too.

rhukster commented 6 years ago

Are you both using sendmail? Have you tried with SMTP? Sendmail is really just a wrapper to the sendmail command on your system, so you could test by trying to send an email using the terminal.

rhukster commented 6 years ago

Also, please try the Email CLI testing command.

shinsei90 commented 6 years ago

I sent test emails out with sendmail command and it's worked without a problem, also tried the Email CLI testing command and this was the output:

$ sudo bin/plugin email test-email -t <my@email.adress> -e gpu.wigner.mta.hu

Current Configuration:

array:8 [
  "enabled" => true
  "from" => "<the email adress we use>"
  "from_name" => "gpu.wigner.mta.hu/contact"
  "to" => "<the email adress we use>"
  "to_name" => "gpu.wigner.mta.hu/contact"
  "mailer" => array:3 [
    "engine" => "sendmail"
    "smtp" => array:5 [
      "server" => "localhost"
      "port" => 25
      "encryption" => "none"
      "user" => ""
      "password" => ""
    ]
    "sendmail" => array:1 [
      "bin" => "/usr/sbin/sendmail -bs"
    ]
  ]
  "content_type" => "text/plain"
  "debug" => false
]

  [Swift_TransportException]                                   
  Expected response code 220 but got code "", with message ""  

test-email [-t|--to TO] [-e|--env [ENV]] [-s|--subject [SUBJECT]] [-b|--body [BODY]]
rhukster commented 6 years ago

It seems to be a problem with sendmail provider. You should probably try an smtp provider, it's going to be much more reliable unless you really know how how to setup sendmail properly.

randoum commented 5 years ago

Simply change

mailer:
  sendmail:
    bin: '/usr/sbin/sendmail -bs'

to

mailer:
  sendmail:
    bin: '/usr/sbin/sendmail -t'

More details: https://linux.die.net/man/8/sendmail.sendmail