1

Topic: How to set up SPAM notification?

==== Required information ====
- iRedMail version (check /etc/iredmail-release): v0.9.7
- Linux/BSD distribution name and version: Linux Ubuntu 17.10
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello. I need some help. I want to add rule for SPAM detection. in /etc/spamassassin/65_debian.cf I create a new test rule:

body SPAM_MESSAGE  /spam_test/
score SPAM_MESSAGE 5.0
describe SPAM_MESSAGE test spam message

Also I added this lines in /etc/amavis/conf.d/20-debian_defaults

$final_spam_destiny = D_BOUNCE

I send a test message, and haven't a Bounce mail. My test mail is not delivered to my mailbox, i just lost it.

what i want to do: when i recieved spam, i want to send bounce message to sender.

Thanks for the answers.

----

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

2

Re: How to set up SPAM notification?

razzer2007 wrote:

Also I added this lines in /etc/amavis/conf.d/20-debian_defaults

$final_spam_destiny = D_BOUNCE

Please update /etc/amavis/conf.d/50-user instead, it's the last one loaded by Amavisd, so your setting in "20-debian_defaults" will be overwritten.

3

Re: How to set up SPAM notification?

Please update /etc/amavis/conf.d/50-user instead, it's the last one loaded by Amavisd, so your setting in "20-debian_defaults" will be overwritten.

does not work. In which file should I set filtering rules? The notification for blocked attachments is working correctly.

4

Re: How to set up SPAM notification?

All your custom amavisd settings should go to /etc/amavis/conf.d/50-user.

For SpamAssassin rules, please update /etc/mail/spamassassin/local.cf. After modified, restarting amavisd service is required- because spamassassin is called by Amavisd directly.

5

Re: How to set up SPAM notification?

Thanks. I set

$sa2_tag_lavel_deflt=4

. is it right that if message score above 4 it will be mark as SPAM, and if it below 4, message will not mark as SPAM? If right, it is not work for me.

6

Re: How to set up SPAM notification?

razzer2007 wrote:

is it right that if message score above 4 it will be mark as SPAM, and if it below 4, message will not mark as SPAM?

Yes.

razzer2007 wrote:

If right, it is not work for me.

What do you expect?

7

Re: How to set up SPAM notification?

ZhangHuangbin wrote:
razzer2007 wrote:

is it right that if message score above 4 it will be mark as SPAM, and if it below 4, message will not mark as SPAM?

Yes.

razzer2007 wrote:

If right, it is not work for me.

What do you expect?

I expect a bounce message "You message contains SPAM and was rejected" to sender. I set $sa2_tag_lavel_deflt=4 and create a test message with score > 4. I send this message, and do not recieve SPAM bounce message. What can i check in my config? Thanks for you reply.

8

Re: How to set up SPAM notification?

Does anyone have any ideas about it?

9

Re: How to set up SPAM notification?

Amavisd supports "warnXXXsender" (where XXX is spam/virus/...) before, but seems not anymore.
But it still sends notification to specified spam/virus/... admins. For example:

$policy_bank{'ORIGINATING'} = {
    ...
    # notify administrator of locally originating malware
    spam_admin_maps  => ["root\@$mydomain"],
    # notify administrator of locally originating malware
    virus_admin_maps => ["root\@$mydomain"],
    spam_admin_maps  => ["root\@$mydomain"],
    bad_header_admin_maps => ["root\@$mydomain"],
    banned_admin_maps => ["root\@$mydomain"],
   ...
};

It's also configurable in SQL table "amavisd.policy".