I have installed and successfully configured exim4 and sa-exim on my Ubuntu LTS installation. Spam Emails are successfully flagged:
X-SA-Exim-Connect-IP: 89.238.139.198
X-SA-Exim-Mail-From: hertaqcrqsaa@xxx
Subject: =?UTF-8?Q?F=C3=BCr_den_privaten_und_gesch=C3=A4ftlichen_Gebrauch:_=C3=B6konomische_LED-Lampen,_verbilligt?=
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.root42.de
X-Spam-Flag: YES
X-Spam-Level: **********
X-Spam-Status: Yes, score=10.3 required=5.0 tests=BAYES_60,HTML_IMAGE_ONLY_20,
HTML_MESSAGE,HTML_SHORT_LINK_IMG_3,RCVD_IN_SBL_CSS,SPF_PASS,
T_DKIM_INVALID,URIBL_ABUSE_SURBL,URIBL_BLOCKED,URIBL_DBL_SPAM
autolearn=no autolearn_force=no version=3.4.2
X-SA-Exim-Version: 4.2.1 (built Sun, 16 Aug 2015 09:47:16 +0000)
X-SA-Exim-Scanned: Yes (on xxx.xxxxxx.de)
But still the email is delivered to the user's INBOX Maildir. How can I change this to go to the user's .Spam Maildir?
I don't know if exim4 and sa-exim can automagically do that for you. Someone else may chime in on that.
However, at the user's computer, in Thunderbird, you can use Message Filters, to move spam email to a spam folder. Create a new message filter like so... (if you don't wish to match on X-Spam-Status, you can create a special flag, called for example, X-Spam-Flag)...
Found it out myself via the excellent Exim Wiki:
First of all you have to create a file
/etc/exim4/conf.d/router/899_exim4-config_local_user_spam
with this content:This will be matched BEFORE the local user router which has number 900. This ensures that spam will be delivered using the following transport.
Create a transport in
/etc/exim4/conf.d/transport/30_exim4-config_maildir_spam_delivery
with this content:This is basically a copy of the defailt
maildir_home
transport, only appending/.Junk
to the maildir name.I am sure that exim4 can do this a bit more elegant with some if and else, but my exim foo is not good enough yet. Any exim professionals are welcome to add to this solution.