Linux – Using sendmail to forward to one sendmail server and sending mail from that server

linuxsendmail

I am using linux with centos 6.2 distribution. I have 2 VM running these distributions.

One VM is named 'proxy' and the other 'auth'.

Have sendmail installed on both. Proxy does not have an internet connection.

My intention is to use a php page on proxy to send an email out by having sendmail in proxy forward the mail to auth and then have auth sent the email out. 'auth' has an internet connection.

Any feedback would be helpful and greatly appreciated.

Hi,
Thanks. I did as you suggested. However, my proxy is still relaying using root@localhost instead of relaying straight to auth:

Jan 14 08:18:57 test1 sendmail[10212]: s0EGEvce010212: from=proxy, size=235, class=0,     nrcpts=1, msgid=<201401141614.s0EGEvce010212@test1>, relay=root@localhost Jan 14 08:18:57 test1 sendmail[10212]: s0EGEvce010212: to=cumaresen@gmail.com, delay=00:04:00, mailer=esmtp, pri=30235, dsn=4.4.3, stat=queued 

The issue disappears when i add back the default gateway for the internet connection. However, when i do that, it just sends the mail out without goign through auth.

However, a diff scenario is seen when sending a mail between proxy and auth: In this case, the relay used is auth.localdomain.

As it stands, proxy can ping auth without the route to the internet and vice versa.

I have in my sendmail.mc file :

define(`SMART_HOST', `auth.localdomain')dnl

Solution:

Sendmail: Mails are still being relayed to root@localhost

Best Answer

In sendmail jargon you need to configure "proxy" to use "auth" as a Smarthost.

# /etc/mail/sendmail.mc
<snip>
(`SMART_HOST',`auth.mydomain.com`)

And re-create your sendmail.cf from the macro.

Then configure "auth" to relay messages from "proxy".

# /etc/mail/access
#
# By default we allow relaying from localhost...
Connect:localhost.localdomain           RELAY
Connect:localhost                       RELAY
Connect:127.0.0.1                       RELAY
Connect:proxy                           RELAY

And recreate the access.db makemap hash access.db < access

Related Topic