Simple Forwarding From Local Machines

If you have local machines that you wish to have deliver mail via your sendmail server, you need to hack sendmail.mc on them and restart their local sendmail. Uncomment the SMART_HOST line in the macro file (probably /etc/mail/sendmail.mc) and aim it at your sendmail server:

     define(`SMART_HOST',`stargate')

Rebuild the sendmail.cf file:

     /usr/bin/m4 sendmail.mc >sendmail.cf

Restart sendmail:

     /etc/rc.d/init.d/sendmail stop
     /etc/rc.d/init.d/sendmail start

You should now be able to send mail to the main mail server from the local machine (if relaying is denied, you may need to add the local machine's address to relay-domains on the mail server). You might want to alias the following users in /etc/aliases on the local machine:

     root: joeblow@mydomain.com

As long as the aliased name contains a domain name, it will be forwarded by the local sendmail to the SMART_HOST. If the domain name is marked as a local domain on the main mail server, the mail will get delivered there. Note that you need to recycle sendmail on the local machine when you add aliases to /etc/aliases.