Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Servers > Setting up a mailserver on Fedora5

Forgot Password?
 Servers   Anything server related, Apache, MySQL, Samba, server security, sendmail, exim, etc

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 05-29-2006   #1 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Setting up a mailserver on Fedora5

Hi
I'm a bit of a noobe when it comes to *nix systems so here is my problem.
I've got a Fedora 5 setup as a web/ftp server and I would like to setup a mail server as well. I instaled Webmin for easy administration and I would like to use Squirllmail as a webmail client.
Now here's the thing I'm not clear on what I shuld do. For a mail server do I use Sendmail or Postfix or Dovecot? And when I tryed to setup sendmail I could not recive any emails, but I could send them. I enabled ports 25, 110 on the firewall but no users recived any mail.
By the way I would like to setup the mailserver to recive and send mail for multiple domains.
Anyway with Sendmail I tryed to add an alias and the domains into sendmail configuration.
So I tryed Dovecot but I got an error that userdb in dovecot.conf is invalid eventhow I setup userdb=passwd and passdb=PAM(or shuld I also use passwd). So dovecot didnot start.
Moveing on to Postfix and that's where it really stoped. I'm just stuck.
Anyway whitch one of these mail servers is would be best for my situation and how do I set it up.
And how is Squrllmail setup in Apache? How can I setup Apache so that insted of www.mydomain.com/webmail I can use webmail.mydomain.com(I can alter my DNS record so that is not an obsticle).

Thanks for your help.
Self-Defence is offline  



Reply With Quote
Old 05-30-2006   #2 (permalink)
Trusted Penguin
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,871
Wooo, not much wrong then. Ok, lets slow this down and take things one at a time. Before I start I should say I'm not much of a Postfix expert, but I dont think this is really your problem.

Dovecot first; it's not an MTA (mail transport agent - sendmail and postfix are mta's), its a mail server that lets you access your mail by pop3 or imap. You need a mail transport first, and drop Dovecot on the top to let you read your emails from elsewhere (you can read mail locally on the server without Dovecot, but if you want squirrelmail, it'll need such transports). If you're going to use Squirrelmail with Dovecot, I recommend using the imap features, but dont worry about that just yet, to get this all working, you need to configure things in order:

- MTA (sendmail or postfix)
- Dovecot (there are alternative mail servers, btw)
- Squirrelmail (for which you will need apache installed and working, but I think you've got that already).

It sounds like you've already had Sendmail working to a degree; as I'm only familiar with sendmail, I can only help with that (I'm sure someone else will pick up the postfix mailer if needed).

You configure sendmail with the M4 language - I'm sure you've done this already. If you're doing this through webmin, you can probably enter these options directly through that interface, but if not, create yourself an M4 file for your domain that looks a bit like this:

Code:
divert(0)
include(`../m4/cf.m4')
OSTYPE(`linux')dnl
define(`confDEF_USER_ID',``8:12'')dnl
define(`confDOMAIN_NAME',`<your_domain>')dnl
define(`ALIAS_FILE',`/etc/mail/aliases,/etc/mail/majordomo')dnl
define(`confPRIVACY_FLAGS',`authwarnings,needmailhelo,noexpn,novrfy')dnl
define(`confTO_QUEUERETURN',`4d')dnl
define(`confTO_QUEUEWARN',`4h')dnl
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
undefine(`UUCP_RELAY')dnl
undefine(`BITNET_RELAY')dnl
FEATURE(`redirect')dnl
FEATURE(`always_add_domain')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`local_procmail')dnl
dnl FEATURE(`relay_hosts_only')dnl
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')dnl
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')dnl
FEATURE(`access_db',`hash -T<TMPF> /etc/mail/access')dnl
FEATURE(`blacklist_recipients')dnl
FEATURE(dnsbl,`cbl.abuseat.org',` Mail from $&(client_addr) rejected: see http://cbl.abuseat.org')dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
You dont have to use the blacklist reciepients line if you dont want - I use real-time black holes to keep spam down; it's very effective. Dont forget to include your own domain name where I've indicated. I keep my m4 file in /usr/share/sendmail-cf/domain/' where I can compile it directly with 'm4 <mydomain>.m4 > sendmail.cf'

Next copy the sendmail.cf file to /etc/mail.

Edit /etc/mail/access to give any relaying access to machines on your LAN using their IP addresses - if you've a standalone machine this file should already contain localhost entries, so wouldn't need to be changed.

Edit your /etc/mail/aliases file to map email names to user names on the system, and /etc/mail/majordomo to mark out the special email accounts, then run 'newaliases'.

Edit /etc/mail/relay-domains to contain all the domains you want to relay mail for (i.e. your own domain).

Then it should be a simple matter of restarting sendmail (with 'service sendmail restart') and testing it.

Next up, set up Dovecot by editing its dovecot.conf; I found there was very little to change with the standard file - I think I changed only the directory name where the IMAP server stores it's mail in each user home directory. You can start Dovecot with 'service dovecot start'. Test your IMAP or POP3 connection with a regular mail reader such as evolution or kmail.

Run 'system-config-services' and make sure that dovecot and sendmail are started automatically in your default runlevel, and all should be well.

As far as getting squirrelmail to work goes, you'll have to follow the docs for that; I've only done it once, and that was a while ago. All I can say really is that if you're running it on an internet-based mail server, make sure you log into it using the SSL protocol (i.e. with https:// not http://) to keep your password encrypted.
__________________
Linux user #126863 - see http://counter.li.org/
Roxoff is offline   Reply With Quote
Old 05-31-2006   #3 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Ok thank you Roxoff for clearing that up. You see at my last job I only had to do with mail servers on MS platforms like Exchange, Kario, Merak..... So I had no idea that Postfix/Sendmail are just transfer agents and Dovecot is a mailserver.
It should make things alot easier.

I'm going to try to set up Sendmail and Dovecot this evening and report back if I have any rubble.
The Apache web server is up and running and so is squirllmail. But I'm still not sure how it is set up in apache. Curently it works www.domain.com/webmail. But I would like to know how squirllmail works so that I can confgure the web server to work lik webmail.domain.com.

Anyway thanks for your help for now.

Bye
Self-Defence is offline   Reply With Quote
Old 06-01-2006   #4 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Roxoff, I have a falowup question.

can I setup sendmail like this for multiple domains?
Code:
define(`confDOMAIN_NAME',`/etc/mail/myomains.list')dnl
insted of
Code:
define(`confDOMAIN_NAME',`<my_domain>')dnl
I tried set up sendmail like you said but no luck, localy I can send mail to user@localdomain.local but from the outside no, that's why I was wondering if I can do that like I wrote.

Thanks
Self-Defence is offline   Reply With Quote
Old 06-02-2006   #5 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Well I set it up, but it still doesn't work. I can send mail localy to any doman that I added to sendmail. But anything coming from outside gest lost someware. The mail I'm testing from also doesn't get any error message back. I'm stuck and don't know what to do.

Bye
Self-Defence is offline   Reply With Quote
Old 06-02-2006   #6 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Success!

I've done it. But not with Sendmail, but with Postfix. After a cuple of houers of playing around with Sendmail I finaly gave up and tryed Postfix again. And set up the hole thing up again and sent a test mail. It worked and it still does.

Thank you Roxoff for your help.

I'm still haveing truble with Dovecot. It just wount start. I always get this error :
Failed to start Dovecot :

Starting Dovecot Imap: Error: Error in configuration file /etc/dovecot.conf line 621: Unknown setting: userdb
[FAILED]

the Dovecot user database is set to /etc/passwd file whitch is aparently how it should be, but somehow it doesn't want to start.
Anyone have any ideas what the heck is wrong?

Thanks for the help.

Bye
Self-Defence is offline   Reply With Quote
Old 06-02-2006   #7 (permalink)
Trusted Penguin
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,871
Quote:
Originally Posted by Self-Defence
Roxoff, I have a falowup question.

can I setup sendmail like this for multiple domains?
Code:
define(`confDOMAIN_NAME',`/etc/mail/myomains.list')dnl
insted of
Code:
define(`confDOMAIN_NAME',`<my_domain>')dnl
I tried set up sendmail like you said but no luck, localy I can send mail to user@localdomain.local but from the outside no, that's why I was wondering if I can do that like I wrote.

Thanks
All you need to do for multiple domains is add:

Code:
MASQUERADE_AS(`domain_name')dnl
and set /etc/mail/domaintable to look like:

Code:
my_real_doman = my_masq_domain
make sure all your domains are listed in /etc/mail/relay-domains and that /etc/mail/local-host-names contains a list of all the hostnames your machine is identified as when working either in a masqueraded domain and a non-masqueraded domain.

Oh well, you fixed it now with Postfix, so it's no big deal.

As far as the dovecot issue goes, shouldn't the line in question read something like:

Code:
auth_userdb = passwd
__________________
Linux user #126863 - see http://counter.li.org/
Roxoff is offline   Reply With Quote
Old 06-02-2006   #8 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Nope

even
Code:
auth_userdb = passwd
dovecot woun't start. The same error pops up.

I have no idea what could be wrong.

Thanks Roxoff for your help, I'm going to try to setup Sendmail when I have time.
Self-Defence is offline   Reply With Quote
Old 06-02-2006   #9 (permalink)
Just Joined!
 
Join Date: Apr 2006
Location: Slovenia
Posts: 79
Success again!

all I had to do is to coment the lines with userdb and passdb. And Dovecot started right up. And Squirllmail also works fine but I'm not sure on how to set up Squrillmail or things so that when I use Squirl mail I can send my emails from something like this
name@domain1
name.surname@domain1
name@domain2
name.surname@domain2
and so on

But have absolutly no idea how to do this. On MS Exchange it was very simple and on Kario MailServer even simpler. But Fedora, Postfix, Dovecot and Squirllmaial ..... I need some help.

Any ideas anyone?

Thanks for all the help.
Self-Defence is offline   Reply With Quote
Old 06-02-2006   #10 (permalink)
Trusted Penguin
 
Roxoff's Avatar
 
Join Date: Aug 2005
Location: Nottingham, England
Posts: 2,871
Quote:
Originally Posted by Self-Defence
Success again!

all I had to do is to coment the lines with userdb and passdb. And Dovecot started right up. And Squirllmail also works fine but I'm not sure on how to set up Squrillmail or things so that when I use Squirl mail I can send my emails from something like this
name@domain1
name.surname@domain1
name@domain2
name.surname@domain2
and so on

But have absolutly no idea how to do this. On MS Exchange it was very simple and on Kario MailServer even simpler. But Fedora, Postfix, Dovecot and Squirllmaial ..... I need some help.

Any ideas anyone?

Thanks for all the help.
Well, changing the reply-to address inside squirrelmail is easy - just select 'Options' at the top of the page. Making that address work is another matter.

In Sendmail, you'd edit the /etc/mail/aliases file and add any aliases you like for your regular users, then run 'newaliases'. I've got no idea how to do this with Postfix.

Good luck!
__________________
Linux user #126863 - see http://counter.li.org/
Roxoff is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 05:11 PM.






© 2000 - - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.1