Solved

Configuring Sendmail in Solaris

Posted on 2004-04-30
9
1,454 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
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

706 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

18 Experts available now in Live!

Get 1:1 Help Now