1 (edited by mike175de 2020-02-25 23:34:15)

Topic: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.1
- Deployed with iRedMail Easy or the downloadable installer? Installer
- Linux/BSD distribution name and version: Debain 10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hey there,

I transfer my maildomain from another server to a fresh installation of iRM and run into some issues:

1. The Webserver and also the Mailserver are only reachable when I disable Fail2Ban. With activated Fail2Ban there are only connections possible from tie to time. The log of Fail2Ban shows no special banned IPs in that time period.

2. I would like to use subdomains for Sogo, Roundcube and iRedAdmin with sogo.domain.de round.domain,de and ired.domain.de. When I use the subdomain-templates it is only possible to use one of those subdomain-templates. When I activate only on e.g. sogo.domain.de an call round.domani.de it is also goes to sogo.domain.de. Is it possible to use this kind of config with three subdomains? When I put a name_server directive in the emplates it throws just an error due to multiple / aka root) directive.

Any help is greatly appreciated. When there are some logs nedded, plz let me know.

Thx again für your help.

mike

----

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

2 (edited by dandon 2020-02-24 05:04:21)

Re: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

Fail2ban logs to syslog by default. Try to change it in /etc/fail2ban/fail2ban.conf

logtarget = /var/log/fail2ban.log

Otherwise, try running:

(sudo) fail2ban-client status

And then:

(sudo) fail2ban-client status dovecot-iredmail

Replace dovecot-iredmail with other jails to see the IPs which are banned. Examples:
nginx-http-auth, postfix-iredmail, postfix-pregreet-iredmail, roundcube-iredmail, sogo-iredmail, sshd

Then, once you know what is being banned, you can check the logs. Example:

Status for the jail: dovecot-iredmail
|- Filter
|  |- Currently failed: 0
|  |- Total failed:     0
|  `- File list:        /var/log/dovecot/lda.log /var/log/dovecot/pop3.log /var/log/dovecot/imap.log /var/log/dovecot/sieve                                                                                                                                                                                                  .log /var/log/dovecot/dovecot.log
`- Actions
   |- Currently banned: 0
   |- Total banned:     0
   `- Banned IP list:

Then:

(sudo) less /var/log/dovecot/lda.log | grep ##PUT YOUR IP HERE###

3 (edited by dandon 2020-02-24 05:06:41)

Re: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

To use different subdomains, you can use nginx to redirect.

# abc.example.com
server {
  listen 80;
  server_name abc.example.com;
  location / {
    proxy_pass http://127.0.0.1/abc$request_uri;
    proxy_set_header Host example.com;
  }
}

replace abc with sogo in server_name and after the 127.0.0.1/

https://stackoverflow.com/questions/144 … t-redirect

4

Re: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

Thx dandon for your reply.

1. Haven't known that Fail2Ban in iRedMail logs to syslog changed that and will inspect what happens.

2. I applied another Virtualhost as you mentioned in Post#3. But sogo.domain.de is always redirected to sogo.domain.de/mail and the Roundcube-Gui appears. I also tried to include the sogo-subdomain.template in 00-default-ssl.conf and commented the sogo-template out. Had also to comment out this part that Nginx accepts the config:

    root /var/www/html;
    index index.php index.html;

But still the same behaviour. Redirect to sogo.domain.de/mail.

Is there a documentation available how to use suubdomains in iRedmail?

Thx again for any help on that.

Greets mike

5

Re: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

Have you tried the sogo-subdomain.tmpl in /etc/nginx/templates?

6

Re: [Closed] Fresh Installation on Debian 10: Fail2Ban and Subdomains

Hey dandon,

I tried that as well. At the end I put all vhosts in the default-ssl.conf to get it working. It wasn't possible for me to make Nginx serve the subdomains with single vhost.confs.

Thx again for your help

mike