imap

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Decoder = &decoder.StreamDecoder{
	Type:        types.Type_NC_IMAP,
	Name:        "IMAP",
	Description: "Internet Message Access Protocol - email retrieval and management",
	PostInit: func(sd *decoder.StreamDecoder) error {
		var err error
		imapLog, _, err = logging.InitZapLogger(
			decoderconfig.Instance.Out,
			"imap",
			decoderconfig.Instance.Debug,
		)
		if err != nil {
			return err
		}
		return nil
	},
	CanDecode: func(client, server []byte) bool {

		if bytes.Contains(server, imapGreeting) {
			return true
		}

		if len(client) > 5 && client[0] >= 'A' && client[0] <= 'Z' {

			if bytes.Contains(client, []byte("LOGIN")) ||
				bytes.Contains(client, []byte("SELECT")) ||
				bytes.Contains(client, []byte("CAPABILITY")) {
				return true
			}
		}
		return false
	},
	DeInit: func(sd *decoder.StreamDecoder) error {
		return imapLog.Sync()
	},
	Factory: &imapReader{},
	Typ:     core.TCP,
}

Decoder for IMAP protocol analysis

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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