mailin

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 19 Imported by: ? 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.

README

Mail In node

Type: mailIn
Category: Network

Watches an IMAP mailbox and emits one message per received mail.

Behavior

This node is registered as mailIn and runs as part of a workflow. Its exact runtime behavior is implemented in node.go; this document summarizes the editor-facing purpose and configuration contract.

Configuration

Field Type Default Description
delete boolean false Delete — Expunge delivered messages from the mailbox
host ``
mailbox string INBOX Mailbox
markSeen boolean true Mark Seen — Set the \Seen flag on delivered messages (default on)
password string Password — Mailbox password (credential: masked, never exported)
pollSeconds integer 30 Poll Interval (s) — Fallback poll interval in seconds; IDLE pushes wake the node sooner
port integer 0 Port — IMAP port (0 = default for security: 993 tls, 143 starttls/plain)
security string tls Security
useIdle boolean true Use IDLE — Use IMAP IDLE between polls when the server supports it
username string Username — Mailbox username (credential: masked, never exported)

Implementation

  • node.go contains the executor, validation, schema, and registration.
  • editor.html contains the editor integration.
  • node_test.go, when present, contains behavioral tests.

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

type MailInNode struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

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

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) Stop

func (n *MailInNode) Stop() error

Stop logs out and stops the watch loop.

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

Jump to

Keyboard shortcuts

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