Spam-Mail sempre na caixa de entrada e não no diretório “.Spam” (Postfix + Dovecot + SpamAssasian + ClamAV) [closed]

1

Como o título já diz, eu recebo emails de spam sempre na minha caixa de entrada e não redirecionados para o diretório de spam do Postfix ".Spam" para cada usuário de email. Alguma idéia por quê? (Ubuntu 14.04.1 com Postfix + Dovecot + SpamAssasian + ClamAV)

Minha configuração é a seguinte:

/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
    
por udgru 02.01.2015 / 11:12

2 respostas

1

A solução que funciona para o meu sistema Ubuntu 14.04, graças a vocês:

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
    
por udgru 06.01.2015 / 21:47
1

Você não disse para fazer isso.

Você precisa mover emails classificados como spam pelo servidor ou informar aos clientes para movê-los.

Em combinação com o Dovecot, eu acho que a maneira comum é usar plug-in sieve .

    
por Anders F. U. Kiær 05.01.2015 / 00:16