Rspamd marks outgoing emails as spam (smarthost / relay host configuration)

NethServer Version: 7
Module: email

OK, this may not be bug in terms of an error as I suppose that the modules works as expected. IMO this is more a kind of technical unexpected behavior causing confusion for the user / admin. I kindly suggest to alter within a future update:

I use Nethserver email as an internal smarthost aka “Allow relay from trusted networks” for the following purpose:
Submit notification emails from green network servers to the admin, e.g. backup accomplish from DMS server or S.M.A.R.T reports from Proxmox VE server etc. Also my OKI MFP (“multi functinal printer”) can send scanned PDF files by eMail via smarthost.

Most stuff is send directly to me (myname@mydomain.tld). Quite strange to me was the fact that rspamd marks this email as spam. I thought this was processed during recieving process for my inbox.
I did not really care as I manually moved it from Junk folder to my inbox counting on the training effect. This was annoying, but not serious. For some cases I even added specific “Rules by mail address->allow”. Anyway I found that unnecessary for email from a source within green network.

Today I noticed something completly (unsatisfactory) different. I have scanned a document on my OKI MPF and sent it directly to my business email adress ( The email subject was rewritten to “[+++SPAM+++]” using the corresponding text from Nethserver email settings. This is not to nice as the recipient recieves an email marked as spam from the sending server :frowning: .

Just to make sure: The process was definitly triggered by Nethserver / rspamd. The company uses a different, external spam service provider. Also, the company has a different annotation for marking spam. In this case only the rspamd text [+++SPAM+++] was added…

TIA for for considering

Please check why the mails are marked as spam in the history in rspamd web UI:

yes for debugging we need to understand what symbols are found.
You can also whitelist full domain name instead of only one email address

Please found the rewrite subject action in maillog and display it here please

Hi Markus and Stephane,

Sorry for late replay, I was quite bussy last to days. Here is the requested information:

201808230622002@localhost		rewrite subject
	9.39 / 20	2M	1.468 / 0.020	23.8.2018, 06:11:07	unknown
[Envelope To] To/Cc/Bcc
Symbols	MX_MISSING(3.5)[requested record is not found]
ASN(0)[asn:52363, ipnet:, country:AR]

No mx record and OkiLAN8500e has no tld.

If you create an mx record and rename the oki (ie. it should work.

1 Like

Hi Markus,

I don’t think that works:

  • I do not think it is suitable to set up an external mx record to my internal printer: This would cause external servers to deliver mail to the oki, at least when nethserver would be down
  • It is not a rename of the printer but from the senders email which I already altered (old domain replaced by oki.myname.tld)

Besides the fact that your thread explains why it is noted as spam / the header changed: Why does the system apply a sieve to outgoing mail at all? For me it is a question of “is it meaningfull” to sieve
-> mail on relay (I thougth just mail deliverd to internal accounts is sieved)
-> mail on relay from internal sources

Kind ask for your opinion

My fault, you are sending directly, I was talking about mx for your nethserver.

1 Like

Yes I did that already, see here :slight_smile:
Support wanted on DNS host name records

Just to make shure:
The spam-server of works completly different. It is a provider, Retarus, who manages the mail system. If a incommoing email is considered as spam, it is not delifered to the recepient at all. Instead of delivery the recipient (in this case recieves an email from Retarus with a table of suspectious e-mails as hyperlinks. I need to request each of such emails individually. Upon selection request retarus sends the original email to the intended recipient.

In short words: Imagine rspamd would hold / delay suspectious mail until an release notification is responded. It would put such released mail to the inbox without any change of header.

I this case, the retarus spam system does not consider the mail from the OKI printer as spam as it was relayed from the valid nethserver.