I am having problems sending mail using SquirrelMail. I asked the open source support for help and here is their response.

What you need to do is look in your logs and show the error that is preventing this. That's the only way to hone in quickly on your problem, especially when asking from help from other people.

Which logs? I looked in the httpd logs but I think that's incorrect because that is the web server log if I'm correct?

But where do I find the SquirrelMail logs? I've searched hours and can't find anything.


SquirrelMail is a PHP application, so its logging behaviour is configured in php.ini. Usually this file lies somewhere like /etc/php/php.ini. In my case it lies in /usr/local/etc/php/php.ini. I configured it like this:

display_errors = Off
log_errors = On
error_log = /dev/stderr

This will cause error messages to be printed out by the Apache process (which in my case is running in a Docker container), but it will not show errors in the browser.

Unfortunately, it seems that SquirrelMail is deliberately suppressing error messages using the @ operator, which makes it impossible to tell what is going on. In my case, I got an error Error connecting to IMAP server. What I had to to to find out more details was to search for this error in the SquirrelMail source code, find a function call above it that was prefixed with a @, remove the @ and then restart my webserver. Then error messages were finally showing up in the log. The line that I had to change looked like this:

$imap_stream = @fsockopen($imap_server_address, $imap_port, $error_number, $error_string, 15);

But depending which error you encounter, you will have to change the source code in a different place.