I have implemented a script that uses a standardized hook (UAPI::Email::add_forwarder) to track certain details relating to the addition of a forwarder to an email account.
This is working fine, but I have come across one limitation - the data passed to my methods by the hook does not include the IP address of the actor who added the forward (I am guessing that the IP is missing because hooks can fire in a context where an IP is not present?).
As I need the IP info, I am forced to scrape the access logs to find matching entries from which I can extract an IP. This solution is less robust than I would like and so I am curious if there is a better way to get the IP address as well as the forward details?
This is working fine, but I have come across one limitation - the data passed to my methods by the hook does not include the IP address of the actor who added the forward (I am guessing that the IP is missing because hooks can fire in a context where an IP is not present?).
As I need the IP info, I am forced to scrape the access logs to find matching entries from which I can extract an IP. This solution is less robust than I would like and so I am curious if there is a better way to get the IP address as well as the forward details?