Block Emails by Using Subject in Zimbra
Issue:
Recently I got so many complaints from my customers who are having spam emails with the subject "your mailbox is full". They are very much worried about it. In such cases, some of the users click on the link provided on those emails and there account got compromised.
Solution:
Luckily,
Zimbra can block emails by the content from subject of email. Below is the
procedure to block emails by using subject.
Create
a file subjectblock.cf as root user.
vim /opt/zimbra/data/spamassassin/rules/subjectblock.cf
header SPAM_BANNED Subject =~ /your
mailbox is full/i
describe SPAM_BANNED Subject contains
your mailbox is full
score
SPAM_BANNED 50.0
Note:
Above
rule created to block emails with the subject "your mailbox is full"
where i indicates case-insensitive search.
SPAM_BANNED
is the name of ACL to block the emails having subject "your mailbox is
full" and the score 50.0 is the score provided to those emails matching
the subject.
If
someone wants to block other emails with different subject, it is required to
create an ACL with different name.
Save
the file and provide the user and group permission to the file subjectblock.cf.
chown zimbra.zimbra
/opt/zimbra/data/spamassassin/rules/subjectblock.cf
su - zimbra -c "zmamavisdctl restart"
Now
send an email with the subject "your mailbox is full" and check the
log.
Sep 3 22:08:42 mail postfix/qmgr[12446]:
5A8201160040: from=<afsher.faisal@gmail.com>, size=4481, nrcpt=1 (queue
active)
Sep 3 22:08:42 mail amavis[6346]: (06346-01) Blocked SPAM {DiscardedInbound},
[202.84.32.5]:36347 [209.85.216.170] <afsher.faisal@gmail.com> -> <user1@xyz.com>,
Queue-ID: 5A8201160040, Message-ID:
<CAD0nXftcteRA6twVPZXa1=TM+dTukPdAiC7W56AYMMd-FWz0Gg@mail.gmail.com>,
mail_id: U6-bOPxS1dns, Hits: 50.473,
size: 4480, dkim_sd=20150623:bol-online-com.20150623.gappssmtp.com, 578 ms
Sep 3 22:08:42 mail postfix/smtp[5525]:
5A8201160040: to=<user1@example.com>, relay=127.0.0.1[127.0.0.1]:10024,
delay=0.65, delays=0.06/0/0.01/0.57, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=06346-01 - spam)
Comments
Post a Comment