core: smtp: use os:timestamp() instead of now(). Added guards and more strict tests for inc_timestamp/sent handling
(cherry picked from commit b052228307952a90e872fb11e6193014c80e0ab0)
core: the hostname can be 'null', handle it as 'undefined'
(cherry picked from commit e0db5be7c43fbed03ab901055d4e30feca2c85b9)
core: make more robust against illegal page paths from hacking attempts.
(cherry picked from commit 564a6edead2246246f4d8ca6678a0db9999b3974)