acl

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package for managements postfix transport settings

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRelayDomain

func CheckRelayDomain(relay_domains []string, to string) bool

func GetHandler

func GetHandler(postfix_configs_path, amavisd_configs_path string) httprouter.Handle

Get acl groups by names, via case conditions by url location

func MapACL

func MapACL(RegexpMaps map[string]map[string]interface{}) string

Mapping multitable map by subject(src or key) in smta acl format

func MapACLTest

func MapACLTest(inputMap map[string]map[string]interface{}) string

Mapping test requests

func MapArrayHashRegexpAmavis

func MapArrayHashRegexpAmavis(hashString string) (map[string]interface{}, error)

Mapping amavis regexp function(new_RE) and hash type arrays:

[new_RE( [qr'^sexampleUser@example.lan' => 'BYPASS_ENCRYPTED'],  [qr'^.*$' => 'DEFAULT'] )];
This hash and regexp format is perl-like

func MapRecipientScoreSenderAmavis

func MapRecipientScoreSenderAmavis(hashString string) (map[string]map[string]interface{}, error)

Create map for recipient in format:

sexampleUser@example.lan:
  {priority: 0
  senders:
    [{src: ya.lan, dst: +15, priority: 0}]}

func MapRegexpTable

func MapRegexpTable(RegexpMap map[string]interface{}) string

Mapping regexp lookup table to acl names format

func MapScoreMaps

func MapScoreMaps(inputMap map[string]map[string]interface{}) string

Convert this map:

sexampleUser@example.lan:
 {priority: 0
 senders:
   [{src: ya.lan, dst: +15, priority: 0}]}

To usability score-map json:

{
	"maps": [{
			"recipient": "sexampleUser@example.lan",
			"priority": 0,
			"senders": [{
				"priority": 0,
				"scores": "+15",
				"sender": ".dx.lan"
			}, {
				"priority": 1,
				"scores": "+15",
				"sender": "exampleUser.lan"
			}]
		},
		{
			"recipient": "sexampleUser@example.lan",
			"priority": 1,
			"senders": [{
				"priority": 0,
				"scores": "+15",
				"sender": ".dx.lan"
			}, {
				"priority": 1,
				"scores": "+15",
				"sender": "exampleUser.lan"
			}]
		}
	]
}

func PostHandler

func PostHandler(postfix_configs_path, amavisd_configs_path string) httprouter.Handle

Update acl table groups by names via case conditions by url location

func SmartTestAmavis

func SmartTestAmavis(from, to string, postfixTables, amavisTables map[string]map[string]map[string]interface{},
	amavisScoreMaps map[string]map[string]interface{},
	amavisConf map[string]string) (string, error)

Smart test

This test analysis all input rules, maps, etc and return result checks:
 Example: your message may be banned as spam
 Example2: your message will be banned if contains attachment

func ValidateACL

func ValidateACL(inputParams io.Reader, location string) (map[string]map[string]map[string]string, error)

Validate parameters and create map adapted for postfix and amavis Rewrite STRONG, WHITELIST etc...

func ValidateACLReload

func ValidateACLReload(inputParams io.Reader) (string, error)

Check incoming map name and return extracted map name string from incoming json

func ValidateRegexpTable

func ValidateRegexpTable(inputParams io.Reader, location string) (string, error)

Check incoming parameters from json request and generate regexp lookup table string for postfix. Lookup table sorting by Priority from request.

func ValidateScoreMaps

func ValidateScoreMaps(inputParams io.Reader) (string, error)

Validate parameters and create amavis $recipient_score_sender_maps

Types

This section is empty.

Jump to

Keyboard shortcuts

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