spamc

package module
v0.0.0-...-9710988 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2016 License: MIT Imports: 7 Imported by: 0

README

spamc

GoDoc

Package spamc provides a client for the SpamAssassin spamd protocol.

Installation

go get cgt.name/pkg/spamc

License

The MIT license (see LICENSE). Adapted from package github.com/le0pard/go-falcon/spamassassin.

Documentation

Overview

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

Index

Constants

View Source
const ProtoVersion = "1.5"

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) *Client

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

func NewUnix

func NewUnix(addr string) *Client

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

func (*Client) Ping

func (c *Client) Ping() error

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 Header struct {
	Points      string
	RuleName    string
	Description string
}

Header represents a matched SpamAssassin rule.

type Result

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

Jump to

Keyboard shortcuts

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