climail

package
v1.3.106 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package climail cmd/skywire-cli/commands/mail/attachments.go c4-vis-cli

Package climail cmd/skywire-cli/commands/mail/mail.go c4-vis-cli

`skywire cli mail` — the visor's mailbox (mailbox.go) and the runtime control surface for its in-process SMTP→skywire bridge (pkg/visor/embedded_skymail_bridge.go).

SMTP-side analog of `skywire cli resolver`. Bare `mail` prints status; `up`/`down` toggle the bridge via the same SetEmbeddedProxyEnabled RPC the resolver tree uses, with kind "bridge".

Package climail cmd/skywire-cli/commands/mail/mailbox.go c4-vis-cli

`skywire cli mail inbox|sent|outbox|read|send|retry|rm|whitelist`, the visor's own mailbox (pkg/skymail): mail to <anything>@<base32-pk>.skynet or .dmsg, delivered straight to the recipient visor's port 25.

Package climail cmd/skywire-cli/commands/mail/settings.go c4-vis-cli

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "mail",
	Short: "The visor's mailbox, and its SMTP bridge to Postfix",
	Long: `The visor's own mailbox, and the embedded SMTP bridge for hosts
that run Postfix.

The mailbox receives mail to <anything>@<base32-pk>.skynet (or .dmsg)
on port 25 over skywire and keeps it in a Maildir. It needs no MTA,
domain or certificate: the transport authenticates every sender's PK.
It runs on every visor unless the config's "skymail" section or
"skywire cli mail settings enable=false" turns it off.

The bridge accepts SMTP from a co-located Postfix's transport_map
and dials peer visors over the visor's existing dmsg client. With
the bridge running, a Postfix transport_map line

  .skynet  relay:[127.0.0.1]:1025

routes envelopes addressed to user@<host>.<base32-pk>.skynet (or
user@<base32-pk>.skynet) over skywire to the peer's Postfix smtpd.

Without arguments, prints the state of both.

Examples:
  skywire cli mail                                  # status
  skywire cli mail inbox                            # list mail
  skywire cli mail send bob@<base32-pk>.skynet -s hi -m "hello"
  skywire cli mail up                               # bridge on
  skywire cli mail down                             # bridge off
`,
	Run: func(cmd *cobra.Command, _ []string) {
		rpcClient, err := clirpc.Client(cmd.Flags())
		if err != nil {
			internal.PrintFatalError(cmd.Flags(), err)
		}
		mbox, err := rpcClient.MailStatus()
		if err != nil {
			internal.PrintFatalError(cmd.Flags(), fmt.Errorf("MailStatus RPC failed: %w", err))
		}
		status, err := rpcClient.EmbeddedProxies()
		if err != nil {
			internal.PrintFatalError(cmd.Flags(), fmt.Errorf("EmbeddedProxies RPC failed: %w", err))
		}
		internal.PrintOutput(cmd.Flags(),
			map[string]any{"mailbox": mbox, "bridge": status.SkymailBridge},
			renderMailbox(mbox)+"\nbridge:\n"+renderMailStatus(status))
	},
}

RootCmd is the cobra entry for `skywire cli mail`. Print-status when invoked bare.

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