This example provides a Mail::SRS compatible sender rewrite scheme implementation, our documentation shows how to implement it properly.
Follow the instructions in our manual to add our package repository and then run the below command.
apt-get install halon-extras-srs
yum install halon-extras-srs
These functions needs to be imported from the extras://srs module path.
Apply the SRS forward scheme to an address
Params
- localpart
string- The email address localpart - domain
string- The email address domain - opts
array- options array
Returns: A string containing an email address localpart with SRS applied
The following options are available in the opts array.
- secret
string- A secret. The default is an empty secret. - hashlen
number- Number of charaters to include from the secret hash. The default is 4.
Apply the SRS forward scheme to an local part
Params
- localpart
string- The email localpart - opts
array- options array
Returns: An array containg the localpart and the domain of the SRS reversed address. On error none is returned.
The following options are available in the opts array.
- secret
string- A secret. The default is an empty secret. - hashlen
number- Number of charaters to include from the secret hash. The default is 4. - maxage
number- Number of days the SRS address should be valid. The default is 21 days.