26334 total geeks with 3498 solutions
Recent challengers:
 Welcome, you are an anonymous user! [register] [login] Get a yourname@osix.net email address 

Articles

GEEK

User's box
Username:
Password:

Forgot password?
New account

Shoutbox
MaxMouse
It's Friday... That's good enough for me!
CodeX
non stop lolz here but thats soon to end thanks to uni, surely the rest of the world is going good?
stabat
how things are going guys? Here... boring...
CodeX
I must be going wrong on the password lengths then, as long as it was done on ECB
MaxMouse
lol... the key is in hex (MD5: of the string "doit" without the "'s) and is in lower case. Maybe i should have submitted this as a challenge!

Donate
Donate and help us fund new challenges
Donate!
Due Date: Jun 30
June Goal: $40.00
Gross: $0.00
Net Balance: $0.00
Left to go: $40.00
Contributors


News Feeds
The Register
Microsoft caves on
Xbox One DRM and
used-game controls
Kim Dotcom victim
of "largest data
MASSACRE in
history"
Google preps wave
of machine learning
apps
Reg to
Australia: Here"s
your chance to find
NBN answers
Microsoft breaks
bug-bounty
virginity in
$100,000 contest
Google"s JavaScript
challenger gains
better tools,
performance
Google joins
Amazon, HP,
Rackspace in easing
HDD data importing
Adobe CEO admits
need to "tweak"
Creative Suite"s
cloud-only policy
John McAfee
releases NSFW video
on how to uninstall
security code
Speaking in Tech:
We find someone who
hasn"t heard of
Prof Brian Cox
Slashdot
Microsoft Launches
$100k Bug Bounty
Program
The Plight of Star
Wars Droids
Java API and
Microsoft"s
.NET API: a
Comparison
MakerBot Merging
With Stratasys
Microsoft Kills
Xbox One Phone-Home
DRM
Billion-Pixel View
of Mars Snapped By
Curiosity
Deb Nicholson Talks
About the Open
Invention Network
(Video)
Five predictions
for (Bit)coin
Researchers Crack
iOS Mobile Hotspot
Passwords In Less
Than a Minute
U.S. House Wants
"Sustained Human
Presence On the
Moon and the
Surface of Mars"
Article viewer

Setting up Exim & Teapop on NetBSD 1.6.2



Written by:elybis
Published by:Nightscript
Published on:2004-02-06 01:54:19
Topic:BSD
Search OSI about BSD.More articles by elybis.
 viewed 12905 times send this article printer friendly

Digg this!
    Rate this article :
This small HowTo will show you how to set up a full-featured mail server on NetBSD 1.6.2 with Exim and Teapop. We will replace the default MTA on NetBSD, Sendmail with Exim from pkgsrc, configure it with smtp authentication and also install Teapop to provide POP3 access to our mails. Both server will be configured to authenticate local users not against the system password file, but a standalone mail authentication file based on the htpasswd format.

1. Who?

This document is (C) elybis <elybis@gmx.net>.


2. Prerequisites

I assume you have set up your NetBSD operating system correctly (including
internet access and the pkgsrc collection). If not, have a look at
http://www.netbsd.org/Documentation/ and follow the tutorials there.


3. Installing Exim

Execute the following commands as root.

Install Exim from pkgsrc:

cd /usr/pkgsrc/mail/exim
make install clean clean-depends

Backup the default mailer.conf:

cp /etc/mailer.conf /etc/mailer.conf.sendmail

Overwrite the default mailer.conf with the Exim mailer.conf:

cp /usr/pkg/share/examples/exim/mailer.conf /etc

Stop sendmail (if running in daemon mode):

/etc/rc.d/sendmail stop

Deactivate sendmail in rc.conf (if set as daemon):

vi /etc/rc.conf
delete the line 'sendmail=YES' if existant

Activate Exim in rc.conf:

echo "exim=YES" >> /etc/rc.conf

Change the Exim configuration to a basic working one:

vi /usr/pkg/etc/exim/configure

change the following lines according to your host/domain name:

primary_hostname = host.yourdomain.com
domainlist local_domains = yourdomain.com
qualify_domain = yourdomain.com
data = ${lookup{$local_part}lsearch{/etc/mail/aliases}}
(in the system_aliases section)

You should now have a basic working Exim configuration. Start your Exim with
the following command:

/usr/pkg/etc/rc.d/exim start

Exim should start without any problems. Now we have to create an authentication
file to use for smtp auth in Exim. As mentioned before we will create an
htpasswd compatible file:

cd /usr/pkg/etc/exim
htpasswd -c auth yourlocalusername
chown mail auth
chmod 600 auth

Next thing is to enable smtp authentication in Exim:

vi configure

go to the authenticators section (begin authenticators) and add the following
lines:

plain:
driver=plaintext
public_name=PLAIN
server_condition="
${if crypteq{$3}{
${lookup {$2}lsearch{/usr/pkg/etc/exim/auth}{$value}{failed}}}{yes}{no}}"
server_set_id = $2

login:
driver = plaintext
public_name = LOGIN
server_prompts = Username:: : Password::
server_condition="
${if crypteq{$2}{
${lookup {$1}lsearch{/usr/pkg/etc/exim/auth}{$value}{failed}}}{yes}{no}}"
server_set_id = $1

Whilst editing the configuration file, you can also set the local delivery
settings to allow Teapop access to the mail files later:

find the local_delivery section
add/change the following lines:

group = mail
mode = 0660

Restart Exim:

/usr/pkg/etc/rc.d/exim restart

Check if smtp auth is enabled:

telnet localhost 25
ehlo localhost

You should get a response like:
...
250-AUTH PLAIN LOGIN
...
This indicates that smtp authentication is active. Fine.


4. Installing Teapop

Still being su'd to root, execute the following commands.

Install Teapop from the pkgsrc collection:

cd /usr/pkgsrc/mail/teapop
make install clean clean-depends

Enable Teapop in rc.conf:

echo "teapop=YES" >> /etc/rc.conf

Configure Teapop:

vi /usr/pkg/etc/teapop.passwd

comment out ('#') every default line

add the following line to the end of the file:

default:*:htpasswd:/var/mail:Hgei5r36z:8:1002:/usr/pkg/etc/exim/auth:50:

Please note that '8' should be the uid of the 'mail' user and '1002' should be
the gid of the 'mail' group. You may have to change these. Also '50' sets
the maximum amount of entries that are read from the auth file. Change this to
a value higher than the number of users in your /usr/pkg/etc/exim/auth file.

Teapop is now configured as a fully functional POP3 server, authenticating
against /usr/pkg/etc/exim/auth and using /var/mail/username as the mail source
files.

Start Teapop:

/usr/pkg/etc/rc.d/teapop start

Check if Teapop works:

telnet localhost 110
USER yourlocalusername
PASS thepassyouspecifiedwhenusinghtpasswdthefirsttime

Teapop should respond with:
+OK I'm ready to serve you, Master.
after issuing the PASS command.

It seems like everything's working now! Congratulations. If you have any
comments/suggestions/corrections please send me an email to the address
mentioned above.

Did you like this article? There are hundreds more.

Comments:
think12
2004-02-06 12:23:07
Nice article, with minor path changes it could be ported to the other BSD's aswell.
Anonymously add a comment: (or register here)
(registration is really fast and we send you no spam)
BB Code is enabled.
Captcha Number:


Test Yourself: (why not try testing your skill on this subject? Clicking the link will start the test.)
BSD Basics by Obscurity

This will test your knowledge on the basics of Unix, and BSD.


     
Your Ad Here
 
Copyright Open Source Institute, 2006