LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-24-2006, 08:05 PM   #1
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Rep: Reputation: 30
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
 
Old 07-24-2006, 10:56 PM   #2
cs-cam
Senior Member
 
Registered: May 2004
Location: Australia
Distribution: Gentoo
Posts: 3,544
Blog Entries: 4

Rep: Reputation: 57
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
 
Old 07-25-2006, 12:01 AM   #3
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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

Last edited by billymayday; 07-25-2006 at 12:06 AM.
 
Old 07-25-2006, 02:13 PM   #4
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
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
 
Old 07-25-2006, 03:13 PM   #5
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
i think im going to use postifx

so ill need postfix, maildrop, and dovecot?
 
Old 07-25-2006, 03:56 PM   #6
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
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
 
Old 07-25-2006, 04:38 PM   #7
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
i think the problem now is my BIND DNS record isnt setup right :/
 
Old 07-25-2006, 05:14 PM   #8
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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.
 
Old 07-25-2006, 05:17 PM   #9
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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
 
Old 07-25-2006, 06:07 PM   #10
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
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
 
Old 07-25-2006, 07:45 PM   #11
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
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?

Last edited by billymayday; 07-26-2006 at 12:36 AM.
 
Old 07-25-2006, 09:44 PM   #12
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

Rep: Reputation: 49
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
 
Old 07-25-2006, 10:16 PM   #13
MrSako
Member
 
Registered: May 2006
Distribution: CentOS 4.4
Posts: 185

Original Poster
Rep: Reputation: 30
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

Last edited by MrSako; 07-25-2006 at 10:18 PM.
 
Old 07-25-2006, 10:20 PM   #14
JimBass
Senior Member
 
Registered: Oct 2003
Location: New York City
Distribution: Debian Sid 2.6.32
Posts: 2,100

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

Peace,
JimBass
 
Old 07-25-2006, 10:29 PM   #15
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
try again, and after 30 seconds or so, post

tail -20 /var/log/maillog

(assuming that's where your log is)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Putting together my first Linux box, suggestions wanted Lazy Foo' Linux - Hardware 1 12-03-2005 02:41 AM
sendmail server mail box creation problems kjsubbu Linux - Networking 0 08-25-2003 06:47 AM
mail server behind linux box antken Linux - Networking 6 02-18-2003 03:07 PM


All times are GMT -5. The time now is 06:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration