![]() |
|
Guide CyberPanel SpamAssassin: Install It, Fix the Restart Bug, Send Spam to Junk - Printable Version +- AdminsForum (https://adminsforum.com) +-- Forum: Free & open-source control panels (https://adminsforum.com/Forum-free-open-source-control-panels) +--- Forum: CyberPanel (https://adminsforum.com/Forum-cyberpanel) +---- Forum: CyberPanel Guides & Tutorials (https://adminsforum.com/Forum-cyberpanel-guides-tutorials) +----- Forum: CyberPanel Email Guides (https://adminsforum.com/Forum-cyberpanel-email-guides) +----- Thread: Guide CyberPanel SpamAssassin: Install It, Fix the Restart Bug, Send Spam to Junk (/Thread-guide-cyberpanel-spamassassin-install-it-fix-the-restart-bug-send-spam-to-junk) |
CyberPanel SpamAssassin: Install It, Fix the Restart Bug, Send Spam to Junk - JAY - 11-07-2026 CyberPanel SpamAssassin: Install It, Fix the Restart Bug, Send Spam to Junk (Tested) CyberPanel can install SpamAssassin for you in one click, and it's free. But on our test server (CyberPanel 3.0.8, Ubuntu 24.04) it didn't tag a single spam message until we restarted it by hand, and even then spam still landed in the Inbox. Here's the full setup that actually works, tested with the standard spam test message. What you get for free (and what's paid)
Step 1: Install SpamAssassin Go to Email → SpamAssassin. On a fresh server it says SpamAssassin is not installed. Click Install Now. The install log shows in the page. It takes about a minute. When it's done, the page turns into the settings form:
Step 2: Restart SpamAssassin (the bug) This is the step nobody tells you about. Right after the install, our test spam arrived with the spam headers ( Code: X-Spam-Flag: YESThe fix is one command over SSH as root: Code: systemctl restart spamdStep 3: Test it the right way Every spam filter knows a harmless test line called GTUBE. Any message that contains it scores about 1000 points. Important: don't test by sending from one of your own mailboxes to another in webmail. CyberPanel only checks mail that arrives on port 25 (mail from other servers). Mail you send yourself goes through the submission port and is never scanned. You can see this in Postfix's config, Code: /etc/postfix/master.cfCode: smtp inet n - n - - smtpd -o content_filter=spamassassin
spamassassin unix - n n - - pipe flags=R user=spamd argv=/usr/bin/spamc -e /usr/sbin/sendmail -oi -f ${sender} ${recipient}To send a proper test, run this on the server as root. It hands the message to your own mail server on port 25, just like mail from outside. Change the address to one of your mailboxes: Code: python3 - <<'PY'
import smtplib
to = '[email protected]'
msg = ('Subject: GTUBE test\r\nFrom: [email protected]\r\nTo: ' + to + '\r\n\r\n'
'XJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34X\r\n')
s = smtplib.SMTP('127.0.0.1', 25); s.sendmail('[email protected]', [to], msg); s.quit()
print('sent')
PYCode: journalctl -u spamd --since "-5 min" | grep resultIn webmail, the message now shows the tag in its subject: Step 4: Send spam to the Junk folder automatically Out of the box, tagged spam still lands in the Inbox. CyberPanel's webmail has mail rules that fix this, and they run on the server when mail is delivered, so they also work for people who read mail in Outlook or on a phone. In webmail, click Rules → Add Rule and fill in:
Our next test went straight to Junk E-mail: Rules are per mailbox, so add the same rule to each mailbox you use (switch mailbox with the menu at the top right of webmail). The Value has to match your Rewrite Header text exactly, so if you change one, change the other. Good to know
Questions, or a test that doesn't get tagged? Reply below with the Code: journalctl -u spamd |