ok - i give up trying to find the answer to this so here i am :)
I have postfix/dovecot setup using virtual accounts. I basically followed this guide http://pietervogelaar.nl/ubuntu-12-04-install-postfix-dovecot-and-vimbadmin/
But what I ideally want is to set up a mail server to be an endpoint for some domains, whilst relay others.
Example
example.com is a virtual domain hosted locally on the mail server. [email protected] is an email address on the local server so mails are stored in /var/vmail/example.com/info
otherdomain.com is a domain that needs all messages relayed to some.other-server.com whilst going through spam/av checking first. no mails or accounts are stored locally.
EDIT
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
broken_sasl_auth_clients = yes
config_directory = /etc/postfix
content_filter = amavis:[127.0.0.1]:10024
dovecot_destination_recipient_limit = 1
enable_original_recipient = no
header_checks = regexp:/etc/postfix/header_checks
inet_interfaces = all
mailbox_size_limit = 0
mydestination = mx1.itmanx.com, localhost, localhost.localdomain, localhost
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, reject_invalid_hostname, reject_unauth_pipelining, reject_non_fqdn_sender, reject_unknown_sender_domain, reject_non_fqdn_recipient, reject_unknown_recipient_domain, reject_rbl_client sbl.spamhaus.org, permit
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes
virtual_alias_maps = mysql:/etc/postfix/mysql/virtual-aliases.cf
virtual_gid_maps = static:5000
virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual-mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:5000
/etc/postfix/mysql/relay_domains
~ Domains this mail server will relay (ie, send elsewhere)
/etc/postfix/mysql/virtual_alias_domains
~ If you want to forward one domain to another domain, add the forwarding domain in the alias_domains table and add a route in the alias_maps table like @alias.com @goto.com.
/etc/postfix/mysql/virtual_alias_maps
~ User aliases eg [email protected] goes to [email protected]
~ Catchall: @example.com goes to [email protected]
~ Nb. if you are using a domain that is not in the domains table, then you must add it to alias_domains table.
/etc/postfix/mysql/virtual_mailbox_domains
~ Virtual domains this mail server will handle
/etc/postfix/mysql/virtual_mailbox_maps
~ Where to store a virtual mailbox's mail, prefixed by virtual_mailbox_base
/etc/postfix/mysql/transport_maps
~ What transport to use to send mail eg virtual or relay
~ Here you can put things like relay:[relay.mail-server.com] in the transport field
I don't see any transport maps in your config. It must be something like following
/etc/postfix/sql/relay_domain.conf
/etc/postfix/sql/transport.conf
Note: in the description field you must specify ip address of the relay server
You can get more info at http://sourceforge.net/apps/mediawiki/postfixadmin/index.php?title=Relay_Domains