How to relay mail to mail server from Unix ?

Hi,

I need to send email notifications from Unix/Linux box to users using mailx.

In these Unix/Linux boxes mail is not configured however we are having mail server configured in our LAN.

Could you please provide instructions to configure relay in these boxes so that we can relay our mails to existing mail server from Unix/Linux boxes?

Thanks in advance.

# alternatives --config mta
There are 2 programs which provide 'mta'.
  Selection    Command
-----------------------------------------------
*  1           /usr/sbin/sendmail.sendmail
 + 2           /usr/sbin/sendmail.postfix
 
# grep relayhost /etc/postfix/main.cf
 
# The relayhost parameter specifies the default host to send mail to
# no relayhost is given, mail is routed directly to the destination.
relayhost = myemailserver.mydomain.com
#relayhost = [gateway.my.domain]
#relayhost = [mailserver.isp.tld]
#relayhost = uucphost
#relayhost = [an.ip.add.ress]
 

Hi ygemici,

I am trying to configure it on Solaris where I can't locate
relayhost /etc/postfix/main.cf file..
Could you please provide detailed instructions for this ?

Thanks..

Hmm probably you use sendmail;)

then you must edit main config on mail client

# vi /etc/mail/sendmail.cf

find DS
and change like

 
DSmymailserver.domain.com

Actually i think it is not neccessary if your clients access to your DNS and if exists MX reco in local DNS zone and if mail server is configured..

If you configure for each domain diffrerent permission for incoming relay
you can edit

 
vi /etc/mail/sendmail.cf

add

 
access:
to:remotedomain.com
 

If you configure for each domain diffrerent permission for outcoming relay
you can edit

vi /etc/mail/access

add

Connect:mydomain.com              RELAY
Connect:10.10.1.100                  RELAY

Regards
ygemici