Installing the iRedMail mail server on CentOS 7. Part 7. Graylisting whitelist, WEB interface, Dovecot quota

Greylisting is a method of automatically blocking spam based on the fact that the “behavior” of spam software differs from the behavior of regular email servers. If the recipient’s mail server refuses to accept the letter and reports a “temporary error”, the sender’s server must try again later. In such cases, spam software usually does not try to do this.

Whitelist – a list of domain names that you trust and do not need to be checked for spam via amavisd / spamassassin

A series of articles on installing and configuring the iRedMail mail server

  • Installing the iRedMail mail server on CentOS 7. Part 1. Basic installation
  • Installing the iRedMail mail server on CentOS 7. Part 2. Fighting spam
  • Installing the iRedMail mail server on CentOS 7. Part 3. Aliases, a web interface for working with aliases
  • Installing the iRedMail mail server on CentOS 7. Part 4. Configuring Postfix, authorization without entering a domain
  • Installing the iRedMail mail server on CentOS 7. Part 5. Storage structure of virtual mailboxes
  • Installing the iRedMail mail server on CentOS 7. Part 6. DKIM, SPF, DMARC
  • Installing the iRedMail mail server on CentOS 7. Part 7. Greylisting whitelist, WEB interface, Dovecot quota
  • Installation of the mail server iRedMail on CentOS 7. Part 8. White and black lists. Web interface

Greylisting whitelist

Documentation on managing the whitelist can be viewed on the official iRedMail website

For example, to view the whitelist, you can use the python script located in the / opt / iredapd / tools / directory

[[email protected]]# cd /opt/iredapd/tools/
[[email protected]]# python greylisting_admin.py --list-whitelist-domains

To add a trusted domain name to the whitelist, you need to execute an SQL query

mysql> INSERT INTO `iredapd`.`greylisting_whitelist_domains` (`id`, `domain`) VALUES (NULL, 'itdraft.ru');

Greylisting web interface

I didn’t want to use phpMyAdmin to manage the Greylisting whitelist, so I quickly sketched my admin area.

Admin features:

  • Add to list
  • Edit entry
  • Remove from list

Download (github)

To install the web interface, create a directory:

[[email protected]]# mkdir /var/www/html/whitelist

Unpack the files from the archive into this directory, edit the files: – in the server.php file – edit line 3 (replace% password% with your value)

Restricting access to the web interface by managing the Graylisting whitelist by ip

[[email protected]]# nano /etc/nginx/templates/misc.tmpl
...
location ~ ^/whitelist/$ {
    allow %ip%;
    deny all;
}

where% ip% is the ip-address that is allowed access

Reload nginx

[[email protected]]# systemctl restart nginx

Dovecot quota

After transferring mail messages from the old server to the new one, the mailbox quota was not displayed correctly in the SOGo web client

To fix this, you need to run the command:

[[email protected]]# doveadm quota recalc -A
Sidebar