IRedMail/FAQ/Quarantining.SPAM
From iRedMail
(Difference between revisions)
(→Configure Amavisd to enable quarantining) |
(→Configure iRedAdmin-Pro to manage quarantined mails) |
||
| (9 intermediate revisions not shown) | |||
| Line 1: | Line 1: | ||
__TOC__ | __TOC__ | ||
| - | Note: This tutorial is appliable | + | Note: This tutorial is appliable to iRedMail-0.7.0 and later releases. If you're using iRedMail-0.6.1 and earlier versions, please refer to [[IRedMail/FAQ/Quarantining.Messages |this tutorial]]. |
= Summary = | = Summary = | ||
| - | iRedMail-0.7.0 | + | Since iRedMail-0.7.0, quarantining related settings are configured but disabled by default, you can easily enable quarantining with this tutorial. |
| - | + | With below steps, Virus/Spam/Banned emails will be quarantined into SQL database. You can manage quarantined emails with iRedAdmin-Pro. | |
= Configure Amavisd to enable quarantining = | = Configure Amavisd to enable quarantining = | ||
| - | * Edit Amavisd config file '' | + | * Edit Amavisd config file, find below settings and update them. If it doesn't exist, just add them. |
| + | ** on Red Hat Enterprise Linux, CentOS, Scientific Linux, it's /etc/amavisd.conf or /etc/amavisd/amavisd.conf. | ||
| + | ** on Debian/Ubuntu/Mint, it's /etc/amavis/conf.d/50-user | ||
| + | ** on openSUSE, it's /etc/amavisd.conf | ||
| + | ** on Gentoo, it's /etc/amavisd.conf | ||
| + | ** on FreeBSD, it's /usr/local/etc/amavisd.conf | ||
| + | ** on OpenBSD, it's /etc/amavisd.conf | ||
{{cfg|amavisd.conf|<pre> | {{cfg|amavisd.conf|<pre> | ||
| - | $final_spam_destiny = D_DISCARD; | + | # Change below two settings to D_DISCARD. |
| + | $final_spam_destiny = D_DISCARD; | ||
| + | $final_banned_destiny = D_DISCARD; | ||
| - | $spam_quarantine_to = 'spam-quarantine'; | + | # |
| + | # Quarantine SPAM into SQL server. | ||
| + | # | ||
| + | $spam_quarantine_to = 'spam-quarantine'; # <- Remove '#' at the beginning of line. | ||
$spam_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. | $spam_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. | ||
| - | $virus_quarantine_to = 'virus-quarantine'; | + | # |
| + | # Quarantine VIRUS into SQL server. | ||
| + | # | ||
| + | $virus_quarantine_to = 'virus-quarantine'; # <- Remove '#' at the beginning of line. | ||
$virus_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. | $virus_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. | ||
| + | |||
| + | # | ||
| + | # Quarantine BANNED emails into SQL server. | ||
| + | # | ||
| + | $banned_quarantine_to = 'banned-quarantine'; | ||
| + | $banned_files_quarantine_method = 'sql:'; | ||
</pre>}} | </pre>}} | ||
| - | Also, make sure you have below lines configured in same config file (It's configured by default | + | Also, make sure you have below lines configured in same config file. (It's configured and enabled by default since iRedMail-0.7.0): |
{{cfg|amavisd.conf|<pre> | {{cfg|amavisd.conf|<pre> | ||
| - | |||
| - | |||
@storage_sql_dsn = ( | @storage_sql_dsn = ( | ||
| - | ['DBI: | + | ['DBI:...], |
); | ); | ||
</pre>}} | </pre>}} | ||
| Line 35: | Line 53: | ||
= Configure iRedAdmin-Pro to manage quarantined mails = | = Configure iRedAdmin-Pro to manage quarantined mails = | ||
| - | * Edit iRedAdmin-Pro config file '''"/var/www/iredadmin/settings.ini | + | * Edit iRedAdmin-Pro config file '''settings.ini''', make sure you have correct settings in '''"[amavisd]"''' section like below: |
| + | ** on Red Hat Enterprise Linux, CentOS, Scientific Linux, it's /var/www/iredadmin/settings.ini | ||
| + | ** on Debian, Ubuntu, Mint, it's /usr/share/apache2/iredadmin/settings.ini | ||
| + | ** on openSUSE, it's /srv/www/iredadmin/settings.ini | ||
| + | ** on Gentoo Linux, it's /var/www/iredadmin/settings.ini | ||
| + | ** on FreeBSD, it's /usr/local/www/iredadmin/settings.ini | ||
| + | ** on OpenBSD, it's /var/www/iredadmin/settings.ini | ||
| + | |||
{{cfg|settings.ini|<pre> | {{cfg|settings.ini|<pre> | ||
[amavisd] | [amavisd] | ||
| - | |||
| - | |||
| - | |||
| - | logging_into_sql = True | + | logging_into_sql = True # <- Set to True to view log of sent/received mails. |
host = 127.0.0.1 | host = 127.0.0.1 | ||
| Line 48: | Line 70: | ||
db = amavisd | db = amavisd | ||
user = amavisd | user = amavisd | ||
| - | passwd = [ | + | passwd = [passwd_of_sql_user_amavisd] |
| + | |||
| + | quarantine = True # <- Set to True to enable quarantining management. | ||
| + | quarantine_port = 9998 | ||
</pre>}} | </pre>}} | ||
* Restart Apache web server to make it work. | * Restart Apache web server to make it work. | ||
| - | * You can now login to iRedAdmin-Pro, and view quarantined mails via menu "System -> Quarantined Mails". | + | * You can now login to iRedAdmin-Pro, and view quarantined mails via menu "System -> Quarantined Mails". Choose action in drop-down menu list to release or delete them. |
| + | |||
| + | = Screenshots of iRedAdmin-Pro = | ||
| + | * [http://www.iredmail.org/images/iredadmin/system_maillog_quarantined.png View quarantined mails] | ||
| + | * [http://www.iredmail.org/images/iredadmin/system_maillog_quarantined_expanded.png Expand quarantined mail to view mail headers and body] | ||
| + | |||
| - | + | [[Category: iRedMail/FAQ]] | |
| - | + | [[Category: FAQ]] | |
| - | + | ||
Current revision as of 05:28, 6 May 2012
Contents |
Note: This tutorial is appliable to iRedMail-0.7.0 and later releases. If you're using iRedMail-0.6.1 and earlier versions, please refer to this tutorial.
Summary
Since iRedMail-0.7.0, quarantining related settings are configured but disabled by default, you can easily enable quarantining with this tutorial.
With below steps, Virus/Spam/Banned emails will be quarantined into SQL database. You can manage quarantined emails with iRedAdmin-Pro.
Configure Amavisd to enable quarantining
- Edit Amavisd config file, find below settings and update them. If it doesn't exist, just add them.
- on Red Hat Enterprise Linux, CentOS, Scientific Linux, it's /etc/amavisd.conf or /etc/amavisd/amavisd.conf.
- on Debian/Ubuntu/Mint, it's /etc/amavis/conf.d/50-user
- on openSUSE, it's /etc/amavisd.conf
- on Gentoo, it's /etc/amavisd.conf
- on FreeBSD, it's /usr/local/etc/amavisd.conf
- on OpenBSD, it's /etc/amavisd.conf
| File: amavisd.conf |
# Change below two settings to D_DISCARD. $final_spam_destiny = D_DISCARD; $final_banned_destiny = D_DISCARD; # # Quarantine SPAM into SQL server. # $spam_quarantine_to = 'spam-quarantine'; # <- Remove '#' at the beginning of line. $spam_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. # # Quarantine VIRUS into SQL server. # $virus_quarantine_to = 'virus-quarantine'; # <- Remove '#' at the beginning of line. $virus_quarantine_method = 'sql:'; # <- Remove '#' at the beginning of line. # # Quarantine BANNED emails into SQL server. # $banned_quarantine_to = 'banned-quarantine'; $banned_files_quarantine_method = 'sql:'; |
Also, make sure you have below lines configured in same config file. (It's configured and enabled by default since iRedMail-0.7.0):
| File: amavisd.conf |
@storage_sql_dsn = (
['DBI:...],
);
|
- Restart amavisd service to make it work.
Configure iRedAdmin-Pro to manage quarantined mails
- Edit iRedAdmin-Pro config file settings.ini, make sure you have correct settings in "[amavisd]" section like below:
- on Red Hat Enterprise Linux, CentOS, Scientific Linux, it's /var/www/iredadmin/settings.ini
- on Debian, Ubuntu, Mint, it's /usr/share/apache2/iredadmin/settings.ini
- on openSUSE, it's /srv/www/iredadmin/settings.ini
- on Gentoo Linux, it's /var/www/iredadmin/settings.ini
- on FreeBSD, it's /usr/local/www/iredadmin/settings.ini
- on OpenBSD, it's /var/www/iredadmin/settings.ini
| File: settings.ini |
[amavisd] logging_into_sql = True # <- Set to True to view log of sent/received mails. host = 127.0.0.1 port = 3306 db = amavisd user = amavisd passwd = [passwd_of_sql_user_amavisd] quarantine = True # <- Set to True to enable quarantining management. quarantine_port = 9998 |
- Restart Apache web server to make it work.
- You can now login to iRedAdmin-Pro, and view quarantined mails via menu "System -> Quarantined Mails". Choose action in drop-down menu list to release or delete them.
