Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Soaris sendmail question 1

Status
Not open for further replies.

BOKA

Technical User
Apr 15, 2001
247
US
Hello, all.

I have a Solaris 8 box, from which I would like to send emails from various scripts. There is an SMTP server on the network that will allow me to do so, so this box will be just a client.

I am not planning on receiving email, just sending.

SMTP server requires mail messages it processes to have a certain "from" address.

So, here are the settings that I need:


- solarisbox (no domain) <-- this is Solaris box, will not have a DNS record

- smtp.domain-1.eee <-- SMTP server

- user@domain-2.aaa <-- all outgoing email from any user must be passed to SMTP server as if originating from this user

Any suggestions appreciated.

Thanks

P.S. Please, dont suggest any changes to original parameters, they are not changeable.

Thanks
 
In a [tt]mailx[/tt] command, the "[tt]-r[/tt]" option sets the reply address, which basically acts as the From address.

Code:
$ cat message.txt | mailx -s "Subject Line" [b]-r user@domain-2.aaa[/b] recipient@somewhere.com


 
Thank you, SamBones.

That worked to produce the result I wanted, although not the way I expected. The system actually found an SMTP server in "domain-2.aaa", which still worked due to return address switch.

However, I would really like to specify the original SMTP server (smtp.domain-1.eee) explicitly.

Not exactly sure where this is done, any help is appreciated.

Thanks

 
Try one or both of these...

1) In the file [tt]/etc/hosts[/tt], add this line...

Code:
AAA.BBB.CCC.DDD     mailhost smtp.domain-1.eee

Make sure the IP is correct, but leave the rest of the line as is.

2) In the file [tt]/etc/mail/sendmail.cf[/tt], make the line starting with "[tt]DS[/tt]" look like this...

Code:
# "Smart" relay host (may be null)
[b]DSsmtp.domain-1.eee[/b]

Then restart "sendmail" ("[tt]/etc/init.d/sendmail restart[/tt]").

Then try it again.

Some mail utilities just look for "mailhost" in DNS or the [tt]/etc/hosts[/tt] file. Some utilities use [tt]sendmail[/tt]. This covers both bases.

 
Thanks again!

Option #1 did not seem to work, but option #2 worked like a charm.

I did have to edit sendmail.cf directly as opposed to instructions I was following from here:
It is an excellent writeup, but, for some reason, "make" was creating additional "DS" entry in the sendmail.cf file, so I had 2 entries - one just "DS" and another one "DSsmtp.domain-1.eee".
Once I edited the file directly and removed blank "DS" entry, everything worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top