Solved

Configuring Sendmail in Solaris

Posted on 2004-04-30
9
1,456 Views
Last Modified: 2013-12-27
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.
0
Comment
Question by:samdeb
  • 4
  • 4
9 Comments
 
LVL 7

Expert Comment

by:fim32
ID: 10961897
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).
0
 

Author Comment

by:samdeb
ID: 10961983
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.
0
 
LVL 7

Expert Comment

by:fim32
ID: 10962179
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
0
 

Author Comment

by:samdeb
ID: 10962227
Thanks, I'll give it a try and I'd let you know the outcome
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:samdeb
ID: 10962688
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.
0
 
LVL 7

Accepted Solution

by:
fim32 earned 150 total points
ID: 10963513
can you clarify your use of the telnet xxxxx?  that's a method of manually testing the connectivity, but if the sendmail.cf file is set up, you should just be able to use the sendmail command:

echo 'test' | /usr/lib/sendmail user@wherever

by forwarding all mails through the remote relay, you're not limiting sending of mails to users of the relay server, you're relying on the remore server to continue relaying your messages out.

to send to groups of users, you can do:
echo 'test' | /usr/lib/sendmail user1@wherever user2@wherever...

if you want to try to set up a group, you'll have to use aliases.  but since you'd have to enable local mail processing (running sendmail as a process) to do that.  your other alternative is to set up a group on your relay mail server (like setting up a mail group on the corporate mail server, and sending mails through that)
0
 

Author Comment

by:samdeb
ID: 10963602
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
0
 
LVL 48

Expert Comment

by:Tintin
ID: 10973866
man mailx
man aliases
0
 
LVL 7

Expert Comment

by:fim32
ID: 11034764
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now