dovecot.sieve und spamassassin

Nemesis

Nemesis

N3RD
Hi,
ich hätte gerne, dass dovecot mit dem sieve-plugin mails die von spamassassin gekennzeichnet wurden automatisch in den junk-ordner verschiebt, aber das funktioniert irgendwie nicht.
ich nutze dovecot 1.2.15. spamassassin markiert die mails richtig, das passt soweit, nur lässt dovecot sie in der inbox.
die config:
Code:
...
protocol managesieve {
  # Login executable location.
  login_executable = /usr/lib/dovecot/managesieve-login

  # ManageSieve executable location. See IMAP's mail_executable above for
  # examples how this could be changed.
  mail_executable = /usr/lib/dovecot/managesieve

  # Maximum ManageSieve command line length in bytes. This setting is
  # directly borrowed from IMAP. But, since long command lines are very
  # unlikely with ManageSieve, changing this will not be very useful.
  managesieve_max_line_length = 65536

  # ManageSieve logout format string:
  #  %i - total number of bytes read from client
  #  %o - total number of bytes sent to client
  managesieve_logout_format = bytes=%i/%o

  # If, for some inobvious reason, the sieve_storage remains unset, the
  # ManageSieve daemon uses the specification of the mail_location to find out
  # where to store the sieve files (see explaination in README.managesieve).
  # The example below, when uncommented, overrides any global mail_location
  # specification and stores all the scripts in '~/mail/sieve' if sieve_storage
  # is unset. However, you should always use the sieve_storage setting.
   mail_location = mbox:~/mail

  # To fool ManageSieve clients that are focused on timesieved you can
  # specify the IMPLEMENTATION capability that the dovecot reports to clients
  # (default: "dovecot").
  #managesieve_implementation_string = Cyrus timsieved v2.2.13
}
...
protocol lda {
  # Address to use when sending rejection mails (e.g. postmaster@example.com).
  #postmaster_address =

  # Hostname to use in various parts of sent mails, eg. in Message-Id.
  # Default is the system's real hostname.
  #hostname =

  # Support for dynamically loadable plugins. mail_plugins is a space separated
  # list of plugins to load.
  #mail_plugins =
  mail_plugin_dir = /usr/lib/dovecot/modules/lda

  # If user is over quota, return with temporary failure instead of
  # bouncing the mail.
  #quota_full_tempfail = no

  # Format to use for logging mail deliveries. You can use variables:
  #  %$ - Delivery status message (e.g. "saved to INBOX")
  #  %m - Message-ID
  #  %s - Subject
  #  %f - From address
  deliver_log_format = msgid=%m: %$

  # Binary to use for sending mails.
  #sendmail_path = /usr/sbin/sendmail

  # Subject: header to use for rejection mails. You can use the same variables
  # as for rejection_reason below.
  rejection_subject = Rejected: %s

  # Human readable error message for rejection mails. You can use variables:
  #  %n = CRLF, %r = reason, %s = original subject, %t = recipient
  rejection_reason = Your message to <%t> was automatically rejected:%n%r

  # UNIX socket path to master authentication server to find users.
  auth_socket_path = /var/run/dovecot/auth-master
}
...
plugin {
...
  sieve=~/.dovecot.sieve
  sieve_dir=~/sieve
}

und die .dovecot.sieve:
Code:
require "fileinto";
if header :contains "subject" ["SPAM"] {
  fileinto "Junk";
} else {
  # The rest goes into INBOX
  # default is "implicit keep", we do it explicitly here
  keep;
}
im syslog taucht kein fehler auf.

hat jemand ne idee ?

danke !
 
Ist Junk ein Unterordner der INBOX? Wenn ja, musst du den Pfad anpassen INBOX.Junk... iicr.

e: Und dir fehlt ein stop;
 
jip, das habe ich angepasst:
Code:
require "fileinto";
if header :contains "subject" ["***** SPAM *****"] {
  fileinto "~/mail/.Junk";
  stop;
} else {
  keep;
}
aber er machts immer noch nicht.
ich hab auch schonversucht die * mit \\ zu escapen, hat auch nichts gebracht.

edit:
ich hab noch die verschiedensten configs probiert, mit from und to etc. pp. aber nix hat funktioniert ... kann das an deliver liegen ?
ich hab keine plan mehr :(

ich krieg immer nen delivery-error:
Code:
Delivery error (command deliver 18611 error (75, ))
  msg 4/4 (3627 bytes), delivery error (command deliver 18611 error (75, ))
  4 messages (14506 bytes) retrieved, 0 skipped

der abschnitt in der getmail-config sieht wie folgt aus:
Code:
type = MDA_external
path = /usr/lib/dovecot/deliver
arguments = ("-e", "-n", "-m", "INBOX" )
 
Zuletzt bearbeitet:

Ähnliche Themen

Dovecot: Geteilte Postfächer (Shared Mailboxes) funktionieren nicht

Nginx als Reverse Proxy für Nextcloud und Emby

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Email via script via Exchange Server (SASL)

Samba-Server mit Univention Corporate Server

Zurück
Oben