Discussion Locked

Mail Routing using SendMail

0 helpful
13 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
My linux technician has left my company and I have this linux server but not much knowledge on configuring it. I primarily use it to route mail. I set the MX record on the DNS to point to this server for Domains I host and then have it route all their mail for a particular domain to an external email box on other servers. I need some step by step procedure to do this. Talking to my tech, he says not to use linuxconfig because it doesn't change things correctly. He says I need to modify the files manually. Can anyone tell me why linuxconfig won't work or how to do this manually, step by step? Can linuxconfig be run remotely? When I try using telnet on WIN95, the menus get jumbled and I can't see what to pick.

13 replies

by jay

1. Forward, use file .forward on homedir to forward email to another host/domain. This file contains one email address per line.
2. Procmail, this program can forward/filter incoming mail. Create .procmailrc on your homedir, for sample you can download on Ronny's website http://ronny.haryan.to/

Download putty for much better terminal on your Win95

by mark

I don't want to forward the mail. I think it's aliasing that I want. I want the linux server to accept mail from anyone@mydomain.com and route it to somebody@yourdomain.com.

by ppuru

Mark

First, after you log on to the Linux Server via TELNET, type

export TERM=vt100

This will set your display to show the menus properly.

Before attempting to change the sendmail configurations using linuxconf, please keep a backup of the sendmail.cf file.

Use the command

cp /etc/sendmail.cf /etc/sendmail.cf.good

Linuxconf does forget to update certain parameters, especially the parameters you have set by hand (by directly editing the sendmail.cf)

Linuxconf and netconf (which linuxconf eventually runs) have the option

Configure special domain routing.

This will help solve your routing problem.

Prakash

by mark

The Terminal Command was helpful. I can at least see the menus. Another question of mine was answered that referred me to VCNServer which made the menus much easier. However, I still don't see the option "Configure Special Domain Routing" on either linuxconf or netconf. Am I overlooking it or did my tech somehow disable it?

by bruce timberlake

Look in your /etc/sendmail.cf file to see what the aliases file name is (type "grep AliasFile /etc/sendmail.cf" -- you'll see something like AliasFile=/etc/aliases). You then want to edit that alias file with a text editor like vi or emacs and make an entry for your local username -- let's say username 'bob' -- that looks like this:

bob: other_bob@other_server.com

This will redirect mail coming to bob@yourhost.com to other_bob@other_server.com.

Then you save the changes to your file(ESC :wq in vi, or Ctrl-X Ctrl-S in emacs).

Before you use any editors, etc, in your telnet session, make sure your Windows telnet client and the Linux server are agreeing on what your terminal type is. My recommendation is to not use the default Windows telnet program. Go to www.download.com and get a Telnet/SSH client like SecureCRT (my personal favorite). You can actually set the telnet session to use a terminal type of "linux" and then all apps on the linux box will work perfectly within your telnet session.

by mark

Your approach looks like what others tell me but I think my former tech used a different approach. The aliases file doesn't have the entries that we are re-routing. After hunting, they seem to be in a file called "mailertable" and the domains are in another file called "relay-domains". The syntax is "domain esmtp:address@otherdomain.com". Is he doing something abnormal? Also are duplicate sendmail.cf files a problem? I see one in /etc and another in /etc/mail. The routing info is in /etc/mail. One customer does complain of mail headers getting stripped. Does this configuration cause this?

by ppuru

Does linuxconf show Mail delivery system (Sendmail) under Server Tasks?

If not, you will need to enable this under linuxconf:

Start LinuxConf

Control -> Control files and systems -> Configure linuxconf modules

and check

Sendmail - mail server configuration.

Now exit linuxconf and restart it.

You should find

Configure special (domain) routing
and
Configure complex (user) routing.

Try Configure complex (user) routing if Domain routing does not seem to work.

Prakash

by mark

After looking at the sendmail site, it appears they say not to use linuxconf to configure sendmail. Apparently my tech had purposely disabled these options and apparently rightly so. I'll have to learn how to edit the files manually.

by john.paciotti

Mark,
If I understand correctly, you use this server as a smart host or mail forwarder. First and foremost, update your version of sendmail. Download from www.sendmail.org. After installing it, using linuxconf for the basic setup of your sendmail config is fine, but it is not efficient enough for your entire needs. You will have to manually edit files. After initially setting up you sendmail config, you now have to configure endmail to accept email for the Internet Domains you are hosting. In the sendmail.cf file, look for a line starting with Cw (yes that is a capital letter "C" and a lower case letter "w" ). this line should already have the Fully Qualified Domain Name for you company domain. You will have to add the domain names of the other Internet Domains for which you will be accepting email. You will also need to add the domain names to the accpthost file in /etc/mail. You may want to add the ip addresses for them also. You should be able to use the virtual user features of your sendmail. To do this, change directory to /etc/mail and modify the virtusertable file to include the email address on the left column and the actual account including which server to direct the email to. For more detailed info, try the following sites: www.sendmail.org , www.linuxdoc.org

John Paciotti
johnpac@consultant.com

by mark

I think this is going to help somewhat. Sendmail is current and I have the "Bat" book, but it is very difficult to follow. One of my main questions is why he is using the mailtable file instead of alias file that most people have told me to use to re-route mail externally. I'm not using the server to route to other servers, but to direct domain mail to a single POP mailbox or to allow it to manage POP mailboxes for a domain. Is there some HTTP interface available so the customers can manage it themselves? Post me another answer so I can credit your points.

by john.paciotti

One of my main questions is why he is using the mailtable file instead of alias file that most people have told me to use to re-route mail externally. I'm not using the server to route to other servers, but to direct domain mail to a single POP mailbox or to allow it to manage POP mailboxes for a domain.
The aliases file is best used when the mail server is only hosting mail for one domain. The virtusertable lets you host many email domains.
Ok...so you have one server that is going to be the mailhost for many domains ? Is this correct ? If so, then change my previous email section about the virtusertable. I stated to have the left column be the incoming mail address and the right column to be the account@host.domain . Since all your email accounts for the various email domains, are going to be on the same machine, you should make the left column the incoming email address and the right column the local machine account.

John Paciotti
CompuData Inc.

This discussion is closed to new replies.