Saturday, April 27, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1904  / 2 Years ago, mon, july 4, 2022, 4:09:18

As the title already says I receive Spam mails always in my mail inbox and not redirected to the Postfix Spam directory ".Spam" for each mail user. Any ideas why? (Ubuntu 14.04.1 with Postfix+Dovecot+SpamAssasian+ClamAV)



My configuration is as follows:



/etc/amavis/conf.d/20-debian_defaults



$QUARANTINEDIR = "$MYHOME/virusmails";


/etc/amavis/conf.d/20-debian_defaults



@whitelist_sender_acl = qw( .$mydomain );
$final_virus_destiny = D_DISCARD; # (defaults to D_BOUNCE)
$final_banned_destiny = D_DISCARD; # (defaults to D_BOUNCE)
$final_spam_destiny = D_PASS; # D_DISCARD (defaults to D_REJECT)
$final_bad_header_destiny = D_PASS; # (defaults to D_PASS), D_BOUNCE suggested


/var/log/mail.log



    Jan  2 01:11:47 h2376680 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=29949, TLS, session=<LwXFL6ALuQAAAAAAAAAAAAAAAAAAAAAB>
Jan 2 01:11:47 h2376680 dovecot: imap([email protected]): Disconnected: Logged out in=59 out=477
Jan 2 01:11:50 h2376680 postfix/smtpd[29951]: connect from localhost[127.0.0.1]
Jan 2 01:11:50 h2376680 postfix/smtpd[29951]: 78A6D36502180: client=localhost[127.0.0.1]
Jan 2 01:11:50 h2376680 postfix/cleanup[29943]: 78A6D36502180: message-id=<[email protected]>
Jan 2 01:11:50 h2376680 postfix/qmgr[26016]: 78A6D36502180: from=<[email protected]>, size=2115, nrcpt=1 (queue active)

Jan 2 01:11:50 h2376680 amavis[29933]: (29933-01) Passed SPAM {RelayedTaggedInternal,Quarantined}, LOCAL [::1]:54297 [::1] <[email protected]> -> <[email protected]>, quarantine: Z/spam-ZbwHIOZCG3mB.gz, Queue-ID: 2CFFD36501BFF, Message-ID: <[email protected]>, mail_id: ZbwHIOZCG3mB, Hits: 999.002, size: 1265, queued_as: 78A6D36502180, 3183 ms

Jan 2 01:11:50 h2376680 postfix/smtp[29945]: 2CFFD36501BFF: to=<[email protected]>, relay=127.0.0.1[127.0.0.1]:10024, delay=3.3, delays=0.06/0.1/0.01/3.2, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 78A6D36502180)
Jan 2 01:11:50 h2376680 postfix/qmgr[26016]: 2CFFD36501BFF: removed
Jan 2 01:11:50 h2376680 dovecot: lmtp(29953): Connect from local
Jan 2 01:11:50 h2376680 dovecot: lmtp(29953, [email protected]): rfsRIEbipVQBdQAA6SEkQA: msgid=<[email protected]>: saved mail to INBOX
Jan 2 01:11:50 h2376680 postfix/lmtp[29952]: 78A6D36502180: to=<[email protected]>, relay=example.com[private/dovecot-lmtp], delay=0.07, delays=0.01/0.02/0.01/0.03, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> rfsRIEbipVQBdQAA6SEkQA Saved)
Jan 2 01:11:50 h2376680 dovecot: lmtp(29953): Disconnect from local: Successful quit
Jan 2 01:11:50 h2376680 postfix/qmgr[26016]: 78A6D36502180: removed

More From » 14.04

 Answers
2

The solution that works for my Ubuntu 14.04 system, thanks to you guys:



sudo apt-get install dovecot-sieve

sudo nano /etc/dovecot/conf.d/20-lmtp.conf

protocol lmtp {
mail_plugins = $mail_plugins sieve
}

sudo nano /etc/dovecot/conf.d/90-sieve.conf

plugin {
sieve_before = /var/mail/sieve/spam-global.sieve
sieve_dir = /var/mail/vhosts/%d/%n/sieve/scripts/
sieve = /var/mail/vhosts/%d/%n/sieve/active-script.sieve
}

cd /var/mail
mkdir sieve
cd sieve
touch spam-global.sieve
chown -R vmail:mail /var/mail/sieve/

sudo nano /var/mail/sieve/spam-global.sieve

require "fileinto";
if header :contains "X-Spam-Flag" "YES" {
fileinto "Spam";
}

service dovecot restart

[#21833] Tuesday, July 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
piscen

Total Points: 134
Total Questions: 117
Total Answers: 133

Location: Indonesia
Member since Wed, Jul 7, 2021
3 Years ago
;