spamassassin, using sa-learn with mdbox format?

Discussion in 'Server Operation' started by sam1989, Mar 2, 2022.

  1. sam1989

    sam1989 New Member


    I made a new install for my server using the Ubuntu 20.04 perfect server tutorial but I’m getting a lot of spam daily
    that i wasn’t getting before whereas in ISP Config I set the same settings for spamassassin, RBL… as the previous server.

    I tried to find a tutorial to use sa-learn as I was doing before but the new server uses mdbox format and all the tutorials I’m finding are not made for it or doesn't seem to work when I try them.
    Is there any tutorial that would work with the setup that was made with the perfect server tutorial or any better solution than sa-learn?

  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Curious, I've never come across a system using mdbox format after following a perfect server tutorial.

    You could probably convert to maildir format; I have never done that offhand.

    Other that that, if sa-learn doesn't support mdbox, you might be and to loop through the messages using formail and send them to sa-learn one at a time.
  3. michelangelo

    michelangelo Active Member

    I'm using mdbox at work and as Jesse stated before already you'll have to export the mail folders to maildir.

    I do it as follows:

    doveadm -v -D backup -u <mailbox> -m ham maildir:/home/sa/ham/Maildir:LAYOUT=fs
    doveadm -v -D backup -u <mailbox> -m spam maildir:/home/sa/spam/Maildir:LAYOUT=fs
    sa-learn --progress --ham /home/sa/ham/Maildir/ham/cur
    sa-learn --progress --spam /home/sa/spam/Maildir/spam/cur
    However, if I may can give you an advice:
    You should switch to Rspamd instead of using Amavis+SpamAssassin. Rspamd is superior to Amavis+SA.

    Also mdbox as a storage has definitely its advantages in middle to large sized hosting environments over maildir but when it comes to backup and especially restore, you'll have a bit more work to be done than just copying over the lost email from the maildir backup, because the latter isn't possible anymore with mdbox since it heavily relies on the integrity of the mailbox indexes and mailbox storage files.
    Jesse Norell likes this.
  4. sam1989

    sam1989 New Member

    Thanks for the info.
    I followed the tutorial to switch to rspamd and it seems to work great, all the emails I received since were well sorted.

Share This Page