1

Topic: after installation, browser forces to https://ipadress/mail

==== Required information ====
- iRedMail version: 0.9.0
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Web server (Apache or Nginx):ngic
- Linux/BSD distribution name and version: debian 7
- Related log if you're reporting an issue:
====

I moved an existing website to a virtual server. Nginx was working fine. After installing iredmail, going to the ipaddrs/index.html forces the browser to https://ipadress/mail

(I haven't redirected the dns or mx record to the new website, so I am addressing it with a dotted quad.)

I did not select roundcube specifically because I wasn't going to setup SSL on the website. I never use webmail anyway. But I suspect iredmail will require SSL since it has a web control panel. Thus two questions:
1) How to get around this automatic connection to the /mail directory
2) Can I administer the email without the web access. Maybe install a brower on the server and ssh  -X.

----

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

2

Re: after installation, browser forces to https://ipadress/mail

Check file /var/www/index.html, it's generated by iRedMail and it will redirect to '/mail'.

3

Re: after installation, browser forces to https://ipadress/mail

You can remove ssh for iRedAdmin but this is unsafe. You could close off port 80 and then browse it through an ssh tunnel if you wish. IRedAdmin is a site within nginx, so you can change settings for it like any other site.

4

Re: after installation, browser forces to https://ipadress/mail

ZhangHuangbin wrote:

Check file /var/www/index.html, it's generated by iRedMail and it will redirect to '/mail'.

You are correct. I changed the name to oldindex.html and it no longer goes to the mail directory, However, nginx isn't finding /usr/share/nginx/www , so the website doesn't work. Further /var/www isn't in the nginx "locations", so I don't understand how it ever found that directory.

I stopped nginx, did a reload, then started nginx just for yucks and no difference.

5

Re: after installation, browser forces to https://ipadress/mail

7t3chguy wrote:

You can remove ssh for iRedAdmin but this is unsafe. You could close off port 80 and then browse it through an ssh tunnel if you wish. IRedAdmin is a site within nginx, so you can change settings for it like any other site.

I don't see iredmail in my usr/share/nginx/www directory.

Maybe i should elaborate a bit. i already had nginx installed before I installed iredmail. Does the iredmail installation clobber the settings for the previous nginx? The old files seem OK, but clearly nginx is searching for content other than usr/share/nginx.

6

Re: after installation, browser forces to https://ipadress/mail

Look at your nginx config. IRedAdmin gets installed to /usr/share/apache2/iredadmin

7

Re: after installation, browser forces to https://ipadress/mail

I see /usr/share/apache2/iredadmin. So do I have to manually add it to my /etc/nginx/sites-available/default file? Even so, this doesn't explain why nginx no longer finds my website at /usr/share/nginx/www . So iredmail must have changed something else.

I tried ssh -X then running python iredadmin.py, It doesn't render on in my shell. I thought it might need a browser installed on the server, but that didn't work.

I really don't want to set up ssl just for iredamin. Nothing else on the website needs https.

8

Re: after installation, browser forces to https://ipadress/mail

That wouldn't work, iRedAdmin.py will start a Web server, unless it's ran through uwsgi, then it'll just send content
Share your nginx sites and conf.d files. A shell can't render html anyway. You can remove the 443 and replace it with 80 in the iRedAdmin config of nginx.  (I think in conf.d)

9

Re: after installation, browser forces to https://ipadress/mail

/etc/nginx/conf.d/default.conf in my case has the relevant iRedAdmin Nginx settings. And it sets the webroot as /var/www; The Section which starts with the comment # HTTPS is the one you need to change.
Change listen 443 to listen 80
Remove all the ssl* lines
And then after a reload/restart it'll run without SSL for you.

10

Re: after installation, browser forces to https://ipadress/mail

7t3chguy wrote:

/etc/nginx/conf.d/default.conf in my case has the relevant iRedAdmin Nginx settings. And it sets the webroot as /var/www; The Section which starts with the comment # HTTPS is the one you need to change.
Change listen 443 to listen 80
Remove all the ssl* lines
And then after a reload/restart it'll run without SSL for you.

Yeah, but I can't run administration over the Internet without ssl. Well I could, but it would be a bad idea. So I'm the first person to grumble about having to set up SSL just for administration? I mean there really isn't a way to do this just SSHed into the server?

11

Re: after installation, browser forces to https://ipadress/mail

Change listen 443 to listen 127.0.0.1:80
So only internal access is allowed, then you can use a SOCKS Proxy/SSH Tunnel to browse it over SSH through a regular browser.

12

Re: after installation, browser forces to https://ipadress/mail

7t3chguy wrote:

Change listen 443 to listen 127.0.0.1:80
So only internal access is allowed, then you can use a SOCKS Proxy/SSH Tunnel to browse it over SSH through a regular browser.

I will give that a try.

It also occurred to me that I don't have to go to a CA and get a cert since I will be the only person using the administration panel over the Internet. That is, the browser will grumble about the cert not being recognized, but I can just add an exception.

13

Re: after installation, browser forces to https://ipadress/mail

Iredmail already sets up a self signed certificate so without changing any settings it works at https://domain/iredadmin
You do get a warning as it is self signed but it's just as secure as a validly signed certificate

14

Re: after installation, browser forces to https://ipadress/mail

I've managed to get neither the website or iredmail working. Given the complexity of iredmail, I rather reinstall it, get it working, then try to integrate my website into Nginx.

Is there a preferred way to reinstall iredmail?

15

Re: after installation, browser forces to https://ipadress/mail

gariac wrote:

I see /usr/share/apache2/iredadmin. So do I have to manually add it to my /etc/nginx/sites-available/default file?

No.

gariac wrote:

Even so, this doesn't explain why nginx no longer finds my website at /usr/share/nginx/www . So iredmail must have changed something else.

Please check /etc/nginx/nginx.conf and /etc/nginx/conf.d/*.conf to figure out which directories are used in Nginx.

gariac wrote:

I tried ssh -X then running python iredadmin.py, It doesn't render on in my shell. I thought it might need a browser installed on the server, but that didn't work.

"python iredadmin.py" will listen on port 8080 by default, you need a web browser on client side to access it.
And, don't run iRedAdmin this way, use a Apache/Nginx server please.

gariac wrote:

I really don't want to set up ssl just for iredamin. Nothing else on the website needs https.

You'd better protect your applications with SSL if you need to type username/password to login. Especially it's an administration tool.

gariac wrote:

Is there a preferred way to reinstall iredmail?

Reinstall OS, then install iRedMail.

16

Re: after installation, browser forces to https://ipadress/mail

I'm going to reload the OS on the server, then install iredmail from scratch. Once I get it working, I will try to integrate my website. It is unreasonable to expect help with weird configurations of iredmail. Even if I got a weird set up working, it won't survive and upgrade.

Go ahead and close this thread. Hopefully I won't be back with more questions if I do a fresh install.