• Halloween is coming! To celebrate the occasion, we dusted off a couple of old skins, and even created a brand new one (Pixel).
    To get into the festive spirit, install the Skins extension.
  • The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • The Plesk Mobile apps for iOS and Android and the Plesk Mobile Center extension have been deprecated, and are no longer available for new installations. In Plesk Obsidian 18.0.84, the Plesk Mobile Center extension will be removed from servers during the upgrade, and the Plesk Mobile apps will lose their server management features.
  • The Social Login extension has been deprecated and will be removed in Plesk Obsidian 18.0.84. After that, it will no longer be possible to log in to Plesk with a Google, Facebook, GitHub account, or with a passkey. Plesk usernames and passwords, as well as logging in with a WebPros Account, are not affected.

Resolved Default Spam and Antivirus settings for new Mailboxes

TorbHo

Regular Pleskian
Is there a way to set the default settings for Antivirus and Spam for newly created mailboxes for all users?

I would like to activate Antivirus and move to Spam dir by default. Many of our users don't know that the have to activate filtering of spam and are therefore complaining about too much Spam.
 
No reaction yet. So, I think there is no such option?
Not even with cli or modifying the database?
 
As far as I know there is no such option unfortunately. You could however use the CLI to achieve this.

Create a bash script and add the lines below and setup a "Mail account created" event in the Event Manager to call your script.

Bash:
#enable antivirus for both in and out going mail
/usr/local/psa/bin/mail --update ${NEW_MAILNAME} -antivirus inout

#enable spam filter
/usr/local/psa/bin/spamassassin --update ${NEW_MAILNAME} -status true

#set spamfilter to move spam message to spam folder
/usr/local/psa/bin/spamassassin --update ${NEW_MAILNAME} -action move

(I haven't tested this code myself. I highly recommended you test this first for yourself.)
 
Last edited:
What @Rasp say is correct, I use it for all my servers

You can also set the default spam score:

plesk bin spamassassin -u ${NEW_MAILNAME} -hits 7
If the message has a spam score more than 7 will be falgged as SPAM. You can choose the number you prefer.
I use to write "plesk bin" instead of "/usr/local/psa/bin/" but it's the same thing.

If you want to change the settings for all email account previusly created you can use while:

plesk bin mail -l | grep "Mail name"| awk '{print $3}' | while read file; do plesk bin spamassassin -u $file -action move; done

plesk bin mail -l > list all email on your server
grep "Mail name" > include only Mailbox (avoid to include alias)
awk '{print $3}' > print only the mail
while ... ... > for each email do the command you prefer
 
You can also enable DKIM when a new subscription is added, which I believe Plesk doesn't do by default:

Code:
plesk bin subscription_settings -u example.com -sign_outgoing_mail true
 
You have to change it manually, but you can do this with those commands:

Code:
plesk bin mail -l | grep "Mail name"| awk '{print $3}' | while read file; do plesk bin spamassassin -u $file -action move; done
plesk bin mail -l | grep "Mail name"| awk '{print $3}' | while read file; do plesk bin spamassassin -u $file -hits 7; done
plesk bin mail -l | grep "Mail name"| awk '{print $3}' | while read file; do plesk bin spamassassin -u $file -status true; done
 
Back
Top