smtp

package
v0.16.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_SMTP,
	Name:        serviceSMTP,
	Description: "The Simple Mail Transfer Protocol is a communication protocol for electronic mail transmission",
	PostInit: func(d *decoder.StreamDecoder) (err error) {
		smtpLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"mail",
			decoderconfig.Instance.Debug,
		)

		if err != nil {
			return err
		}

		return nil
	},

	Specificity: core.SpecificityStructural,

	CanDecode: func(client, server []byte) bool {
		s, c := bytes.ToUpper(server), bytes.ToUpper(client)
		if replyPrefix(s) && bytes.Contains(s, smtpName) {
			return true
		}
		for _, prefix := range [][]byte{[]byte("EHLO "), []byte("HELO "), []byte("MAIL FROM:")} {
			if bytes.HasPrefix(c, prefix) {
				return true
			}
		}
		return false
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return smtpLog.Sync()
	},
	Factory: &smtpReader{},
	Typ:     core.TCP,
}

Decoder for protocol analysis and writing audit records to disk.

Functions

func PartialGreeting

func PartialGreeting(client, server []byte) bool

PartialGreeting is weak evidence and requires a known SMTP service port.

Types

This section is empty.

Jump to

Keyboard shortcuts

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