On 22 Feb 2018, at 4:15, saqariden wrote:

Hello guys,

i'm using mimedefang with spamassasin, when I test an email with the command "spamassain -t file.eml", I got results like this:

Dails de l'analyse du message:   (-5.8 points, 3.0 requis)
-5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high
                            trust
                            [70.38.112.54 listed in list.dnswl.org]

-1.9 BAYES_00 BODY: L'algorithme Bayien a alula probabilitde spam
                            entre 0 et 1%
                            [score: 0.0000]
0.8 RDNS_NONE Delivered to internal network by a host with no rDNS
 0.3 TO_EQ_FM_DOM_SPF_FAIL  To domain == From domain and external SPF
                            failed

However, the SA check which was done trough mimedefang, seems like giving other scores, how can i test an email to get these scores, and saw the difference.

Typically mimedefang runs as its own special user (e.g. 'defang') which may be configured to block normal interactive use or even simple 'su' use by root. This means that if you run 'spamassassin -t' in an interactive shell, you use the user_prefs, AWL/TxRep and BayesDB for the user running that shell, not the special user. This is particularly problematic for 'learning' ham and spam for the BayesDB, because it is easy to end up either training into a DB that is entirely separate from the system-wide one used by mimedefang OR working with the system-wide DBs in ways that change ownership of them so that mimedefang can't use them.

My solution for this is to use sudo and these shell aliases:

satest='sudo -H -u defang spamassassin -t '
lham='sudo -H -u defang  sa-learn --ham --progress '
lspam='sudo -H -u defang  sa-learn --spam --progress '
blspam='sudo -H -u defang spamassassin --add-to-blacklist '
reportspam='sudo -H -u defang spamassassin -r -t '

Reply via email to