Link to home
Start Free TrialLog in
Avatar of samdeb
samdeb

asked on

Configuring Sendmail in Solaris

I have a solaris 8, that I'd like to configure a sendmail. However, I am very new to this and I have not a clue where to begin.  I have sendmail running on the system when I checked the processes, but I don't know how to configure sendmail.cf file to put to a POP3 mail server.  What I am trying to do is send mail from the SUN box to a the corporate mail server.  Please help.
Avatar of fim32
fim32

well, there's no need to POP3 anything, if all you want to do is forward mail to the corporate mail server.  in particular, when mail servers talk to one another, they use SMTP.  POP3, IMAP, and the other, fancier protocols are for user interaction

mainly, it's a question of domains.  if you're running the default sendmail.cf file, it sends mail through a relay server named "mailhost.yourdomain.com" or "mailhost" if solaris hasn't been set up with a domainname.

you got 2 choices.  you can make solaris discover outbound mail servers on it's own (by unsetting the relay variable) or you can just tell it to forward all mail to the mailhost server (like setting your corporate mail server as your mailhost server).
Avatar of samdeb

ASKER

I have done all these.  I have define dns in resolv.conf, and sswitch.conf and the host is using FQDN in hosts file entry.  Do I need to configure anything in sendmail.cf.  That file looks very confusing to me.  And how or where do I specified the IP address or the hostname of the corporate mail server.  The corporate mail server is the one that is going to be mailhost server.  Byt the way thanks for your answer.
then this'll be much easier :P  you don't have to go too far down the sendmail.cf file, after a certain point, when you see what looks like a whole lot of garbage (but is actually mail processing rules), that part is entirely generated.

the variable we'll look at is "DS", the line before should say "Smart" relay host (may be null), it should say:
DSmailhost$?m.$m$.

which translates to mailhost.`domainname`

if it's blank, or something different, or, if you already have a name fro you corp mail server you want to use, liek "bob" or "bob.mycompany.com", then you just set it:
DSbob
or
DSbob.mycompany.com.

otherwise, just edit the mailhost entry in your /etc/hosts file:
x.x.x.x mailhost mailhost.yourdomain.com

lastly, as this host doesn't look like it'll be receiving any mails, you can disable running sendmail as a process (pkill sendmail), and then just try sending mails out:
echo "test" | /usr/lib/sendmail you@yourdomain.com
Avatar of samdeb

ASKER

Thanks, I'll give it a try and I'd let you know the outcome
Avatar of samdeb

ASKER

Thank you very much for all your help.  However, what the users want is something weird. They just want me to send them a log of a job on the server to their inbox on corporate mail.  I think sendmail is perfect for this.  However, their are groups of them.  Is there a place in sendmail.cf where you can define a group.  So I can send the log to this group.  

One other thing I realize is that in other for me to send mail using sendmail, I had to first use this command:

telnet xx.xx.xx.xx 25

then MAIL FROM:<username@domain.com>
RCPT TO:<username@mailserver.domain.com>
DATA

I then have to use QUIT to end this session.

My question is, is there a way for me to configure all of these so I don't have to specifie recipient mailserver.  I am not going to know the external mail server addresses.  More so, I don't want to be suing this command every time I wanna send e-mail.

The server is not going to receive any e-mail what so ever. It just sends it.

Thanks a million.
ASKER CERTIFIED SOLUTION
Avatar of fim32
fim32

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of samdeb

ASKER

It works using this command
echo 'test' | /usr/lib/sendmail user@wherever

But it sends it in a BC (blind copy), how can I make it look like it is sending it from and To the recipents.

I am going to accept your comments on your next reply, I think you have done a lot by helping me

Thanks again
Avatar of Tintin
man mailx
man aliases
been a while :P

well, actually using
  echo 'test' | /usr/lib/sendmail user@wherever
instructs sendmail to do what it has to do to get the mail out, but by default sendmail doesn't set headers.  if you'd like default header performance, you can do something like this:

cat <<END | /usr/lb/sendmail user@wherever
To: user@wherever
Wrom: STTZRCL
Subject: this is my subject
here is the text of my email
END

that's all it takes to set headers. OR, you can use mail wrappers, like mailx as tintin has suggested.