I've managed to get the Exim + Pgsql setup working.
For the domains I'm hosting I have a set of records which contain an email
address within the domain and an delivery email address, e.g.
user(a)hosted.domain -> gary.stainburn(a)ringways.co.uk
When I test this using
exim -bt user(a)hosted.domain
it works fine, but when I try to send an email it fails
relay not permitted.
Obviously i do not want to turn on relaying, so how can I configure Exim to
allow emails that have matched a record in the user table to be forwarded?