Servidor Perfecto · 3 min read · Sep 27, 2025

El Servidor Perfecto - Debian Squeeze (Debian 6.0) Con BIND & Courier [ISPConfig 3] - Página 5

17 Instalar fail2ban

Esto es opcional pero recomendado, porque el monitor de ISPConfig intenta mostrar el registro:

apt-get install fail2ban

Para hacer que fail2ban monitoree PureFTPd, SASL y Courier, crea el archivo /etc/fail2ban/jail.local:

vi /etc/fail2ban/jail.local

| [pureftpd] enabled = true port = ftp filter = pureftpd logpath = /var/log/syslog maxretry = 3 [sasl] enabled = true port = smtp filter = sasl logpath = /var/log/mail.log maxretry = 5 [courierpop3] enabled = true port = pop3 filter = courierpop3 logpath = /var/log/mail.log maxretry = 5 [courierpop3s] enabled = true port = pop3s filter = courierpop3s logpath = /var/log/mail.log maxretry = 5 [courierimap] enabled = true port = imap2 filter = courierimap logpath = /var/log/mail.log maxretry = 5 [courierimaps] enabled = true port = imaps filter = courierimaps logpath = /var/log/mail.log maxretry = 5 |

Luego crea los siguientes cinco archivos de filtro:

vi /etc/fail2ban/filter.d/pureftpd.conf

| [Definition] failregex = .*pure-ftpd: \(.*@\) \[WARNING\] Authentication failed for user.* ignoreregex = |

vi /etc/fail2ban/filter.d/courierpop3.conf

| # Fail2Ban configuration file # # $Revision: 100 $ # [Definition] # Option: failregex # Notes.: regex to match the password failures messages in the logfile. The # host must be matched by a group named "host". The tag "" can # be used for standard IP/hostname matching and is only an alias for # (?:::f{4,6}:)?(?P\S+) # Values: TEXT # failregex = pop3d: LOGIN FAILED.*ip=\[.*:\] # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = |

vi /etc/fail2ban/filter.d/courierpop3s.conf

| # Fail2Ban configuration file # # $Revision: 100 $ # [Definition] # Option: failregex # Notes.: regex to match the password failures messages in the logfile. The # host must be matched by a group named "host". The tag "" can # be used for standard IP/hostname matching and is only an alias for # (?:::f{4,6}:)?(?P\S+) # Values: TEXT # failregex = pop3d-ssl: LOGIN FAILED.*ip=\[.*:\] # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = |

vi /etc/fail2ban/filter.d/courierimap.conf

| # Fail2Ban configuration file # # $Revision: 100 $ # [Definition] # Option: failregex # Notes.: regex to match the password failures messages in the logfile. The # host must be matched by a group named "host". The tag "" can # be used for standard IP/hostname matching and is only an alias for # (?:::f{4,6}:)?(?P\S+) # Values: TEXT # failregex = imapd: LOGIN FAILED.*ip=\[.*:\] # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = |

vi /etc/fail2ban/filter.d/courierimaps.conf

| # Fail2Ban configuration file # # $Revision: 100 $ # [Definition] # Option: failregex # Notes.: regex to match the password failures messages in the logfile. The # host must be matched by a group named "host". The tag "" can # be used for standard IP/hostname matching and is only an alias for # (?:::f{4,6}:)?(?P\S+) # Values: TEXT # failregex = imapd-ssl: LOGIN FAILED.*ip=\[.*:\] # Option: ignoreregex # Notes.: regex to ignore. If this regex matches, the line is ignored. # Values: TEXT # ignoreregex = |

Reinicia fail2ban después:

/etc/init.d/fail2ban restart  

18 Instalar SquirrelMail

Para instalar el cliente de webmail SquirrelMail, ejecuta

apt-get install squirrelmail

Luego crea el siguiente enlace simbólico…

ln -s /usr/share/squirrelmail/ /var/www/webmail

… y configura SquirrelMail:

squirrelmail-configure

Debemos decirle a SquirrelMail que estamos usando Courier-IMAP/-POP3:

SquirrelMail Configuración : Leer: config.php (1.4.0)

Menú Principal –
1.  Preferencias de Organización
2.  Configuraciones del Servidor
3.  Valores por Defecto de Carpeta
4.  Opciones Generales
5.  Temas
6.  Libros de Direcciones
7.  Mensaje del Día (MOTD)
8.  Plugins
9.  Base de Datos
10.  Idiomas

D.  Establecer configuraciones predefinidas para servidores IMAP específicos

C   Activar color
S   Guardar datos
Q   Salir

Comando >> <– D

SquirrelMail Configuración : Leer: config.php

Mientras hemos estado construyendo SquirrelMail, hemos descubierto algunas
preferencias que funcionan mejor con algunos servidores que no funcionan tan
bien con otros.  Si seleccionas tu servidor IMAP, esta opción establecerá algunas
configuraciones predefinidas para ese servidor.

Por favor, ten en cuenta que aún necesitarás revisar y asegurarte de que
todo está correcto.  Esto no cambia todo.  Solo hay unas pocas
configuraciones que esto cambiará.

Por favor, selecciona tu servidor IMAP:
bincimap    = Servidor IMAP Binc
courier     = Servidor IMAP Courier
cyrus       = Servidor IMAP Cyrus
dovecot     = Servidor IMAP Seguro Dovecot
exchange    = Servidor IMAP Microsoft Exchange
hmailserver = hMailServer
macosx      = Servidor de Correo Mac OS X
mercury32   = Mercury/32
uw          = Servidor IMAP de la Universidad de Washington
gmail       = Acceso IMAP a cuentas de correo de Google (Gmail)

salir        = No cambiar nada
Comando >> <– courier

SquirrelMail Configuración : Leer: config.php

Mientras hemos estado construyendo SquirrelMail, hemos descubierto algunas
preferencias que funcionan mejor con algunos servidores que no funcionan tan
bien con otros.  Si seleccionas tu servidor IMAP, esta opción establecerá algunas
configuraciones predefinidas para ese servidor.

Por favor, ten en cuenta que aún necesitarás revisar y asegurarte de que
todo está correcto.  Esto no cambia todo.  Solo hay unas pocas
configuraciones que esto cambiará.

Por favor, selecciona tu servidor IMAP:
bincimap    = Servidor IMAP Binc
courier     = Servidor IMAP Courier
cyrus       = Servidor IMAP Cyrus
dovecot     = Servidor IMAP Seguro Dovecot
exchange    = Servidor IMAP Microsoft Exchange
hmailserver = hMailServer
macosx      = Servidor de Correo Mac OS X
mercury32   = Mercury/32
uw          = Servidor IMAP de la Universidad de Washington
gmail       = Acceso IMAP a cuentas de correo de Google (Gmail)

salir        = No cambiar nada
Comando >> courier

imap_server_type = courier
default_folder_prefix = INBOX.
trash_folder = Papelera
sent_folder = Enviados
draft_folder = Borradores
show_prefix_option = false
default_sub_of_inbox = false
show_contain_subfolders_option = false
optional_delimiter = .
delete_folder = true

Presiona cualquier tecla para continuar… <– presiona una tecla

SquirrelMail Configuración : Leer: config.php (1.4.0)

Menú Principal –
1.  Preferencias de Organización
2.  Configuraciones del Servidor
3.  Valores por Defecto de Carpeta
4.  Opciones Generales
5.  Temas
6.  Libros de Direcciones
7.  Mensaje del Día (MOTD)
8.  Plugins
9.  Base de Datos
10.  Idiomas

D.  Establecer configuraciones predefinidas para servidores IMAP específicos

C   Activar color
S   Guardar datos
Q   Salir

Comando >> <– S

SquirrelMail Configuración : Leer: config.php (1.4.0)

Menú Principal –
1.  Preferencias de Organización
2.  Configuraciones del Servidor
3.  Valores por Defecto de Carpeta
4.  Opciones Generales
5.  Temas
6.  Libros de Direcciones
7.  Mensaje del Día (MOTD)
8.  Plugins
9.  Base de Datos
10.  Idiomas

D.  Establecer configuraciones predefinidas para servidores IMAP específicos

C   Activar color
S   Guardar datos
Q   Salir

Comando >> <– Q

Después puedes acceder a SquirrelMail en http://server1.example.com/webmail o http://192.168.0.100/webmail:

Share: X/Twitter LinkedIn

Recibe nuevas publicaciones en tu bandeja de entrada.

No spam. Cancela la suscripción en cualquier momento.