LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-15-2006, 07:15 AM   #1
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Rep: Reputation: 30
setting up a mail server: unable to recieve mail


Wanting to learn more and being tired of looking for a free mail account that supports pop, I decided to see how I can set up my own mail server. I found I can register a domain for free at dyndns.com, and I did. Now I'm trying to figure out what I have to do. I played a little with kmail, and tested everything with my yahoo account. I can send mail from my computer, but it seems that I can not recieve it. The message from the yahoo account seems to be correctly sent, I did not recieve any error messages or anything.

So, my questions are:

1) Where are remotely recieved messages stored by default?
2) Are messages automatically stored? Theoretically, everyone could send anything, and that is quite a security issue... How is it checked?
3) What else do I need to set up?

Sorry if these are newbie questions, but I am trying to learn more. The howtos are generally for big servers with many accounts. All I want is to set up one account.

Thanks for reading this. Any help or info is welcomed.

EDIT: Hmm, while looking around my computer, I found this in the firewall log file:
Quote:
Sep 15 14:54:41 linux kernel: SFW2-INext-DROP-DEFLT IN=eth0 OUT= MAC=00:04:61:55:0b:35:00:13:11:e9:b4:74:08:00 SRC=68.142.200.151 DST={my ip} LEN=44 TOS=0x00 PREC=0x00 TTL=54 ID=21739 DF PROTO=TCP SPT=24916 DPT=25 WINDOW=65535 RES=0x00 SYN URGP=0 OPT (020405B4)
Running a whois on 68.142.200.151, it seems to be a yahoo server... so... I guess that meens that my firewall is blocking the mail, right?

Last edited by Valkyrie_of_valhalla; 09-15-2006 at 08:02 AM.
 
Old 09-15-2006, 08:17 AM   #2
lior.okman
LQ Newbie
 
Registered: Sep 2006
Distribution: Debian GNU/Linux
Posts: 9

Rep: Reputation: 0
Mail server setup

Hi,

A mail server is a combination of two different types of software:

1. An SMTP server for receiving mail and forwarding it onwards (relay) or delivering it to the final recipient. This part is called a Mail Transfer Agent (MTA).
2. A POP or IMAP server for allowing a user to retrieve mail to a mail handling program (an MUA or Mail User Agent).

An example of MTAs are qmail, postfix, exim or sendmail, while an example of MUAs are kmail, evolution or thunderbird. POP or IMAP servers are cyrus, dovecot or courier.

In order to have your own mail server, you need to setup your local MTA to accept mail for your domain. By default, MTAs are usually setup to handle local mail only. That means that you will be able to recieve mail sent via the SMTP server directly to an existing user on your own machine.

Most distros usually have a firewall in place that prevents external connections to the SMTP port (tcp/25), so if you want to handle mail from outside your LAN, you need to make sure that the relevant port is open on your firewall.

Most MTAs are usually configured to refuse relays. This means, that you will not be able to send any non-local mail from your SMTP server. This is done as an attempt to prevent spammers from using your computer as an open relay to spamming their victims. Most MTAs can be configured to allow external relays only after the sender has authenticated to the MTA.

If you want to be able to use an MUA like kmail or thunderbird to read your mail, you need to expose the mail via a POP or IMAP server. For home use, I recommend the dovecot IMAP server - it's pretty easy to setup, and it's relativly fast. You should read up on the differences between POP and IMAP, and choose which protocol you prefer.

Regarding your questions:
Quote:
1) Where are remotely recieved messages stored by default?
2) Are messages automatically stored? Theoretically, everyone could send anything, and that is quite a security issue... How is it checked?
3) What else do I need to set up?
1. There are a few possibilities. The first, most common, is /var/spool/mail/<username> and the second most common is /home/<user>/Maildir . The differences are that the first uses the mbox file standard, and the second uses Maildir. Each method has it's pros and cons, but generally Maildir is considered better because it's easier to read and write. Of course, you can set it up any way you want with most MTA software.
2. Messages to local users are automatically stored until you run out of disk space. Most MTAs limit the size of a single mail message, and some MTAs support quotas on mail boxes. You should also install an antivirus mail filter like CLAMAV and a spam filter like spamassasin for best effects.
3. See above.


Hope this helped.
Lior
 
Old 09-15-2006, 10:12 AM   #3
Valkyrie_of_valhalla
Member
 
Registered: Jan 2006
Location: Romania
Distribution: Suse 12.0, Slackware 12.1, Debian, Ubuntu, Gentoo
Posts: 301

Original Poster
Rep: Reputation: 30
Thank you very much. Yes, it was very helpful. I learned a lot of things.

But still, I couldn't make it work. The only thing I could do right is installing clamAV.

I use sendmail to send messages and, as I said, this seems to work ok. I also use kmail. And I tried to see what dovecot does, but I don't know exactly how to configure it, I'm still working on it.

I have another set of questions:
1) If sendmail is configured to work only with local messages, then it shouldn't be able to send messages to @yahoo.com either, right? Well, it can, but it just can't recieve... How do I check it's configuration?
2) Trying to find the config file for sendmail, I saw in /etc this file called mail.rc that contains:
Quote:
set asksub append dot save crt=20
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via
What is this config file for?
3) Port 25 is opened, and from a nmap scan, it says:
Quote:
25/tcp open smtp Postfix smtpd
That should be correct, right?
At the suse firewall in yast, I configured it so it accepts the mail server, pop3 and imap protocols.
So why does it keep rejecting those mails? (By the way, yahoo is very insistent, it tried to send the messages over 20 times by now )
4) Can I also access this mailbox remotely? If so, can I deactivate this?

If anyone can answer any of this questions, any info is welcomed. Thanks
 
Old 09-15-2006, 02:29 PM   #4
dambla
Member
 
Registered: Aug 2006
Posts: 51

Rep: Reputation: 15
qmail works with both smpt and pop3 out of the box. try www.qmailrocks.org for a step by step tutorial.
 
  


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
can send and recieve local mail, but not mail from internet Caine101022 Linux - Software 2 09-09-2005 02:35 PM
Why can't my Apache/Linux server recieve e-mail? chellycat Linux - Software 5 05-16-2005 02:01 AM
wierd RH8 mail problem, unable to send but able to recieve f1uke Linux - Newbie 15 04-12-2003 05:19 PM
How to recieve mail without third party mail server marsonist Linux - Networking 7 09-06-2002 06:03 PM
I can recieve mail (outlook) but i cant send mail hal_baumgardner Linux - Networking 4 07-13-2001 09:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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
Open Source Consulting | Domain Registration