thus Joachim Schipper spake:
On Sun, Jun 24, 2007 at 12:07:03AM +0100, Timo Schoeler wrote:
thus Firas Kraiem spake:
This is not really an OBSD-specific question but since the machine I
plan to do this on is running OBSD, I figured out I would post here,
please don't throw pointing objects at me ;)
So, here's the deal, I have a few machines behind a NAT gateway
(router/modem provided by my ISP) and I have a no-ip.org domain for
it - can't afford a "real" domain name at the moment. One of those is
an OpenBSD (4.1) system which I've been happily running an
Apache/PHP/MySQL and a FTP server on for a few months.
Now, what I would like to do, just for the fun and hopefully to learn
a few things in the process, is whether it would be possible to setup
a mail server on it so people can send me mail at [EMAIL PROTECTED],
and if so, I'd much appreciate if someone could point me to a few
nice tutorials to set this up - I've already googled for that and
tried a few howto's but without much success.
although this is not a typical topic for [EMAIL PROTECTED]
Well, it's called misc@ for a reason. It's also called [email protected]
for a reason, but this person uses OpenBSD, so why not?
Deep apologies from my side; however, the threshold of when a topic
starts to be a valid one here fluctuates extremely. one day, a
malfunctioning browser on a OBSD box is not a valid one, while on the
other day someone mailing from the highway who run out of gas (but has
OBSD running his home brew MP3 player) *is* a valid one...
first, you have to get yourself the skills to set up a MTA (mail
transfer agent) such as sendmail (included in OpenBSD base system), or
postfix (packages/ports), or exim...
IMHO, you should take 'the hard way' and learn sendmail
Everyone has his/her own preference here. There are no really wrong
choices, though. (At least not for simple setups.)
'IMHO'
second, you need a POP3 and/or IMAP4 server; there's a bunch of them
(packages/ports, again) like dovecot, cyrus, etc. for me, cyrus works
like a charm for many many years now
Again, no really wrong picks. Dovecot is secure, easy to configure, and
fast, but doesn't handle concurrent mailbox access very well, and you
might need/want some of the additional options of cyrus.
You can also do without an IMAP server if so inclined; particularly the
older *NIX mail clients will happily read their mail from a spool.
Especially if you prefer such a client, making sure the MTA is set up
properly before even trying to set up the IMAP server is a good idea.
Depending on tastes, you might also want to set up a webmail package. I
can recommend Hastymail for not sucking. (It's not particularly shiny or
full-featured, but it manages not to suck, at least to the extent that
webmail can not suck. Mutt still sucks less, though.)
third, you have to get some knowledge about the appropriate DNS entries
(the MX entry for your domain, even when using DynIP services) you have
to set. again, there's tutorials on the net.
Certainly. And note that this isn't going to work particularly well if
you switch IPs often (or at all).
The problem is that DNS updates take a while to reach every corner of
the internet (and very, very long to reach some broken MS-based setups).
If another user takes your IP address in the meanwhile, and that other
user also runs something on port 25, MTAs sending you mail will think
it's you. In almost all cases (those where no account has been
configured to collect all mail), the other mail server would permanently
reject mail to you, since there's no such user at that mail server. This
would cause random mail loss.
For this, one can use the mentioned VPS.
four, please take into account that sending from your own mail server
being in a dynamically assigned IP range is a bad idea because most RBLs
(realtime blackhole lists, used by other MTAs to check whether your MTA
is likely to be a spammer or not, etc) list those IP ranges as very
likely to be a spam source. so, if possible, use your ISPs mail server
for relaying (as a 'smart host' in sendmail speak), or get yourself a
machine at a rack hoster; there are decent priced 'virtual root servers'
nowadays. (unfortunately, most of them are Linux machines; virtual root
means that you're put into a container, or 'jail' like environment,
where you are root and can set up that machine as you like; however, you
don't have 'full control' over the hardware, but this is not needed
anyways.)
The whole virtual private server thing has the added advantage of having
a fixed IP address, which solves the problem I described above.
Exactly.
Unless you want to go for a VPS or some such, I'd not recommend running
an MTA on port 25. It *is*, however, quite useful to set up fetchmail or
one of the alternatives to feed mail to a MTA, and use that MTA to
handle outgoing mail.
It's doable without those hassles just by defining the MTA as the
primary MX which then is configured to relay incoming emails instantly
to your home machine. (It works, even using DynDNS services, even when
just reconnected on a new IP.)
Finally, a simple consideration: do check that your ISP does not block
port 25 incoming before starting this project. Quite a few do.
Those have to be avoided anyways.
Joachim
Timo :)