Hi, I have an IMAP server which was (and still is) working fine when people use a mail client. I decided to offer a web interface and installed Roundcube. With the help of a few people from this forum, I have gotten it to the point where I can login and see the e-mails I have received in their respective IMAP folders. I have been unable however to send any e-mails from Roundcube. The symptom is that when I press the send button/icon in Roundcube, I see a little circle in Firefox which turns over and over (like if it was processing the request). Eventually, the requests times out and the circle disappear but the e-mail hasn't been sent. I have enabled SMTP debugging logs in the Roundcube config but nothing was written there. Roundcube's error log shows:
[11-Oct-2017 01:58:54 UTC] ERROR: Invalid response code received from server (-1)
[11-Oct-2017 01:58:54 +0000]: <g6oW2u6j> SMTP Error: Connection failed: Invalid response code received from server in /data/nginx/html/mail.example.com/program/lib/Roundcube/rcube.php on line 1665 (POST /?_task=mail&_unlock=loading1507688834692&_lang=en&_framed=1&_action=send)
Roundcube session log also complains, though in this case it complains every five minutes (roughly). It happens before I tried to send the e-mail and continues afterwards with the same schedule (i.e., irrespective of my attempt to sending an e-mail). The 2 lines which are repeated every 5 minutes are:
[11-Oct-2017 01:56:55 +0000]: <g6oW2u6j> Session auth check failed for g6ov2u6j1h7fW8ksmpnnue9jb7; timeslot = 2017-10-11 01:55:00
[11-Oct-2017 01:56:55 +0000]: <g6oW2u6j> Send new auth cookie for g6ov2u6j1h7fW8ksmpnnue9jb7: wN9LOyy4gXjIILojfQrfCYVIOd-1507688600
Please note that I didn't know if the alphanumeric strings above contained sensitive data, so I modified them. Postfix logged the following in mail.log:
Oct 11 01:53:54 ip-188-88-88-188 postfix/smtps/smtpd[16783]: connect from localhost[127.0.0.1]
Oct 11 01:58:54 ip-188-88-88-188 postfix/smtps/smtpd[16783]: SSL_accept error from localhost[127.0.0.1]: Connection timed out
Oct 11 01:58:54 ip-188-88-88-188 postfix/smtps/smtpd[16783]: lost connection after CONNECT from localhost[127.0.0.1]
Oct 11 01:58:54 ip-188-88-88-188 postfix/smtps/smtpd[16783]: disconnect from localhost[127.0.0.1] commands=0/0
So it looks like it gave up after 5 minutes. Nginx generated the following errors in its error log:
2017/10/11 01:54:54 [error] 16497#16497: *23 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 88.188.188.188, server: mail.example.com, request: "POST /?_task=mail&_unlock=loading1507686334692&_lang=en&_framed=1 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock", host: "mail.example.com", referrer: "
https://mail.example.com/?_task=mail&_action=compose&_id=183733506889dd789a5ffc8"
2017/10/11 01:54:54 [error] 16497#16497: *23 open() "/data/nginx/html/mail.example.com/50x.html" failed (2: No such file or directory), client: 88.188.188.188, server: mail.example.com, request: "POST /?_task=mail&_unlock=loading1507686334692&_lang=en&_framed=1 HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.1-fpm.sock", host: "mail.example.com", referrer: "
https://mail.example.com/?_task=mail&_action=compose&_id=183733506889dd789a5ffc8"
The second error is my fault (I have yet to create a 50x.html file). The nginx access logs are showing:
88.188.188.188 - - [11/Oct/2017:01:54:54 +0000] "POST /?_task=mail&_unlock=loading1507686334692&_lang=en&_framed=1 HTTP/2.0" 404 162 "
https://mail.example.com/?_task=mail&_action=compose&_id=183733506889dd789a5ffc8" "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0"
There is also a bunch of other entries which seems to be related to refreshing the screen and which are getting a 200 return status code, so I didn't include them.
My setup is consist of postfix + dovecot with postfix getting the authorization from dovecot as to whether a person is allowed to send an email. Roundcube's config file initially defined the user and password to be the same between SMTP and IMAP, but it didn't define the host for SMTP specifically. So just in case the default host which is defined for IMAP didn't cover SMTP, I also specifically defined the SMTP host, but the result was the same.
Finally, the last peace of information which might be useful is the location block (within nginx's server block) which defines how php file requests are handled by nginx:
location ~ \.php$ {
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
include snippets/fastcgi-php.conf;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
I tried to look for other instances when people posted that they couldn't send e-mails, but some of the answers (like setting the SMTP users/pw to be the same as that of IMAP) were already implemented. So right now I seem to be at a loss. If anybody has experienced this problem or has some idea about what might be going on, it would be much appreciated. It is also possible that some additional logging needs to be turned on to make sense of what is happening, in which case I can do so if you let me know. Cheers.