Incoming Message address manager.
More...
|
| | fetch_data_key () |
| | Return the data key for the data item.
|
| |
| | generate ($userid, $userkey=null) |
| | Generate an e-mail address for the Inbound Message handler, storing a private key for the data object if one was not specified.
|
| |
| | get_data () |
| | Retrieve the data parsed from the address.
|
| |
| | get_handler () |
| | Return the active handler.
|
| |
| | handle_message (\stdClass $messagedata) |
| | Process the message against the relevant handler.
|
| |
| | process_envelope ($recipient, $sender) |
| | Process the message recipient, load the handler, and then validate the sender with the associated data record.
|
| |
| | set_data ($datavalue, $datakey=null) |
| | Specify an integer data item value for this record.
|
| |
| | set_data_key ($datakey=null) |
| | Specify a known data key for this data item.
|
| |
| | set_handler ($classname) |
| | Set the handler to use for the subsequent Inbound Message commands.
|
| |
|
| static | is_correct_format ($address) |
| | Determine whether the supplied address is of the correct format.
|
| |
|
| int const | HASHSIZE = 24 |
| | The size of the hash component of the address.
|
| |
|
int const | VALIDATION_ADDRESS_MISMATCH = 256 |
| | A validation status indicating that the originator address did not match the user on record.
|
| |
|
int const | VALIDATION_DISABLED_HANDLER = 16 |
| | A validation status indicating that the mail processing handler was not enabled.
|
| |
|
int const | VALIDATION_DISABLED_USER = 32 |
| | A validation status indicating that the user specified was deleted or unconfirmed.
|
| |
|
int const | VALIDATION_EXPIRED_DATAKEY = 64 |
| | A validation status indicating that the datakey specified had reached it's expiration time.
|
| |
| int const | VALIDATION_INVALID_ADDRESS_FORMAT = 1 |
| | A validation status indicating an invalid address format.
|
| |
|
int const | VALIDATION_INVALID_HASH = 128 |
| | A validation status indicating that the hash could not be verified.
|
| |
|
int const | VALIDATION_SUCCESS = 0 |
| | A validation status indicating successful validation.
|
| |
|
int const | VALIDATION_UNKNOWN_DATAKEY = 8 |
| | A validation status indicating that the data key specified could not be found.
|
| |
|
int const | VALIDATION_UNKNOWN_HANDLER = 2 |
| | A validation status indicating that a handler could not be found for this address.
|
| |
|
int const | VALIDATION_UNKNOWN_USER = 4 |
| | A validation status indicating that an unknown user was specified.
|
| |
|
| | generate_data_key () |
| | Generate a new secret key for the current data item and handler combination.
|
| |
| | pack_int ($int) |
| | Pack an integer into a pair of 32-bit numbers.
|
| |
| | process ($address) |
| | Process an inbound address to obtain the data stored within it.
|
| |
| | validate ($address) |
| | Ensure that the parsed data is valid, and if the handler requires address validation, validate the sender against the user record of identified user record.
|
| |
Incoming Message address manager.
- Copyright
- 2014 Andrew Nicols andre.nosp@m.w@ni.nosp@m.cols..nosp@m.co.u.nosp@m.k
- License
- http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
◆ fetch_data_key()
| core\message\inbound\address_manager::fetch_data_key |
( |
| ) |
|
Return the data key for the data item.
If no data key has been defined yet, this will call generate_data_key() to generate a new key on the fly.
- Return values
-
| string | The secret key for this data item. |
◆ generate()
| core\message\inbound\address_manager::generate |
( |
| $userid, |
|
|
| $userkey = null ) |
Generate an e-mail address for the Inbound Message handler, storing a private key for the data object if one was not specified.
- Parameters
-
| int | $userid | The ID of the user to generated an address for. |
| string | $userkey | The unique key for this user. If not specified this will be retrieved using get_user_key(). This key must have been created using get_user_key(). This parameter is provided as a performance optimisation for when generating multiple addresses for the same user. |
- Return values
-
| string|null | The generated address, or null if an address could not be generated. |
◆ generate_data_key()
| core\message\inbound\address_manager::generate_data_key |
( |
| ) |
|
|
protected |
Generate a new secret key for the current data item and handler combination.
- Return values
-
| string | The new generated secret key for this data item. |
◆ get_data()
| core\message\inbound\address_manager::get_data |
( |
| ) |
|
Retrieve the data parsed from the address.
- Return values
-
◆ get_handler()
| core\message\inbound\address_manager::get_handler |
( |
| ) |
|
Return the active handler.
- Return values
-
| core::message::inbound::handler|null; | |
◆ handle_message()
| core\message\inbound\address_manager::handle_message |
( |
\stdClass | $messagedata | ) |
|
Process the message against the relevant handler.
- Parameters
-
| stdClass | $messagedata | The data for the current message being processed. |
- Return values
-
| mixed | The result of the handler's message processor. A truthy result suggests a successful send. |
◆ is_correct_format()
| static core\message\inbound\address_manager::is_correct_format |
( |
| $address | ) |
|
|
static |
Determine whether the supplied address is of the correct format.
- Parameters
-
| string | $address | The address to test |
- Return values
-
| bool | Whether the address matches the correct format |
◆ pack_int()
| core\message\inbound\address_manager::pack_int |
( |
| $int | ) |
|
|
protected |
Pack an integer into a pair of 32-bit numbers.
- Parameters
-
| int | $int | The integer to pack |
- Return values
-
| string | The encoded binary data |
◆ process()
| core\message\inbound\address_manager::process |
( |
| $address | ) |
|
|
protected |
Process an inbound address to obtain the data stored within it.
- Parameters
-
| string | $address | The fully formed e-mail address to process. |
◆ process_envelope()
| core\message\inbound\address_manager::process_envelope |
( |
| $recipient, |
|
|
| $sender ) |
Process the message recipient, load the handler, and then validate the sender with the associated data record.
- Parameters
-
| string | $recipient | The recipient of the message |
| string | $sender | The sender of the message |
◆ set_data()
| core\message\inbound\address_manager::set_data |
( |
| $datavalue, |
|
|
| $datakey = null ) |
Specify an integer data item value for this record.
- Parameters
-
| int | $datavalue | The value of the data item. |
| string | $datakey | A hash to use for the datakey |
◆ set_data_key()
| core\message\inbound\address_manager::set_data_key |
( |
| $datakey = null | ) |
|
Specify a known data key for this data item.
If specified, the datakey must already exist in the messageinbound_datakeys table, typically as a result of a previous Inbound Message setup.
This is intended as a performance optimisation when sending many e-mails with different data to many users.
- Parameters
-
| string | $datakey | A hash to use for the datakey |
◆ set_handler()
| core\message\inbound\address_manager::set_handler |
( |
| $classname | ) |
|
Set the handler to use for the subsequent Inbound Message commands.
- Parameters
-
| string | $classname | The name of the class for the handler. |
◆ validate()
| core\message\inbound\address_manager::validate |
( |
| $address | ) |
|
|
protected |
Ensure that the parsed data is valid, and if the handler requires address validation, validate the sender against the user record of identified user record.
- Parameters
-
| string | $address | The fully formed e-mail address to process. |
- Return values
-
| int | The validation status. |
◆ HASHSIZE
| int const core\message\inbound\address_manager::HASHSIZE = 24 |
The size of the hash component of the address.
Note: Increasing this value will invalidate all previous key values and reduce the potential length of the e-mail address being checked. Do not change this value.
◆ VALIDATION_INVALID_ADDRESS_FORMAT
| int const core\message\inbound\address_manager::VALIDATION_INVALID_ADDRESS_FORMAT = 1 |
A validation status indicating an invalid address format.
Typically this is an address which does not contain a subaddress or all of the required data.
The documentation for this class was generated from the following file:
- lib/classes/message/inbound/address_manager.php