Documentation

Rbl extends Base
in package

Mail RBL class.

Table of Contents

DKIM  = [0 => ['label' => 'LBL_NONE', 'desc' => 'LBL_DKIM_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_DKIM_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 2 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_DKIM_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]
DKIM statuses.
DKIM_FAIL  = 2
DKIM header verified incorrectly.
DKIM_NONE  = 0
DKIM header not found.
DKIM_PASS  = 1
DKIM header verified correctly.
DMARC  = [0 => ['label' => 'LBL_NONE', 'desc' => 'LBL_DMARC_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_DMARC_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 2 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_DMARC_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]
DMARC statuses.
DMARC_FAIL  = 2
DMARC header verified incorrectly.
DMARC_NONE  = 0
DMARC header not found.
DMARC_PASS  = 1
DMARC header verified correctly.
LIST_CATEGORIES  = ['Black' => ['[SPAM] Single unwanted message' => 'LBL_SPAM_SINGLE_UNWANTED_MESSAGE', '[SPAM] Mass unwanted message' => 'LBL_SPAM_MASS_UNWANTED_MESSAGE', '[SPAM] Sending an unsolicited message repeatedly' => 'LBL_SPAM_SENDING_UNSOLICITED_MESSAGE_REPEATEDLY', '[Fraud] Money scam' => 'LBL_FRAUD_MONEY_SCAM', '[Fraud] Phishing' => 'LBL_FRAUD_PHISHING', '[Fraud] An attempt to persuade people to buy a product or service' => 'LBL_FRAUD_ATTEMPT_TO_PERSUADE_PEOPLE_TO_BUY', '[Security] An attempt to impersonate another person' => 'LBL_SECURITY_ATTEMPT_TO_IMPERSONATE_ANOTHER_PERSON', '[Security] An attempt to persuade the recipient to open a resource from outside the organization' => 'LBL_SECURITY_ATTEMPT_TO_PERSUADE_FROM_ORGANIZATION', '[Security] An attempt to persuade the recipient to open a resource inside the organization' => 'LBL_SECURITY_ATTEMPT_TO_PERSUADE_INSIDE_ORGANIZATION', '[Security] Infrastructure and application scanning' => 'LBL_SECURITY_INFRASTRUCTURE_AND_APPLICATION_SCANNING', '[Security] Attack on infrastructure or application' => 'LBL_SECURITY_ATTACK_INFRASTRUCTURE_OR_APPLICATION', '[Security] Overloading infrastructure or application' => 'LBL_SECURITY_OVERLOADING_INFRASTRUCTURE_OR_APPLICATION', '[Other] The message contains inappropriate words' => 'LBL_OTHER_MESSAGE_CONTAINS_INAPPROPRIATE_WORDS', '[Other] The message contains inappropriate materials' => 'LBL_OTHER_MESSAGE_CONTAINS_INAPPROPRIATE_MATERIALS', '[Other] Malicious message' => 'LBL_OTHER_MALICIOUS_MESSAGE'], 'White' => ['[Whitelist] Trusted sender' => 'LBL_TRUSTED_SENDER']]
List categories.
LIST_STATUS  = [0 => ['label' => 'LBL_ACTIVE', 'icon' => 'fas fa-check text-success'], 1 => ['label' => 'LBL_CANCELED', 'icon' => 'fas fa-times text-danger']]
List statuses.
LIST_TYPE_BLACK_LIST  = 0
RLB black list type.
LIST_TYPE_PUBLIC_BLACK_LIST  = 2
RLB public black list type.
LIST_TYPE_PUBLIC_WHITE_LIST  = 3
RLB public white list type.
LIST_TYPE_WHITE_LIST  = 1
RLB white list type.
LIST_TYPES  = [0 => ['label' => 'LBL_BLACK_LIST', 'icon' => 'fas fa-ban text-danger', 'alertColor' => '#ff555233', 'listColor' => '#ff555233'], 1 => ['label' => 'LBL_WHITE_LIST', 'icon' => 'far fa-check-circle text-success', 'alertColor' => '#E1FFE3', 'listColor' => '#fff'], 2 => ['label' => 'LBL_PUBLIC_BLACK_LIST', 'icon' => 'fas fa-ban text-danger', 'alertColor' => '#eaeaea', 'listColor' => '#ff555233'], 3 => ['label' => 'LBL_PUBLIC_WHITE_LIST', 'icon' => 'far fa-check-circle text-success', 'alertColor' => '#E1FFE3', 'listColor' => '#fff']]
List statuses.
REQUEST_STATUS  = [0 => ['label' => 'LBL_FOR_VERIFICATION', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_ACCEPTED', 'icon' => 'fas fa-check text-success'], 2 => ['label' => 'LBL_REJECTED', 'icon' => 'fas fa-times text-danger'], 3 => ['label' => 'PLL_CANCELLED', 'icon' => 'fas fa-minus'], 4 => ['label' => 'LBL_REPORTED', 'icon' => 'fas fa-paper-plane text-primary']]
Request statuses.
SPF  = [1 => ['label' => 'LBL_NONE', 'desc' => 'LBL_SPF_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 2 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_SPF_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 3 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_SPF_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]
SPF statuses.
SPF_FAIL  = 3
Check result: Fail, SoftFail.
SPF_NONE  = 1
Check result: None, Neutral, TempError, PermError.
SPF_PASS  = 2
Check result: Pass (the SPF record stated that the IP address is authorized).
$mailMimeParser  : Message
Message mail mime parser instance.
$value  : array<string|int, mixed>
$dkimCache  : array<string|int, mixed>
DKIM cache.
$senderCache  : array<string|int, mixed>
Sender cache.
$spfCache  : array<string|int, mixed>
SPF cache.
__construct()  : mixed
Constructor.
addReport()  : string
Add report.
findIp()  : array<string|int, mixed>
Find ip in list.
findIpByName()  : string
Find mail ip address.
get()  : mixed
Function to get the value for a given key.
getArray()  : array<string|int, mixed>
Function to get the array values for a given key.
getColorByIps()  : array<string|int, mixed>
Get color by ips.
getColorByList()  : string
Get color by list.
getData()  : array<string|int, mixed>
Function to get all the values of the Object.
getDmarcRecord()  : array<string|int, mixed>
Get DMARC TXT record.
getDomain()  : string
Get domain from URL.
getForHtml()  : mixed
Function to get the html encoded value for a given key.
getForSql()  : mixed
Function to get the value if its safe to use for SQL Query (column).
getInstance()  : self
Create an empty object and initialize it with data.
getIpByName()  : string
Get mail ip address by hostname or ehloName.
getKeys()  : array<string|int, string>
Function to get keys.
getPublicList()  : array<string|int, mixed>
Get IP list from public RBL.
getReceived()  : array<string|int, mixed>
Get received header.
getRequestById()  : self
Function to get the instance of advanced permission record model.
getSender()  : array<string|int, mixed>
Get sender details.
getSenders()  : string
Get senders.
has()  : bool
Function to check if the key exists.
isEmpty()  : bool
Function to check if the key is empty.
parse()  : void
Parsing the email body or headers.
parseHeaderParams()  : array<string|int, mixed>
Parse header params.
remove()  : mixed
Function to remove the value.
sendReport()  : array<string|int, mixed>
Send report.
set()  : $this
Function to set the value for a given key.
setData()  : $this
Function to set all the values.
sync()  : void
Public list synchronization.
updateList()  : int
Update list by request id.
verifyDkim()  : array<string|int, mixed>
Verify DKIM (DomainKeys Identified Mail).
verifyDmarc()  : array<string|int, mixed>
Verify DMARC (Domain-based Message Authentication, Reporting and Conformance).
verifySender()  : array<string|int, mixed>
Verify sender email address.
verifySpf()  : array<string|int, mixed>
Verify SPF (Sender Policy Framework) for Authorizing Use of Domains in Email.
getHeaderEmail()  : string
Get email from header by name.
verifyDmarcDkim()  : array<string|int, mixed>
Verify DMARC ADKIM Tag.
verifyDmarcSpf()  : array<string|int, mixed>
Verify DMARC ASPF Tag.

Constants

DKIM

DKIM statuses.

public array<string|int, mixed> DKIM = [0 => ['label' => 'LBL_NONE', 'desc' => 'LBL_DKIM_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_DKIM_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 2 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_DKIM_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]

DKIM_FAIL

DKIM header verified incorrectly.

public int DKIM_FAIL = 2

DKIM_NONE

DKIM header not found.

public int DKIM_NONE = 0

DKIM_PASS

DKIM header verified correctly.

public int DKIM_PASS = 1

DMARC

DMARC statuses.

public array<string|int, mixed> DMARC = [0 => ['label' => 'LBL_NONE', 'desc' => 'LBL_DMARC_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_DMARC_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 2 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_DMARC_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]

DMARC_FAIL

DMARC header verified incorrectly.

public int DMARC_FAIL = 2

DMARC_NONE

DMARC header not found.

public int DMARC_NONE = 0

DMARC_PASS

DMARC header verified correctly.

public int DMARC_PASS = 1

LIST_CATEGORIES

List categories.

public array<string|int, mixed> LIST_CATEGORIES = ['Black' => ['[SPAM] Single unwanted message' => 'LBL_SPAM_SINGLE_UNWANTED_MESSAGE', '[SPAM] Mass unwanted message' => 'LBL_SPAM_MASS_UNWANTED_MESSAGE', '[SPAM] Sending an unsolicited message repeatedly' => 'LBL_SPAM_SENDING_UNSOLICITED_MESSAGE_REPEATEDLY', '[Fraud] Money scam' => 'LBL_FRAUD_MONEY_SCAM', '[Fraud] Phishing' => 'LBL_FRAUD_PHISHING', '[Fraud] An attempt to persuade people to buy a product or service' => 'LBL_FRAUD_ATTEMPT_TO_PERSUADE_PEOPLE_TO_BUY', '[Security] An attempt to impersonate another person' => 'LBL_SECURITY_ATTEMPT_TO_IMPERSONATE_ANOTHER_PERSON', '[Security] An attempt to persuade the recipient to open a resource from outside the organization' => 'LBL_SECURITY_ATTEMPT_TO_PERSUADE_FROM_ORGANIZATION', '[Security] An attempt to persuade the recipient to open a resource inside the organization' => 'LBL_SECURITY_ATTEMPT_TO_PERSUADE_INSIDE_ORGANIZATION', '[Security] Infrastructure and application scanning' => 'LBL_SECURITY_INFRASTRUCTURE_AND_APPLICATION_SCANNING', '[Security] Attack on infrastructure or application' => 'LBL_SECURITY_ATTACK_INFRASTRUCTURE_OR_APPLICATION', '[Security] Overloading infrastructure or application' => 'LBL_SECURITY_OVERLOADING_INFRASTRUCTURE_OR_APPLICATION', '[Other] The message contains inappropriate words' => 'LBL_OTHER_MESSAGE_CONTAINS_INAPPROPRIATE_WORDS', '[Other] The message contains inappropriate materials' => 'LBL_OTHER_MESSAGE_CONTAINS_INAPPROPRIATE_MATERIALS', '[Other] Malicious message' => 'LBL_OTHER_MALICIOUS_MESSAGE'], 'White' => ['[Whitelist] Trusted sender' => 'LBL_TRUSTED_SENDER']]

LIST_STATUS

List statuses.

public array<string|int, mixed> LIST_STATUS = [0 => ['label' => 'LBL_ACTIVE', 'icon' => 'fas fa-check text-success'], 1 => ['label' => 'LBL_CANCELED', 'icon' => 'fas fa-times text-danger']]

LIST_TYPE_BLACK_LIST

RLB black list type.

public int LIST_TYPE_BLACK_LIST = 0

LIST_TYPE_PUBLIC_BLACK_LIST

RLB public black list type.

public int LIST_TYPE_PUBLIC_BLACK_LIST = 2

LIST_TYPE_PUBLIC_WHITE_LIST

RLB public white list type.

public int LIST_TYPE_PUBLIC_WHITE_LIST = 3

LIST_TYPE_WHITE_LIST

RLB white list type.

public int LIST_TYPE_WHITE_LIST = 1

LIST_TYPES

List statuses.

public array<string|int, mixed> LIST_TYPES = [0 => ['label' => 'LBL_BLACK_LIST', 'icon' => 'fas fa-ban text-danger', 'alertColor' => '#ff555233', 'listColor' => '#ff555233'], 1 => ['label' => 'LBL_WHITE_LIST', 'icon' => 'far fa-check-circle text-success', 'alertColor' => '#E1FFE3', 'listColor' => '#fff'], 2 => ['label' => 'LBL_PUBLIC_BLACK_LIST', 'icon' => 'fas fa-ban text-danger', 'alertColor' => '#eaeaea', 'listColor' => '#ff555233'], 3 => ['label' => 'LBL_PUBLIC_WHITE_LIST', 'icon' => 'far fa-check-circle text-success', 'alertColor' => '#E1FFE3', 'listColor' => '#fff']]

REQUEST_STATUS

Request statuses.

public array<string|int, mixed> REQUEST_STATUS = [0 => ['label' => 'LBL_FOR_VERIFICATION', 'icon' => 'fas fa-question'], 1 => ['label' => 'LBL_ACCEPTED', 'icon' => 'fas fa-check text-success'], 2 => ['label' => 'LBL_REJECTED', 'icon' => 'fas fa-times text-danger'], 3 => ['label' => 'PLL_CANCELLED', 'icon' => 'fas fa-minus'], 4 => ['label' => 'LBL_REPORTED', 'icon' => 'fas fa-paper-plane text-primary']]

SPF

SPF statuses.

public array<string|int, mixed> SPF = [1 => ['label' => 'LBL_NONE', 'desc' => 'LBL_SPF_NONE_DESC', 'class' => 'badge-secondary', 'icon' => 'fas fa-question'], 2 => ['label' => 'LBL_CORRECT', 'desc' => 'LBL_SPF_PASS_DESC', 'class' => 'badge-success', 'icon' => 'fas fa-check'], 3 => ['label' => 'LBL_INCORRECT', 'desc' => 'LBL_SPF_FAIL_DESC', 'class' => 'badge-danger', 'icon' => 'fas fa-times']]

SPF_FAIL

Check result: Fail, SoftFail.

public int SPF_FAIL = 3

SPF_NONE

Check result: None, Neutral, TempError, PermError.

public int SPF_NONE = 1

SPF_PASS

Check result: Pass (the SPF record stated that the IP address is authorized).

public int SPF_PASS = 2

Properties

$mailMimeParser

Message mail mime parser instance.

public Message $mailMimeParser

$value

protected array<string|int, mixed> $value

Values

$dkimCache

DKIM cache.

private array<string|int, mixed> $dkimCache

$senderCache

Sender cache.

private array<string|int, mixed> $senderCache

$spfCache

SPF cache.

private array<string|int, mixed> $spfCache

Methods

__construct()

Constructor.

public __construct([array<string|int, mixed> $values = [] ]) : mixed
Parameters
$values : array<string|int, mixed> = []
Return values
mixed

addReport()

Add report.

public static addReport(array<string|int, mixed> $data) : string
Parameters
$data : array<string|int, mixed>
Return values
string

findIp()

Find ip in list.

public static findIp(string $ip[, bool $onlyActive = false ]) : array<string|int, mixed>
Parameters
$ip : string
$onlyActive : bool = false
Return values
array<string|int, mixed>

findIpByName()

Find mail ip address.

public findIpByName(ReceivedHeader $received, string $type) : string
Parameters
$received : ReceivedHeader
$type : string
Return values
string

get()

Function to get the value for a given key.

public get(string $key) : mixed
Parameters
$key : string
Return values
mixed

Value for the given key

getArray()

Function to get the array values for a given key.

public getArray(string $key[, array<string|int, mixed> $value = [] ]) : array<string|int, mixed>
Parameters
$key : string
$value : array<string|int, mixed> = []
Return values
array<string|int, mixed>

getColorByIps()

Get color by ips.

public static getColorByIps(array<string|int, mixed> $ips) : array<string|int, mixed>
Parameters
$ips : array<string|int, mixed>
Return values
array<string|int, mixed>

getColorByList()

Get color by list.

public static getColorByList(string $ip, array<string|int, mixed> $rows) : string
Parameters
$ip : string
$rows : array<string|int, mixed>
Return values
string

getData()

Function to get all the values of the Object.

public getData() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDmarcRecord()

Get DMARC TXT record.

public getDmarcRecord(string $domain) : array<string|int, mixed>
Parameters
$domain : string
Return values
array<string|int, mixed>

getDomain()

Get domain from URL.

public getDomain(string $url) : string
Parameters
$url : string
Return values
string

getForHtml()

Function to get the html encoded value for a given key.

public getForHtml(string $key) : mixed
Parameters
$key : string
Return values
mixed

getForSql()

Function to get the value if its safe to use for SQL Query (column).

public getForSql(string $key[, bool $skipEmtpy = true ]) : mixed
Parameters
$key : string
$skipEmtpy : bool = true

Skip the check if string is empty

Return values
mixed

Value for the given key

getInstance()

Create an empty object and initialize it with data.

public static getInstance(array<string|int, mixed> $data) : self
Parameters
$data : array<string|int, mixed>
Return values
self

getIpByName()

Get mail ip address by hostname or ehloName.

public getIpByName(string $fromName[, string|null $hostName = null ]) : string
Parameters
$fromName : string
$hostName : string|null = null
Return values
string

getKeys()

Function to get keys.

public getKeys() : array<string|int, string>
Return values
array<string|int, string>

getPublicList()

Get IP list from public RBL.

public static getPublicList(int $type) : array<string|int, mixed>
Parameters
$type : int
Return values
array<string|int, mixed>

getReceived()

Get received header.

public getReceived() : array<string|int, mixed>
Return values
array<string|int, mixed>

getRequestById()

Function to get the instance of advanced permission record model.

public static getRequestById(int $id) : self
Parameters
$id : int
Return values
self

instance, if exists

getSender()

Get sender details.

public getSender() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSenders()

Get senders.

public getSenders() : string
Return values
string

has()

Function to check if the key exists.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

isEmpty()

Function to check if the key is empty.

public isEmpty(string $key) : bool
Parameters
$key : string
Return values
bool

parse()

Parsing the email body or headers.

public parse() : void
Return values
void

parseHeaderParams()

Parse header params.

public static parseHeaderParams(string $string) : array<string|int, mixed>
Parameters
$string : string
Return values
array<string|int, mixed>

remove()

Function to remove the value.

public remove(string $key) : mixed
Parameters
$key : string
Return values
mixed

sendReport()

Send report.

public static sendReport(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
$data : array<string|int, mixed>
Return values
array<string|int, mixed>

set()

Function to set the value for a given key.

public set(string $key, mixed $value) : $this
Parameters
$key : string
$value : mixed
Return values
$this

setData()

Function to set all the values.

public setData(mixed $values) : $this
Parameters
$values : mixed
Return values
$this

sync()

Public list synchronization.

public static sync(int $type) : void
Parameters
$type : int
Return values
void

updateList()

Update list by request id.

public updateList(int $record) : int
Parameters
$record : int
Return values
int

verifyDmarc()

Verify DMARC (Domain-based Message Authentication, Reporting and Conformance).

public verifyDmarc() : array<string|int, mixed>
Return values
array<string|int, mixed>

verifySender()

Verify sender email address.

public verifySender() : array<string|int, mixed>
Return values
array<string|int, mixed>

verifySpf()

Verify SPF (Sender Policy Framework) for Authorizing Use of Domains in Email.

public verifySpf() : array<string|int, mixed>
Tags
see
https://tools.ietf.org/html/rfc7208
Return values
array<string|int, mixed>

getHeaderEmail()

Get email from header by name.

protected getHeaderEmail(string $name) : string
Parameters
$name : string
Return values
string

verifyDmarcDkim()

Verify DMARC ADKIM Tag.

private verifyDmarcDkim(string $fromDomain, string $adkim) : array<string|int, mixed>
Parameters
$fromDomain : string
$adkim : string
Return values
array<string|int, mixed>

verifyDmarcSpf()

Verify DMARC ASPF Tag.

private verifyDmarcSpf(string $fromDomain, string $aspf) : array<string|int, mixed>
Parameters
$fromDomain : string
$aspf : string
Return values
array<string|int, mixed>

        

Search results