Add the ability to export mail forwarding rules

Similar to the DNS export, this lets you export the mail forwarding
rules for your mail domains. Currently just a simple TAB delimited text
file output is provided in the format

    source\tdestination\n

Again, this works for expired domains.

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
Use %u for the users UID

The users UID as stored in user_session.uid is an unsigned int, change
several cases where we were using %d to represent this to %u.

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>
Use strtoul(3) when dealing with user_session.uid

There are cases when we need to convert the users UID from a string into
an unsigned int. Previously we'd been using atoi(3) to do this but this
returns an int, use strtoul instead, while this returns an unsigned
long, the uid should never be more than an unsigned int so this should
be OK.

Signed-off-by: Andrew Clayton <andrew@dnsandmx.com>