1

Topic: Issue with entering to sogo

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
====
- iRedMail version (check /etc/iredmail-release): 0.9.6
- Linux/BSD distribution name and version: Debian 8
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:


Hi

I have already portmapping on port 443 in my internet gateway, to be able to have access from outside to Sogo, I am using portmapping 444 to 444 ip mail server.
Apache listening 444 port.
So i'm using https://mydomain:444  and it works.
But when i trying to enter:

"Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please."

And url became without https and thats the problem.
So i need add https to url and problem solved.

Question: Why server redirect me from https to http and how i can solve this?

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Issue with entering to sogo

Brabus wrote:

Question: Why server redirect me from https to http and how i can solve this?

Question: what Apache configuration did you change?
Which port on public IP do you use? And the port on internal iRedMail server?

3 (edited by lug 2017-05-23 15:04:17)

Re: Issue with entering to sogo

I have the exact same issue

- iRedMail version (check /etc/iredmail-release): 0.9.6
- Linux/BSD distribution name and version: Ubuntu 16.04.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:

I had this in version 0.9.5-1 too and I hoped it would be fixed in version 0.9.6, but after the upgrade the error still exists.
I have not changed any apache configs.

The Apache server is listening https on port 443, but this is only from internal network, so if you open the sogo page from a pc in the same local network it works just fine. From outside of the local network I have a port redirection in the firewall, lets say port 12345 redirects to 443 on device X (the iredmail server)

This is how the url looks like: https://mail.domain.de:12345/SOGo/
If I click on login on the sogo page i get redirected like this:
http://mail.domain.de:12345/SOGo/so/test@domain.de/Mail
changing http to https manually works, but is very annoying

As you can see it redirects me to http, and I have no idea why..

4

Re: Issue with entering to sogo

Hi @lug,

Add a rewrite rule in Apache config file /etc/apache2/sites-enabled/000-default.conf like below:

<VirtualHost>
    [... omit other settings here ...]
    RewriteRule /SOGo(.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

Restart Apache and try again.

5

Re: Issue with entering to sogo

Hi,

unfortunately this doesn't work.
I also tried this in the /etc/apache2/conf-enabled/SOGo.conf where the other rewrite rules are, but then even the login page of sogo redirects to http, which i don't know why.

6

Re: Issue with entering to sogo

Do you have this setting in /etc/apache2/conf-enabled/SOGo.conf:

<Proxy http://127.0.0.1:20000/SOGo>
    # Redirect http access of /SOGo to https
    RequestHeader set "x-webobjects-server-port" "443"
    RequestHeader set "x-webobjects-server-name" "%{HTTP_HOST}e" env=HTTP_HOST
    RequestHeader set "x-webobjects-server-url" "https://%{HTTP_HOST}e" env=HTTP_HOST

    ...

7

Re: Issue with entering to sogo

yes, but line 2&3 were commented, so i uncommented them and restarted apache but still the same issue

8

Re: Issue with entering to sogo

No idea right now, i cannot figure it out with pasted log, better debug and test on your server directly.

Would you like to buy a support ticket for this assistance? If it's ok for you, you can buy a support ticket here:
http://www.iredmail.org/support.html

9

Re: Issue with entering to sogo

Solution found.

There's a missing line in the /etc/apache2/conf-enabled/SOGo.conf

SetEnvIf Host (.*) HTTP_HOST=$1

source: https://github.com/gordonmessmer/sogo/b … /SOGo.conf

Would be nice if this line would be added in future iredmail releases, so others dont have the same problem anymore.

10

Re: Issue with entering to sogo

I have installed iredmail-1.3.2 with sogo and postgresql on FreeBSD 12.2.   Iredadmin is no problem but SOGo cannot show up the login screen.   After checking, the database of sogo is only a view table named "users" being created and other tables (i.e. sogo_acl, sogo_alarms_folder, sogo_cache_folder, sogo_folder_info & other sogo_ tables) being missing.

The log file of sogo is showing 'OCSFolderInfoURL' is not a valid URL: 'postgresql://sogo:<password>@127.0.0.1:5432/sogo/sogo_folder_info.   I have checked the code from /iredmail-1.3.2/functions/sogo.sh which only created the empty database with one view table.  I believe SOGO will generate the relevant tables when it start up.   But now, it is not.

Please help

11

Re: Issue with entering to sogo

laiyukwa wrote:

The log file of sogo is showing 'OCSFolderInfoURL' is not a valid URL: 'postgresql://sogo:<password>@127.0.0.1:5432/sogo/sogo_folder_info.

Could you please show us full line for troubleshooting? (replace the password before pasting)

laiyukwa wrote:

I believe SOGO will generate the relevant tables when it start up.

Yes it does.

12

Re: Issue with entering to sogo

laiyukwa wrote:

The log file of sogo is showing 'OCSFolderInfoURL' is not a valid URL: 'postgresql://sogo:<password>@127.0.0.1:5432/sogo/sogo_folder_info.

Even though the Thread is a little older, just wanted to share that I had this issue because of a forward slash and plus sign in the Password of the sogo postgres user. I changed it to only Chars and Numbers, adjusted the sogo.conf, afterwards the "is not a valid URL" error was gone and a connection to the Database could be established by sogod.