LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   putting mail server on my linux box (https://www.linuxquestions.org/questions/linux-newbie-8/putting-mail-server-on-my-linux-box-467257/)

MrSako 07-24-2006 07:05 PM

putting mail server on my linux box
 
im trying to install a mail server for mail purposes

the entire process seems alot more complex than i thought but this is something i need.

right now all i think that i have really figured out is the correct BIND DNS entry for a mail server (MX) is... (but i dont know for sure if this is right, i changed the name of the domain because id prefer this post not show up by googling my site name)

mydomain.com. IN MX 10 mail.mydomain.com.


now i also had sendmail installed i coudlnt figure it out and make it work. so now i'd like to install qmail and try it because i heard its easier.

i also beleive in order to foward the mail to be downloadable by mail clients like thunderbird and outlook i need something like procmail?

i would just like someone to explain what i need for this to happen. im very confused.

btw this is for CentOS 4 (if theres specific versions i need for CentOS 4 could you please post them also)

thank you

cs-cam 07-24-2006 09:56 PM

I set up a mail server once with this walkthrough. It's basically step-by-step you can't go wrong.

Once you've done that and you have a better understanding of where everything goes and how it all works it's much easier to set up a different system yourself. After doing that I set up Postfix + courier-imap on two other computer very easily, it's just getting over the initial hump of understanding how everything works together :)

billymayday 07-24-2006 11:01 PM

I haven't used qmail, but I've seen a few referrals to www.qmailrocks.org, so this may help.

Along with what cs-cam said, I use Postfix, and it's really a very simple setup. Postfix (as is Sendmail, and I'd guess qmail) is a mail transfer agent (MTA). It simply receives email (usually on port 25) and delivers it somewhere (typically a user's mailbox or the recipient on the net, but it can do other things too - see following paragraph, or to a fax, another mail server, whatever).

Programs like procmail and maildrop confuse things a bit, but typically thay receive mail from, say, Postfix and deliver it to a mailbox. Postfix/Sendmail can do this to, but procmail/maildrop allow you to apply all sort of delivery rules. For example, I sort mail into various subfolders at the server level rather than setting up rules in Outlook or similar.

However, mail clients like Evolution, Outlook, etc, need a server to read mailboxes and deliver the mail to the client. Various protocols exist, two of the most common are POP3 (which is probably how you would connect to you ISP with a mail client now) and IMAP. With POP you typically download the mail, and the client stores it (think about Outlook using .pst files for example), whereas with IMAP, you leave the mail on the server and simply read it with the client. I prefer the latter, because I can read all my mails from any machine on the network, back up mail easily and use utilities like squirrelmail as a web mail client.

So what you will need is and MTA (you say you have Sendmail already, although from my brief experience with it it's way less intuitive to configure than Postfix) and an IMAP and/or POP server. I use Dovecot, and it serves both POP and IMAP. Both of these programs work pretty much out of the box with only minor config changes (domain names, etc.).

The nice thing about Postfix is that if/when you decide to add spam and virus checking, it's pretty simple. I recall Sendmail being rather more difficult, but then I know a lot more now than I did back then.

One utility to remember is something called fetchmail. If you have a mail account with you ISP, fetchmail can grap it (usung POP3) and put it into your mail system via port 25 for delivery.

On the MX side, I'm no expert, but hopefully whatever name server you are using to serve your domain name should have an option to set up a mailserver record (basically a user friendly way to enter the necessary MX record(s).

If you are interested, have a look at www.postfix.org, there are plenty of howtos for any number of setups, from the most basic, to ldap authentication, virus checking, spam, the works.

Good luck

MrSako 07-25-2006 01:13 PM

just out of curiosty, is there a reason i should choose postfix over qmail? right now i have my eyes set on qmail but it seems the two repliers both use postfix

MrSako 07-25-2006 02:13 PM

i think im going to use postifx

so ill need postfix, maildrop, and dovecot?

MrSako 07-25-2006 02:56 PM

right now i have dovecot and postfix installed. but not working and i can't figure out why.

i have the user admin on my system and when i try to email him from a different email (like my ISPs email i have) i just get a "returned mail: see transcrift for details" thing sent back to me. and i can't figure out why

MrSako 07-25-2006 03:38 PM

i think the problem now is my BIND DNS record isnt setup right :/

billymayday 07-25-2006 04:14 PM

In response to your question of why Postfix over Qmail, in my case the answer was simple - Fedora comes packaged with Sendmail and Postfix, so when I wanted to change from Sendmail, it was already there. Not a great reason, but to be honest, I like Postfix. Doesn't mean I wouldn't like Qmail.


I think this is one of those questions like "whish distro". It all depends on who you ask, and at the end of the day, I'm sure all the maor MTA's are very good.

billymayday 07-25-2006 04:17 PM

On the issue of Postfix/Dovecot not working, given the ease of setup, I'd suggest it's something fundamental (your idea of DNS may well be correct) that won't be fixed by changing MTA's.

Send the admin an email, and post the output from your maillog. It's generally a very informative file.


Rgds


Bill

MrSako 07-25-2006 05:07 PM

The original message was received at Tue, 25 Jul 2006 18:05:12 -0400 (EDT)
from cpe-024-163-113-048.nc.res.rr.com [24.163.113.48]

----- The following addresses had permanent fatal errors -----
<admin@mydomain.com>

----- Transcript of session follows -----
550 5.1.2 <admin@mydomain.com>... Host unknown (Name server: mail.mydomain.com.: host not found)



Reporting-MTA: dns; ms-smtp-02.southeast.rr.com
Received-From-MTA: DNS; cpe-024-163-113-048.nc.res.rr.com
Arrival-Date: Tue, 25 Jul 2006 18:05:12 -0400 (EDT)

Final-Recipient: RFC822; admin@mydomain.com
Action: failed
Status: 5.1.2
Remote-MTA: DNS; mail.mydomain.com
Last-Attempt-Date: Tue, 25 Jul 2006 18:05:13 -0400 (EDT)



Return-Path: <klinerr1@nc.rr.com>
Received: from [192.168.0.101] (cpe-024-163-113-048.nc.res.rr.com [24.163.113.48])
by ms-smtp-02.southeast.rr.com (8.13.6/8.13.6) with ESMTP id k6PM5Cfp023186
for <admin@mydomain.com>; Tue, 25 Jul 2006 18:05:12 -0400 (EDT)
Message-ID: <44C69599.9070902@nc.rr.com>
Date: Tue, 25 Jul 2006 18:05:13 -0400
From: Daniel Strong <klinerr1@nc.rr.com>
User-Agent: Thunderbird 1.5.0.4 (Windows/20060516)
MIME-Version: 1.0
To: admin@mydomain.com
Subject: test
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: Symantec AntiVirus Scan Engine



as before i replaced my actualy domain name with mydomain.com so this wont show up on google

billymayday 07-25-2006 06:45 PM

As a test fix, try putting a line into our hosts file

123.234.345.456 mail.mydomain.com mydomain.com

where 123.234.345.456 is the IP of you admin's machine - mydomain.com


If that works, start working on the DNS problem.

Quick question - whta nameserver are you using to resolve names on/for your machine?

JimBass 07-25-2006 08:44 PM

Qmail is rock solid. The http://qmailrocks.org mentioned twice above is worth it's weight in gold, particularly for someone new to linux, as it walks you through everything (maildrop, spamassassin, clamav, squirrelmail) step by step, with exact commands to issue to the server. I have nothing against postfix or sendmail, but as a newbie, you'll probably have a much easier time with the qmailrocks way of doing things.

As to the DNS issue, you most certainly have a problem with it. If DNS was working and the mailserver wasn't, you'd get a refused message, or a message that it sat in the queue too long and ddelivery failed. The message you get is:
Quote:

Host unknown (Name server: mail.mydomain.com.: host not found)
That means either -
1) You don't have a MX record for mydomain.com
2) You don't have DNS delegated for mydomain.com
3) You don't own mydomain.com

I've been on the BIND (Berkely Internet Name Daemon, DNS) mailing list for a long time, and something that happens all the time is somebody will post with a problem, and do exactly what you did, which is to hide the domain name. By doing that, you make it difficult for anyone to help you. Giving out the domain name isn't going to cause problems. If I knew that mydomain.com = abcdefg12345.org, then I could tell you exactly what was happening on the DNS side.

So in any case, if you can't get the DNS straight on your own, post the real name and we can track that down in less than 30 seconds. As to the mail, do whatever works for you.

Peace,
JimBass

MrSako 07-25-2006 09:16 PM

ok, i fixed my DNS record, i even had someone on IRC look at it and approove of it.

i have postfix/dovecot running

i sent an email. i didnt get the email returned to me but it's not in any of my user's mailboxes

did it just get lost in cyberspace?

edit: btw my mail queue is empty also

JimBass 07-25-2006 09:20 PM

Look at the logs of your server. Does it have any mention of a connection from the server you sent it from?

Peace,
JimBass

billymayday 07-25-2006 09:29 PM

try again, and after 30 seconds or so, post

tail -20 /var/log/maillog

(assuming that's where your log is)


All times are GMT -5. The time now is 02:38 AM.