spamc

package
v1.18.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package spamc provides a client for the SpamAssassin spamd protocol. http://svn.apache.org/repos/asf/spamassassin/trunk/spamd/PROTOCOL

Modified to add timeouts from https://github.com/cgt/spamc

Index

Constants

View Source
const ProtoVersion = "1.5"

ProtoVersion is the protocol version

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a spamd client.

func NewTCP

func NewTCP(addr string, timeout int) *Client

NewTCP returns a *Client that connects to spamd via the given TCP address.

func NewUnix

func NewUnix(addr string) *Client

NewUnix returns a *Client that connects to spamd via the given Unix socket.

func (*Client) Ping

func (c *Client) Ping() error

Ping the spamd

func (*Client) Report

func (c *Client) Report(email []byte) (Result, error)

Report checks if message is spam or not, and returns score plus report

type Result

type Result struct {
	ResponseCode int
	Message      string
	Spam         bool
	Score        float64
	Threshold    float64
	Rules        []Rule
}

Result struct

type Rule

type Rule struct {
	Points      string
	Name        string
	Description string
}

Rule represents a matched SpamAssassin rule.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL