• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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