Documentation
¶
Overview ¶
Package mailin contains the mailIn node implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MailInConfig ¶
type MailInConfig struct {
// Host is the IMAP server host.
Host string `json:"host"`
// Port is the IMAP server port. Zero picks the default for the
// security mode: 993 (tls), 143 (starttls/plain).
Port int `json:"port"`
// Security selects the transport: "tls" (implicit TLS on connect,
// the default), "starttls" or "plain".
Security string `json:"security"`
// Mailbox is the folder to watch (default INBOX).
Mailbox string `json:"mailbox"`
// PollSeconds is the fallback poll interval in seconds (default 30).
// With useIdle the node also wakes on server push.
PollSeconds int `json:"pollSeconds"`
// UseIdle uses IMAP IDLE between polls when the server supports it.
UseIdle bool `json:"useIdle"`
// MarkSeen sets the \Seen flag on delivered messages (default on
// unless explicitly disabled).
MarkSeen *bool `json:"markSeen"`
// Delete expunges delivered messages from the mailbox.
Delete bool `json:"delete"`
// Username/Password are the mailbox credentials. They are
// credential-typed fields: stored outside the exported flow
// document and merged back in at deploy time.
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
}
MailInConfig holds configuration for the mailIn node.
type MailInNode ¶
MailInNode watches an IMAP mailbox and emits one message per new mail. It is a Stopper: connect/login happens synchronously on deploy so an unreachable server surfaces as a deploy error, then a poll goroutine fetches arrivals (UID-tracked, so restarts re-emit only messages the mailbox still holds for it).
func NewMailInNode ¶
func NewMailInNode(node nodestore.NodeInterface, config *MailInConfig, host nodebase.NodeHost) *MailInNode
NewMailInNode creates a new mailIn node
func (*MailInNode) Execute ¶
func (n *MailInNode) Execute(ctx context.Context, input nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute connects, logs in and starts the mailbox watch loop. The initial connect is synchronous so failures surface as deploy errors, matching mqttIn.
func (*MailInNode) StopKey ¶
func (n *MailInNode) StopKey() string
stopKey dedupes stopper registration across partial redeploys: one watch loop per host+mailbox.
func (*MailInNode) Validate ¶
func (n *MailInNode) Validate() error
Validate checks the mailIn node configuration