global

package
v0.0.0-...-d115e7c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMPAT_LEVEL_0    = "0"
	COMPAT_LEVEL_1    = "1"
	COMPAT_LEVEL_2    = "2"
	COMPAT_LEVEL_3_6  = "3.6"
	LAST_COMPAT_LEVEL = COMPAT_LEVEL_3_6
)

* Compatibility level and migration support. Update postconf(5), * COMPATIBILITY_README, global/mail_params.[hc] and conf/main.cf when * updating the current compatibility level.

View Source
const (
	MAIL_QUEUE_MAILDROP = "maildrop"
	MAIL_QUEUE_HOLD     = "hold"
	MAIL_QUEUE_INCOMING = "incoming"
	MAIL_QUEUE_ACTIVE   = "active"
	MAIL_QUEUE_DEFERRED = "deferred"
	MAIL_QUEUE_TRACE    = "trace"
	MAIL_QUEUE_DEFER    = "defer"
	MAIL_QUEUE_BOUNCE   = "bounce"
	MAIL_QUEUE_CORRUPT  = "corrupt"
	MAIL_QUEUE_FLUSH    = "flush"
	MAIL_QUEUE_SAVED    = "saved"
)

* Mail queue names.

View Source
const (
	MQID_LG_SEC_BASE  = 52 /* seconds safe alphabet base */
	MQID_LG_SEC_PAD   = 6  /* seconds minimum field width */
	MQID_LG_USEC_BASE = 52 /* microseconds safe alphabet base */
	MQID_LG_USEC_PAD  = 4  /* microseconds exact field width */
	MQID_LG_TIME_PAD  = (MQID_LG_SEC_PAD + MQID_LG_USEC_PAD)
	MQID_LG_INUM_SEP  = 'z' /* time-inode separator */
	MQID_LG_INUM_BASE = 51  /* inode safe alphabet base */
	MQID_LG_INUM_PAD  = 0   /* no padding needed */
)

* The long non-repeating queue ID is encoded in an alphabet of 10 digits, * 21 upper-case characters, and 21 or fewer lower-case characters. The * alphabet is made "safe" by removing all the vowels (AEIOUaeiou). The ID * is the concatenation of: * * - the time in seconds (base 52 encoded, six or more chars), * * - the time in microseconds (base 52 encoded, exactly four chars), * * - the 'z' character to separate the time and inode information, * * - the inode number (base 51 encoded so that it contains no 'z').

View Source
const (
	MAILLOG_CLIENT_FLAG_NONE               = 0
	MAILLOG_CLIENT_FLAG_LOGWRITER_FALLBACK = 1 << iota
)
View Source
const CONFIG_BOOL_NO string = "no"
View Source
const CONFIG_BOOL_YES string = "yes"

* External representation for booleans.

View Source
const CONFIG_DICT string = "mail_dict" // global Postfix dictionary

* Well known names. These are not configurable. One has to start somewhere.

View Source
const CONF_ENV_DEBUG string = "MAIL_DEBUG" // live debugging
View Source
const CONF_ENV_LOGTAG string = "MAIL_LOGTAG" // instance name
View Source
const CONF_ENV_PATH string = "MAIL_CONFIG" // config database

* Environment variables.

View Source
const CONF_ENV_VERB string = "MAIL_VERBOSE" // verbose mode on
View Source
const DEF_COMPAT_LEVEL = COMPAT_LEVEL_0
View Source
const DEF_CONFIG_DIR = "/etc/postfix"
View Source
const DEF_HASH_QUEUE_DEPTH = 1
View Source
const DEF_HASH_QUEUE_NAMES = "deferred, defer"
View Source
const DEF_HELPFUL_WARNINGS = 1
View Source
const DEF_IMPORT_ENVIRON string = `MAIL_CONFIG MAIL_DEBUG MAIL_LOGTAG 
	TZ XAUTHORITY DISPLAY LANG=C 
	POSTLOG_SERVICE POSTLOG_HOSTNAME`
View Source
const DEF_LONG_QUEUE_IDS = false
View Source
const DEF_MAIL_NAME = "Postfix"
View Source
const DEF_MASTER_DISABLE string = ""
View Source
const DEF_MULTI_NAME string = ""
View Source
const DEF_QUEUE_DIR = "/var/spool/postfix"
View Source
const DEF_SHOW_UNK_RCPT_TABLE = 1
View Source
const DEF_SMTPD_SOFT_ERLIM string = "10"
View Source
const DEF_SYSLOG_NAME string = "${" + VAR_MULTI_NAME + "?{$" + VAR_MULTI_NAME + "}:{postfix}}"
View Source
const MQID_SH_USEC_PAD = 5 /* microseconds exact field width */

* The short repeating queue ID is encoded in upper-case hexadecimal, and is * the concatenation of: * * - the time in microseconds (exactly five chars), * * - the inode number.

View Source
const SAFE_MAX_BASE uint = uint(len(safe_chars))
View Source
const SAFE_MIN_BASE uint = uint(2)
View Source
const VAR_COMPAT_LEVEL = "compatibility_level"
View Source
const VAR_CONFIG_DIR = "config_directory"

* Location of configuration files.

View Source
const VAR_HASH_QUEUE_DEPTH = "hash_queue_depth"
View Source
const VAR_HASH_QUEUE_NAMES = "hash_queue_names"

* Queue management: what queues are hashed behind a forest of * subdirectories, and how deep the forest is.

View Source
const VAR_HELPFUL_WARNINGS = "helpful_warnings"

* You want to be helped or not.

View Source
const VAR_IMPORT_ENVIRON string = "import_environment"

* Environmental management - what Postfix imports from the external world, * and what Postfix exports to the external world.

View Source
const VAR_LONG_QUEUE_IDS = "enable_long_queue_ids"

* Short queue IDs contain the time in microseconds and file inode number. * Long queue IDs also contain the time in seconds.

View Source
const VAR_MAIL_NAME = "mail_name"

* Name used when this mail system announces itself.

View Source
const VAR_MASTER_DISABLE string = "master_service_disable"
View Source
const VAR_MULTI_NAME string = "multi_instance_name"
View Source
const VAR_PROCNAME string = "process_name"
View Source
const VAR_QUEUE_DIR = "queue_directory"

* Location of the mail queue directory tree.

View Source
const VAR_SHOW_UNK_RCPT_TABLE = "show_user_unknown_table_name"

* You want to be helped or not.

View Source
const VAR_SMTPD_SOFT_ERLIM string = "smtpd_soft_error_limit"
View Source
const VAR_SYSLOG_NAME string = "syslog_name"

Variables

View Source
var VarConfigDir string
View Source
var VarHashQueueDepth int
View Source
var VarHashQueueNames string
View Source
var VarHelpfulWarnings bool
View Source
var VarImportEnviron string
View Source
var VarLongQueueIds bool
View Source
var VarMailName string
View Source
var VarMultiName string
View Source
var VarProcname string
View Source
var VarQueueDir string
View Source
var VarShowUnkRcptTable bool
View Source
var VarSmtpdSoftErlim int
View Source
var VarSyslogName string

Functions

func MQID_FIND_LG_INUM_SEPARATOR

func MQID_FIND_LG_INUM_SEPARATOR(queue_id string) int

func MQID_GET_INUM

func MQID_GET_INUM(path string) (uint, error)

func MQID_LG_DECODE

func MQID_LG_DECODE(str string, base uint) (uint, error)

func MQID_LG_DECODE_INUM

func MQID_LG_DECODE_INUM(str string) (uint, error)

func MQID_LG_DECODE_USEC

func MQID_LG_DECODE_USEC(str string) (uint, error)

func MQID_LG_ENCODE

func MQID_LG_ENCODE(val uint, base uint, padlen int) string

func MQID_LG_ENCODE_INUM

func MQID_LG_ENCODE_INUM(val uint) string

func MQID_LG_ENCODE_SEC

func MQID_LG_ENCODE_SEC(val uint) string

func MQID_LG_ENCODE_USEC

func MQID_LG_ENCODE_USEC(val uint) string

func MQID_LG_GET_HEX_USEC

func MQID_LG_GET_HEX_USEC(queue_id string) string

func MQID_SH_DECODE_INUM

func MQID_SH_DECODE_INUM(str string) (uint, error)

func MQID_SH_ENCODE_INUM

func MQID_SH_ENCODE_INUM(inum uint) string

func MQID_SH_ENCODE_USEC

func MQID_SH_ENCODE_USEC(usec uint) string

func MailConfCheckDir

func MailConfCheckDir(config_dir string)

func MailConfEval

func MailConfEval(str string) string

func MailConfEvalOnce

func MailConfEvalOnce(str string) string

func MailConfFlush

func MailConfFlush()

func MailConfLookup

func MailConfLookup(name string) string

func MailConfLookupEval

func MailConfLookupEval(name string) string

func MailConfRead

func MailConfRead()

func MailConfSuck

func MailConfSuck()

func MailConfUpdate

func MailConfUpdate(key string, value string)

func MailLogClientInit

func MailLogClientInit(progname string, flags int)

func MailParamSplit

func MailParamSplit(name string, value string) []string

func MailParamsInit

func MailParamsInit()

func MailQueueDir

func MailQueueDir(queue_name string, queue_id string) string

func MailQueueIdOk

func MailQueueIdOk(queue_id string) bool

func MailQueueNameOk

func MailQueueNameOk(queue_name string) bool

MailQueueNameOk - validate mail queue name

func MailQueueOpen

func MailQueueOpen(queue_name string, queue_id string, flags int, mode fs.FileMode) (io.Reader, error)

func MailQueuePath

func MailQueuePath(queue_name string, queue_id string) string

func MailTask

func MailTask(argv0 string) string

func SafeStrToUl

func SafeStrToUl(str string, end *string, base uint) (uint, error)

func SafeUlToStr

func SafeUlToStr(val uint, base uint, padlen int, padchar rune) string

func SetMailConfStr

func SetMailConfStr(name string, value string)

Types

type CONFIG_BASE_TABLE

type CONFIG_BASE_TABLE struct {
	Min int
	Max int
}

type CONFIG_BOOL_TABLE

type CONFIG_BOOL_TABLE struct {
	Name   string
	Defval bool
	Target *bool
}

type CONFIG_INT_TABLE

type CONFIG_INT_TABLE struct {
	Name   string
	Defval int
	Target *int
	Min    int
	Max    int
}

type CONFIG_LONG_TABLE

type CONFIG_LONG_TABLE struct {
	Name   string
	Defval int
	Target *int
	Min    int
	Max    int
}

type CONFIG_NBOOL_TABLE

type CONFIG_NBOOL_TABLE struct {
	Name   string
	Defval string
	Target *bool
}

type CONFIG_NINT_TABLE

type CONFIG_NINT_TABLE struct {
	Name   string
	Defval string
	Target *int
	Min    int
	Max    int
}

type CONFIG_RAW_TABLE

type CONFIG_RAW_TABLE struct {
	Name   string
	Defval string
	Target *string
	Min    int
	Max    int
}

type CONFIG_STR_TABLE

type CONFIG_STR_TABLE struct {
	Name   string
	Defval string
	Target *string
	Min    int
	Max    int
}

type CONFIG_TIME_TABLE

type CONFIG_TIME_TABLE struct {
	Name   string
	Defval int
	Target *int
	Min    int
	Max    int
}

Jump to

Keyboard shortcuts

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