gophish: Index | Files

package imap

import ""


Package Files

imap.go monitor.go

func Validate Uses

func Validate(s *models.IMAP) error

Validate validates supplied IMAP model by connecting to the server

type Client Uses

type Client interface {
    Login(username, password string) (cmd *imap.Command, err error)
    Logout(timeout time.Duration) (cmd *imap.Command, err error)
    Select(name string, readOnly bool) (mbox *imap.MailboxStatus, err error)
    Store(seq *imap.SeqSet, item imap.StoreItem, value interface{}, ch chan *imap.Message) (err error)
    Fetch(seqset *imap.SeqSet, items []imap.FetchItem, ch chan *imap.Message) (err error)

Client interface for IMAP interactions

type Email Uses

type Email struct {
    SeqNum uint32 `json:"seqnum"`

Email represents an email.Email with an included IMAP Sequence Number

type Mailbox Uses

type Mailbox struct {
    Host             string
    TLS              bool
    IgnoreCertErrors bool
    User             string
    Pwd              string
    Folder           string
    // Read only mode, false (original logic) if not initialized
    ReadOnly bool

Mailbox holds onto the credentials and other information needed for connecting to an IMAP server.

func (*Mailbox) DeleteEmails Uses

func (mbox *Mailbox) DeleteEmails(seqs []uint32) error

DeleteEmails will delete emails from the supplied slice of SeqNums

func (*Mailbox) GetUnread Uses

func (mbox *Mailbox) GetUnread(markAsRead, delete bool) ([]Email, error)

GetUnread will find all unread emails in the folder and return them as a list.

func (*Mailbox) MarkAsUnread Uses

func (mbox *Mailbox) MarkAsUnread(seqs []uint32) error

MarkAsUnread will set the UNSEEN flag on a supplied slice of SeqNums

type Monitor Uses

type Monitor struct {
    // contains filtered or unexported fields

Monitor is a worker that monitors IMAP servers for reported campaign emails

func NewMonitor Uses

func NewMonitor() *Monitor

NewMonitor returns a new instance of imap.Monitor

func (*Monitor) Shutdown Uses

func (im *Monitor) Shutdown() error

Shutdown attempts to gracefully shutdown the IMAP monitor.

func (*Monitor) Start Uses

func (im *Monitor) Start() error

Start launches the IMAP campaign monitor

Package imap imports 16 packages (graph) and is imported by 4 packages. Updated 2020-10-03. Refresh now. Tools for package owners.