ebcfetch

package module
v0.0.0-...-9f8c773 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2026 License: MIT Imports: 33 Imported by: 0

README

ebcfetch

A fetcher for Electronic Bonus Claims

I monitor an email mailbox for emailed bonus claims from rally entrants, select those with correctly formatted Subject lines and post the contents into the specified ScoreMaster database.

On startup I open a ScoreMaster database (dbversion >= 8) and retrieve my configuration from it unless the name of a yaml configuration file was supplied on the commandline. If no email account is specified or its password is blank, I issue an error message and die.

I refresh my configuration regularly to switch monitoring on or off and to switch between test and live mode operations.

In test mode, I reply to each submission with an analysis of the claim. Claims are not forwarded to the database when running in test mode.

Documentation

Index

Constants

View Source
const ResponseStyleLbl = ` text-align: right; padding-right: 1em; `
View Source
const ResponseStyleNo = ` font-size: x-large; color: red; `
View Source
const ResponseStyleYes = ` font-size: large; color: lightgreen; `
View Source
const RiderNameSQL = "ifnull(entrants.RiderName,ifnull(entrants.RiderFirst,'') || ' ' || ifnull(entrants.RiderLast,'')) AS RiderName"

SQL for safely retrieving full names

Variables

View Source
var AllowShortSubject bool
View Source
var Options = jpeg.Options{Quality: 100}
View Source
var ReloadConfigFromDB bool
View Source
var SilentMode bool = false
View Source
var VerboseMode bool = true

Functions

func Heic2jpg

func Heic2jpg(fin string, fout string)

func Run

func Run(db *sql.DB)

Types

type Attachment

type Attachment struct {
	Filename           string
	ContentType        string
	Data               io.Reader
	ContentDisposition string
}

Attachment with filename, content type and data (as a io.Reader)

type Email

type Email struct {
	Header mail.Header

	Subject    string
	Sender     *mail.Address
	From       []*mail.Address
	ReplyTo    []*mail.Address
	To         []*mail.Address
	Cc         []*mail.Address
	Bcc        []*mail.Address
	Date       time.Time
	MessageID  string
	InReplyTo  []string
	References []string

	ResentFrom      []*mail.Address
	ResentSender    *mail.Address
	ResentTo        []*mail.Address
	ResentDate      time.Time
	ResentCc        []*mail.Address
	ResentBcc       []*mail.Address
	ResentMessageID string

	ContentType string
	Content     io.Reader

	HTMLBody string
	TextBody string

	Attachments   []Attachment
	EmbeddedFiles []EmbeddedFile
}

Email with fields for all the headers defined in RFC5322 with it's attachments and

func Parse

func Parse(r io.Reader) (email Email, err error)

Parse an email message read from io.Reader into parsemail.Email struct

type EmailSettings

type EmailSettings struct {
	Port     int    `json:"Port"`
	Host     string `json:"Host"`
	Username string `json:"Username"`
	Password string `json:"Password"`
	CertName string `json:"CertName"`
}

type EmbeddedFile

type EmbeddedFile struct {
	CID                string
	ContentType        string
	Data               io.Reader
	ContentDisposition string
}

EmbeddedFile with content id, content type and data (as a io.Reader)

Jump to

Keyboard shortcuts

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