global::obj
vSL objects declaration functions. vSL objects utility methods. vSL objects Eq method between each other and other types.
op
!=
op !=(this: SharedObject, s: String) -> bool
op !=(this: String, other: SharedObject) -> bool
op !=(this: SharedObject, other: SharedObject) -> bool
details
Operator !=
for SharedObject
and &str
op
==
op ==(this: String, other: SharedObject) -> bool
op ==(this: SharedObject, other: SharedObject) -> bool
op ==(this: SharedObject, s: String) -> bool
details
Operator ==
for &str
and SharedObject
fn
address
fn address(address: String) -> VSLObject
details
an email address (jones@foo.com)
fn
code
fn code(code: int, text: String) -> VSLObject
fn code(code: int, enhanced: String, text: String) -> VSLObject
details
A SMTP code with the code and message as parameter.
fn
contains
fn contains(this: SharedObject, s: String) -> bool
fn contains(this: SharedObject, other: SharedObject) -> bool
fn contains(map: Map, object: SharedObject) -> bool
details
Operator contains
fn
file
fn file(path: String, content_type: String) -> Array
details
the content of a file.
fn
fqdn
fn fqdn(domain: String) -> VSLObject
details
a valid fully qualified domain name (foo.com)
get
domain
fn get domain(addr: VSLObject) -> VSLObject
details
Get the domain of an email address.
Args
address
- the address to extract the domain from.
Effective smtp stage
All of them.
Examples
#{
mail: [
// You can also use the `get_domain(ctx::mail_from())` syntax.
action "display sender's domain" || {
log("info", `received a message from domain ${ctx::mail_from().domain}.`);
}
],
}
get
domains
fn get domains(container: Array) -> Array
details
Get all domains of the recipient list.
Args
rcpt_list
- the recipient list.
Effective smtp stage
mail
and onwards.
Examples
#{
mail: [
action "display recipients domains" || {
print("list of recipients domains:");
// You can also use the `get_domains(ctx::rcpt_list())` syntax.
for domain in ctx::rcpt_list().domains {
print(`- ${domain}`);
}
}
],
}
get
local_part
fn get local_part(addr: VSLObject) -> String
details
Get the local part of an email address.
Args
address
- the address to extract the local part from.
Return
String
- the local part.
Effective smtp stage
All of them.
Examples
#{
mail: [
// You can also use the `get_local_part(ctx::mail_from())` syntax.
action "display mail from identity" || {
log("info", `received a message from ${ctx::mail_from().local_part}.`);
}
],
}
get
local_parts
fn get local_parts(container: Array) -> Array
details
Get all local parts of the recipient list.
Args
rcpt_list
- the recipient list.
Return
array
- array of local parts.
Effective smtp stage
mail
and onwards.
Examples
#{
mail: [
action "display recipients usernames" || {
print("list of recipients user names:");
// You can also use the `get_local_parts(ctx::rcpt_list())` syntax.
for user in ctx::rcpt_list().local_parts {
print(`- ${user}`);
}
}
],
}
fn
identifier
fn identifier(identifier: String) -> VSLObject
details
a user identifier.
fn
ip4
fn ip4(ip: String) -> VSLObject
details
Build an ip4 address. (a.b.c.d)
fn
ip6
fn ip6(ip: String) -> VSLObject
details
Build an ip6 address. (x:x:x:x:x:x:x:x)
fn
regex
fn regex(regex: String) -> VSLObject
details
a regex (^[a-z0-9.]+@foo.com$)
fn
rg4
fn rg4(range: String) -> VSLObject
details
an ip v4 range. (a.b.c.d/range)
fn
rg6
fn rg6(range: String) -> VSLObject
details
an ip v6 range. (x:x:x:x:x:x:x:x/range)
fn
to_debug
fn to_debug(this: VSLObject) -> String
details
Convert a SharedObject
to a debug string
fn
to_string
fn to_string(this: VSLObject) -> String
details
Convert a SharedObject
to a String