2

I run a few SpamAssassin servers and I'd like to ensure that they are up and running.

Just checking for "service spamassassin status" isn't enough as I had recently the case it was showing "Active" but the server didn't respond.

When connecting to telnet, sending "HELP" returns

SPAMD/1.0 76 Bad header line: HELP

Is there a command to send, instead of HELP, that works for Spamd ?

Thanks in advance.

Cyril N.
  • 624
  • 1
  • 10
  • 36

2 Answers2

2

If you would like to test spamassassin, you can use spamc. This is the spamassassin client. Try using the following:

spamc -d hostname < sample-spam.txt > output.txt

The output.txt should provide you with the report for the spamd check.

Odie
  • 21
  • 1
  • 1
    Thank you for your contribution. Spamd is running on servers with an open port on the private network. I connect to it via socket from other server where they don't have spamc installed. I've setup a code that connects to SA via socket to check if the connection is alive, but I wanted to do more than just connect, by sending a some PING command and expecting a response. I found the documentation about the "PING" command but it doesn't work for me. All I'm saying is that I can't use spamc. – Cyril N. Dec 03 '19 at 08:03
2

I'll answer myself here. The "PING" command works, but it was missing the details.

In order to PING the spamd service directly, once connected via socket, you need to send the following command:

PING SPAMC/1.2\r\n

the "SPAMC/1.2" followed by break lines is important.

Cyril N.
  • 624
  • 1
  • 10
  • 36