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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to configure Outlook to retrieve mail from sendmail

Status
Not open for further replies.

colpaarm

Programmer
Jun 30, 2003
29
US
We are currently using ms exchange server and want to move to sendmail. I have set up a minimum config file to make sure that I can at least send mail. Now for my questions.

1. How does one configure a windows client to connect to sendmail? I know that you go to the accounts section, but could someone explain the process of how outlook knows to only grab email for a particular user. Does it download mail off the server or just make a copy? There seems to be little documentation on this.
2. How does one set up an email address for a user on sendmail? For example, if we get a new employee in and I want to set up newemp@domain.com, how do I do that? I have the "bat" book and I don't see how to do that as of yet. I'm assuming that it must be the same thing as the user name on the linux box (I'm running redhat 8.0) but again, I'd like a little confirmation.

Thanks in advance for any help you can give.
 
You are correct that the user is a system user. First of all you need to setup sendmail so it will accept incoming mail. In /etc/mail/sendmail.mc you will see a line that starts with DAEMON_OPTIONS. This will point to the loopback device (127.0.01) which means don't look at eth0. Comment this line out by placing "dnl" in front of it or better yet, delete the cotton picker. Now you need to allow relaying. Add this line:

FEATURE(`relay_local_from')dnl

Note the tick before relay - it is the one under "~".

After editing, you will need to compile sendmail.mc to make sendmail.cf. This is done with the folowing command:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Now you need to tell sendmail WHO may relay mail through your server. This is done with the access file. It should look something like this:

localhost RELAY
localhost.localdomain RELAY
127.0.0.1 RELAY
yourdomain.com RELAY

When you are done create access.db:

makemap hash /etc/mail/access.db < /etc/mail/access

If you are goint to have virtual users such as webmaster, info,sales or admin, you don't need to create real accounts for these. You can put them in a file called /etc/mail/virtusertable. Let's say your are joe and have a user account on your system. You could do something like the following:

webmaster@yourdomain.com joe
info@yourdomain.com joe

if yours is the only domain this server handles mail for then you just need the user name:

admin joe

Or you can send it to any e-mail address:

webmaster@yourdomain.com joe@your-isp.com

Now to answer your question. You don't. Your mail client doesn't connect to sendmail to receive mail. It connect to the POP3 or IMAP server. Red Hat has both, you just need to have them load at boot time. The run as daemons so you also need to start xinetd. You can have either or both running at the same time. Set your client to use pop3 if you want mail to be deleted off the server after transfering to the client. With imap, the user must purge their old mail on the server. To access the mail server for either sending or receiving mail. Use mail.yourdomain.com for both. The name of the mail server is what you named it when you created the dns &quot;MX&quot; record. If this hasn't been done yet, you need to go to whereever your domain's dns records are which is usually your registrar. Create an &quot;A&quot; (Address) record for the mail server. All you do is point mail.yourdomain.com to your ip address. Now you create the &quot;MX&quot; (Mail eXchange) record. All this does is show that mail.yourdomain.com handles the mail for yourdomain.com. You should have a working e-mail server at this point which will let your users send and receive mail from their home computers. You will need to work on making your server more secure. One way is to use POP before SMTP. This will cause your system to rquire a password before relaying mail but this way is old school and there are much better way of securing your server nowadays.

 
Concise and to the point, RhythmAce. Thanks so much for your help. Yeah, I learned that you have to connect to some type of pop server to actually download email. I didn't realize, however, that redhat comes with both (pop and imap). From what I've gathered, it looks like pop is better because you can back up users email in that manner (along with a few other advantages).

Because I didn't realize that redhat has both types of servers, I went scavaging for one and found with with very little documentation. Now that I know, I'll try and find docs on rh's stuff. However, you've given me enough info for me to put the pieces together. Thanks again.
 
You won't find much documentation on pop3d because there isn't anything to configure. You just need to activate it at startup. When mail comes into your mail server, it gets put into a file /var/spool/mail/username where &quot;username&quot; is the name of a user on your linux system. All mail for that user gets put into one file. When you make a request for your mail from a mail client such as Outlook, it sends the request to your server's ip on port 110 and the pop server looks for your name in /var/spool/mail/ if your username and password match, the file gets sent to you. Your e-mail client will take the file and break it down into individual e-mails. If you want a POP# server you can configure, you can download qpopper and compileit with the configuration you want.
 
Thanks for the info. Actually, I made a mistake with one of my statements. What I meant to say was that it looks like imap is better than pop.

How do imap and pop work with clients like outlook? For example, I know that you can set up mailing lists with the virtusertable file in sendmail. However, does outlook know to plug into such a file for mailing lists? For example, at work when I want to send a message I can click on the &quot;To&quot; tab and see a list of all users and mailing lists. If I'm not mistaken, the client pulls that information from the mail server for you to view. We have ms exchange so everything works seemlessly. Just wondering how would things work with sendmail/imap (pop).
 
Okay, I have another question. I'm sending mail and receiving it. However, when I receive it (I'm using a php script that is connecting to sendmail), the &quot;from&quot; is set to apache@machine_name.domainname.net.

&quot;apache&quot; is the user that my php server is running under
&quot;machine_name&quot; is obviously the name of the machine
&quot;domainname&quot; is the name of the domain that the machine was set to (although I don't remember where to configure that on rh)

Here's the problem; I'd prefer that when users get mail from this php application I've created, the &quot;from&quot; is set to someotheruser@someotherdomain.com. I've done some reading and it appears that I can get the @someotherdomain.com part working by using the masquerade_as macro, recompiling my .cf file and restarting sendmail. However, I can't figure out how to get my application to say that it's coming from a certain user.

Well put it like this. I would guess that the only real solution is to create a new user with the same priveledges as apache, have my php application run as that user and I should be fine. Would I be correct in saying that that is the only real solution for the user part? Thanks again.
 
Ok:
You have to use a pop servive on you mail server with sendmail. Install a pop3 server package like qpopper 3.x This will enable you to open a pop session on your server from a remote client via port 110. So Sendmail is just an MTA and will receive and send email for the domain and users it is configured for. It can not put the mails in specific user accounts thats why you need a package like qpopper. (I can help you install qpopper if you need it).
Now
1. for your outlook, I am assuming you are talking about MS Outlook 2000 or eqv, not express. If you go to Tools,- Services,- and then you add a service for Internet Mail. There you will specify the user email address, then the incoming mail server (your mail server unix) and outgoung mail server your mail server unix). The account, the username and the password as set up as the unix account on the mail server. Thats it.

2. Adding a new user:
On the unix box once setup is complete, then will be running sendmail for smtp (port 25) and qpopper for pop3 (port 110), go in and add a user:
useradd -d /export/home/newusermp -m newusermp (if you want the user to have a home directory, or simply
useradd newusermp
passwd *****

Thats it, the user will be on the system. Once mail is arrives on the system via sendmail, it will be delivered into the users mailbox in the mail directory and using qpopper through pop3 the user can download the mail after supplying the username and passwd.

hope that helps.

Mastercc119: Learning all the time...
 
Thanks for the post. Yeah, I figured out after I posted this that I needed another server for the retrieval of mail. From what I've read, I'm going to use an imap server because the mail stays on the mail server. Makes baking up of mail easy.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top