If I have a virtual site which has a different ip address from the main server is there a way of configuring sendmail to know that when I send an email, via a PHP script, that it should use the virtual site's ip address in the headers instead of the main server ip address?
There is a way to do it - the genericstable option. Sort of virtusertable, but in reverse.
I messed around with it a bit once, but never got it working properly. Also, the UI would not be integrated with it at all, so you'd need to manually add users/domains to it and rebuild the db files by hand.
Check the sendmail docs at http://sendmail.org/virtual-hosting.html: If you would like to reverse-map local users for out-bound mail, you will need to add support for the generics table to your .mc file: FEATURE(`genericstable', `dbm /etc/mail/genericstable')dnl GENERICS_DOMAIN_FILE(`/etc/mail/generics-domains')dnl And you will need to create /etc/mail/genericstable which is like /etc/mail/virtusertable above except the columns are reversed: jschmoe joe@xxxxxxxxxxxxxx Note: you may also wish to consult our Masquerading and Relaying page. Hope that points you in the right direction...