Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultSender is the sender part of the email address used to send messages DefaultSender = "no-reply" // DefaultSenderName is the name part of the email address used to send // messages DefaultSenderName = "Gophish Healthcheck" // DefaultSubject is the default subject used when sending messages DefaultSubject = "Gophish Healthcheck - Test Email" // DefaultSMTPPort is the default SMTP port used when making outbound SMTP // connections DefaultSMTPPort = 25 // MessageIDLength is the number of bytes to use when generated message IDs MessageIDLength = 16 // HardFail is the constant value used to indicate the specific configuration // should fail HardFail = "hardfail" // None is the constant value used to indicate the specific configuration // should not be present (e.g. no DKIM signing at all) None = "none" // SoftFail is the constant value that indicates the certain configuration // option (if supported) should softfail (e.g. spf softfail). SoftFail = "softfail" // Pass is the constant value used to indicate the specific configuration // value should be valid Pass = "pass" // Reject indicates that the DMARC response should have the policy set to // reject Reject = "reject" // Quarantine indicates that the DMARC response should have the policy set // to quarantine Quarantine = "quarantine" // Neutral indicates that the SPF response should have a neutral enforcement Neutral = "neutral" )
Variables ¶
View Source
var ErrMissingMailServer = errors.New("no mail server specified")
ErrMissingMailServer occurs when a message is received without specifying a valid mail server.
View Source
var ErrMissingRecipient = errors.New("no recipient specified")
ErrMissingRecipient occurs when a message is received without specifying a valid recipient
Functions ¶
func PostMessage ¶
PostMessage saves a message instance into the database
Types ¶
type Dialer ¶
Dialer is a wrapper around a standard gomail.Dialer in order to implement the mailer.Dialer interface. This allows us to better separate the mailer package as opposed to forcing a connection between mailer and gomail.
type Message ¶
type Message struct { ID uint `gorm:"primary_key" json:"id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at,omitempty"` Recipient string `gorm:"-" json:"recipient"` MailServer string `json:"mail_server"` MessageID string `json:"message_id"` DomainHash string `json:"domain_hash"` Successful bool `json:"successful"` ErrorMessage string `json:"error_message"` ErrorChan chan (error) `gorm:"-" json:"-"` MessageConfiguration `gorm:"embedded" json:"configuration"` }
Message is the base struct for handling per-message information.
func GetMessage ¶
GetMessage retrieves a message by ID from the database
func (*Message) Backoff ¶
Backoff simply errors out the message, since we don't handle exponential backoffs yet.
Click to show internal directories.
Click to hide internal directories.