Move spam to another account instead of delete it

Discussion in 'General' started by recin, Dec 13, 2019.

  1. recin

    recin Member

    I have ISPconfig 3.1.15p2 on Ubuntu 18.04 with rspamd.
    I want to config rspamd to send all incoming spam to the same account instead of deleting it or move it to spam folder of recipient because I have some legitimate mails deleted and I don't to it to happen again.
    How can I do this?
    Thanks in advance.
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I think you can do this by not using rspamd.
  3. Steini86

    Steini86 Active Member

    You can filter the mails, identified by rspamd like (if using sieve)
    # Move spam to spam folder
    if anyof (header :contains "X-Spam-Flag" "YES", header :contains "X-Spam" "Yes", header :contains "subject" "*** SPAM ***", header :contains "subject" "***SPAM***") {
       redirect "[email protected]";
      # Stop here so that we do not reply on spams
    If the redirect does not work, the message is lost. Use
        redirect :copy "[email protected]";
        fileinto "Spam";
    To make a copy instead.

    Personally I think it questionable from a privacy point of view to automatically redirecting mails to another account. If this is legal depends on your country. For more sieve rules have a look here:

    I would suggest, adding this rule for every user individually. Otherwise you could add it to /var/vmail/.mailfilter (untested, will probably be overwritten by ispconfig at some point, updates or so)

    rspamd does not delete mails. It either marks them as spam or rejects them (then the email is not accepted by your mailserver and the sender gets a notification)
  4. recin

    recin Member

    Will try it.

Share This Page