common

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDomain = "@bitmaelum.network"

DefaultDomain is the default (dummy?) domain to be used to translate the BitMaelum address to/from

View Source
const GatewayAddress = "mailgateway!"

GatewayAddress is the gateway address to send external email messages to

Variables

This section is empty.

Functions

func AddrToEmail

func AddrToEmail(address string) string

AddrToEmail will translate an address string to a valid email using DefaultDomain

func EmailToAddr

func EmailToAddr(email string) string

EmailToAddr will translate a (mocked?) domain on the DefaultDomain to an address string

func GetClientAndInfo

func GetClientAndInfo(v *vault.Vault, acc string) (*vault.AccountInfo, *api.API, error)

GetClientAndInfo will get AccountInfo and API from account in the Vault

Types

type Fetcher

type Fetcher struct {
	Account string
	Info    *vault.AccountInfo
	Client  *api.API
	Vault   *vault.Vault
}

Fetcher struct

func (*Fetcher) CheckMail

func (fe *Fetcher) CheckMail()

CheckMail will check if there is new mail waiting to be sent to the outside

type MimeMessage

type MimeMessage struct {
	ID          string
	From        *mail.Address
	To          []*mail.Address
	Subject     string
	Date        time.Time
	Blocks      []string
	Attachments map[string][]byte
}

MimeMessage contains the struct to encode or decode a mime message the attachments are in the format "filename" -> base64 data

func DecodeFromMime

func DecodeFromMime(m string) (*MimeMessage, error)

DecodeFromMime will decode a mime message and return a MimeMessage struct

func (*MimeMessage) EncodeToMime

func (msg *MimeMessage) EncodeToMime() ([]byte, error)

EncodeToMime will encode a MimeMessage struct to a MIME message

Directories

Path Synopsis
imap
smtp

Jump to

Keyboard shortcuts

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