NSLU2-Linux
view · edit · print · history

OpenSlug.MailServer History

Hide minor edits - Show changes to markup

September 01, 2007, at 12:12 AM by fcarolo -- undid spam
Changed lines 1-234 from:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

to:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.


This page is password protected.

The password is "mailserv". Let's see if that stops the automated wiki spam.

August 31, 2007, at 10:41 PM by Medved --
Changed lines 1-229 from:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

to:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

August 31, 2007, at 08:28 PM by fcarolo -- undid spam
Changed lines 1-229 from:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

to:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

August 31, 2007, at 06:27 PM by Medved --
Changed lines 1-229 from:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

to:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

August 31, 2007, at 02:13 PM by marceln -- Remove spam
Changed lines 1-229 from:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

to:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

August 31, 2007, at 02:07 PM by Medved --
August 31, 2007, at 09:45 AM by Medved --
Changed lines 1-229 from:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 > unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start

(I really do this 2 times)

 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 > ntpq -p 192.168.2.213

This should response with something like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 > cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 > /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 > saslpasswd2 cyrus

Postfix

 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 > saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

to:

<a href="http://revolution1848-1849.de ">Great sie</a> url:http://www.nslu2-linux.org/wiki/OpenSlug/MailServer?action=edit(2091721113):)</br></br>name:Medved</br>url:http://google.com</br>email:none@none.com</br>message:<a href="http://revolution1848-1849.de ">Great sie</a>

August 27, 2007, at 10:05 AM by morrijr -- Display instructions on a new line
Changed lines 5-6 from:

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find sth. lacking in this respect, insert a note or feed in your experience if you encounter something to add.

to:

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find somthing lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Changed lines 49-52 from:

ipkg install timezones_1.2.0-r1_armeb.ipk ipkg install timezones-europe_1.2.0-r1_armeb.ipk ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

to:
 > ipkg install timezones_1.2.0-r1_armeb.ipk
 > ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 > ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
Changed lines 55-56 from:

unset TZ

to:
 > unset TZ
Changed lines 62-66 from:

ipkg install ntpdate_4.2.0-r4_armeb.ipk update-rc.d ntpdate start 19 2 3 4 5 . /etc/init.d/ntpdate start /etc/init.d/ntpdate start

to:
 > ipkg install ntpdate_4.2.0-r4_armeb.ipk
 > update-rc.d ntpdate start 19 2 3 4 5 .
 > /etc/init.d/ntpdate start
 > /etc/init.d/ntpdate start
Changed lines 69-71 from:

ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk ipkg install ntp_4.2.0-r4_armeb.ipk

to:
 > ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 > ipkg install ntp_4.2.0-r4_armeb.ipk
Changed lines 74-77 from:

ntpq -p 192.168.2.213

This should response with sth. like:

to:
 > ntpq -p 192.168.2.213

This should response with something like:

Changed lines 87-88 from:

cat /etc/ntp.drift

to:
 > cat /etc/ntp.drift
Changed line 98 from:

Now what's wrong with it ?

to:

Now what's wrong with it?

Changed lines 101-102 from:

/etc/init.d/ntpd restart

to:
 > /etc/init.d/ntpd restart
Changed lines 108-113 from:

ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk ipkg install db3_3.2.9-r1_armeb.ipk ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

to:
 > ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install db3_3.2.9-r1_armeb.ipk
 > ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 > ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 > ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk
Changed lines 117-119 from:

saslpasswd2 cyrus

to:
 > saslpasswd2 cyrus
Changed lines 122-124 from:

ipkg install libpcre0_4.4-r1_armeb.ipk ipkg install postfix_2.0.20-r6_armeb.ipk

to:
 > ipkg install libpcre0_4.4-r1_armeb.ipk
 > ipkg install postfix_2.0.20-r6_armeb.ipk
Changed lines 127-130 from:

/etc/init.d/postfix stop

vi /etc/postfix/main.cf

to:
 > /etc/init.d/postfix stop
 > vi /etc/postfix/main.cf
Changed lines 155-157 from:

saslpasswd2 -c root

to:
 > saslpasswd2 -c root
August 26, 2007, at 05:00 AM by BrianZhou -- restore from spam
Changed lines 1-230 from:

<a href="http://revolution1848-1849.de ">Great sie</a>

to:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find sth. lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

ipkg install timezones_1.2.0-r1_armeb.ipk ipkg install timezones-europe_1.2.0-r1_armeb.ipk ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

ipkg install ntpdate_4.2.0-r4_armeb.ipk update-rc.d ntpdate start 19 2 3 4 5 . /etc/init.d/ntpdate start /etc/init.d/ntpdate start

(I really do this 2 times)

ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

ntpq -p 192.168.2.213

This should response with sth. like:

remote refid st t when poll reach delay offset jitter ==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735

LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

remote refid st t when poll reach delay offset jitter ============================================================================== www.unixsage.co 199.249.19.1 3 u 777 128 300 125.201 -0.859 56.616

  • LOCAL(0) LOCAL(0) 14 l 59 64 377 0.000 0.000 0.008

Now what's wrong with it ? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

/etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk ipkg install db3_3.2.9-r1_armeb.ipk ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

saslpasswd2 cyrus

Postfix

ipkg install libpcre0_4.4-r1_armeb.ipk ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

/etc/init.d/postfix stop

vi /etc/postfix/main.cf

Set

"mydomain=sample.com"

to whatever you call your domain internally. Then modify

"virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

"virtual_mailbox_base = /var/spool/vmail" "virtual_uid_maps = static:<XXX>" "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

"#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm

cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Spam 192.168.2.213> cm user.root.learnham 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

smtp inet n - n - - smtpd

to

smtp inet n - n - - smtpd -o content_filter=bogofilter

to activate bogofilter.

August 26, 2007, at 01:05 AM by Medved --
Changed lines 1-230 from:

Cyrus-IMAP storage based postfix installation.

About

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find sth. lacking in this respect, insert a note or feed in your experience if you encounter something to add.

Personally

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

  • IP
  • hostname
  • domainname
  • change root password

You should use

 turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 ipkg install timezones_1.2.0-r1_armeb.ipk
 ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

 unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

NTP

 ipkg install ntpdate_4.2.0-r4_armeb.ipk
 update-rc.d ntpdate start 19 2 3 4 5 .
 /etc/init.d/ntpdate start
 /etc/init.d/ntpdate start

(I really do this 2 times)

 ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

 ntpq -p 192.168.2.213

This should response with sth. like:

      remote           refid      st t when poll reach   delay   offset  jitter
 ==============================================================================
 *arg.cmm.ki.si   193.2.4.2        2 u  423  512   37   54.086    5.757   4.735
  LOCAL(0)        LOCAL(0)        14 l   33   64  377    0.000    0.000   0.008

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

 cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Here an example of a negative ntpq result:

      remote           refid      st t when poll reach   delay   offset  jitter
 ==============================================================================
  www.unixsage.co 199.249.19.1     3 u  777  128  300  125.201   -0.859  56.616
 *LOCAL(0)        LOCAL(0)        14 l   59   64  377    0.000    0.000   0.008

Now what's wrong with it ? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

Cyrus

 ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 ipkg install db3_3.2.9-r1_armeb.ipk
 ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
 ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

 saslpasswd2 cyrus

Postfix

 ipkg install libpcre0_4.4-r1_armeb.ipk
 ipkg install postfix_2.0.20-r6_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

 /etc/init.d/postfix stop

 vi /etc/postfix/main.cf

Set

 "mydomain=sample.com"

to whatever you call your domain internally. Then modify

 "virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

 "virtual_mailbox_base = /var/spool/vmail"
 "virtual_uid_maps = static:<XXX>"
 "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

 "#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

 saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

 cyradm

 cyradm> server -noauthenticate 192.168.2.213
 192.168.2.213> auth cyrus
 <enter the password you set above>
 192.168.2.213> cm user.root
 192.168.2.213> cm user.root.Drafts
 192.168.2.213> cm user.root.Outbox
 192.168.2.213> cm user.root.Sent
 192.168.2.213> cm user.root.Trash
 192.168.2.213> cm user.root.Spam
 192.168.2.213> cm user.root.learnham
 192.168.2.213> cm user.root.learnspam

Make information about the new account accessible for postfix

 vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

 root@sample.com  sample.com/root/

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

Now convert the file/update the db:

 postmap /etc/postfix/virtual

We all need postmaster

 vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

 postmaster@sample.com  root@sample.com

And convert:

 postmap /etc/postfix/virtual_alias

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

Eat that spam

Fire up your new mailserver:

 /etc/init.d/postfix start

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files. Bogofilter will not get fully configured (yet) and activated by the installation procedure.

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

 smtp      inet  n       -       n       -       -       smtpd

to

 smtp      inet  n       -       n       -       -       smtpd  -o content_filter=bogofilter

to activate bogofilter.

to:

<a href="http://revolution1848-1849.de ">Great sie</a>

November 27, 2005, at 08:46 PM by Brian Wood --
Added lines 207-209:

I discovered that /usr/bin/newaliases was a link to /usr/sbin/sendmail, which did not exist. I made it a link to /usr/sbin/sendmail.postfix (which does exist) and that seems to work (so far) Brian Wood

October 30, 2005, at 02:22 AM by ccsmart --
Changed lines 219-220 from:

After installation of the package, change a line in master.cf from

to:

After installation of the package you need to feed at least one message of ham (bogofilter -n) and one message of spam (bogofilter -s) and change a line in master.cf from

October 30, 2005, at 02:21 AM by ccsmart --
Added lines 218-227:

After installation of the package, change a line in master.cf from

 smtp      inet  n       -       n       -       -       smtpd

to

 smtp      inet  n       -       n       -       -       smtpd  -o content_filter=bogofilter

to activate bogofilter.

October 06, 2005, at 06:10 PM by ccsmart --
Added line 217:

Bogofilter will not get fully configured (yet) and activated by the installation procedure.

October 06, 2005, at 06:08 PM by ccsmart --
Added lines 212-216:

Bogofilter

Recently, bogofilter was added to the list of OpenSlug compatible packages. If you want to add it to the mix, install it after postfix so the installer can add some related entries to postfix configuration files.

October 06, 2005, at 06:03 PM by ccsmart --
Changed lines 5-6 from:

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on its content.

to:

This HOWTO is provided to ease the installation of a complete set of software turning the NSLU2 into a cheap mailserver for small groups (up to 50 users should be fine). It should give you the ability to install and configure the software without surprises. If you find sth. lacking in this respect, insert a note or feed in your experience if you encounter something to add.

September 16, 2005, at 07:10 PM by ccsmart --
Changed lines 175-178 from:
 192.168.2.213> cm user.root.LearnHam?
 192.168.2.213> cm user.root.LearnSpam?
to:
 192.168.2.213> cm user.root.learnham
 192.168.2.213> cm user.root.learnspam
September 16, 2005, at 07:09 PM by ccsmart --
Deleted line 173:
 192.168.2.213> cm user.root.Ham
Changed lines 175-176 from:
to:
 192.168.2.213> cm user.root.LearnHam?
 192.168.2.213> cm user.root.LearnSpam?
September 16, 2005, at 07:08 PM by ccsmart --
Changed lines 83-84 from:

With an offset no greater than, say about 20. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency towards 0.

to:

With an offset no greater than, say about 50. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency to figures around 0 to 5.

September 16, 2005, at 06:05 PM by ccsmart --
Changed line 110 from:
 ipkg install cyrus-sasl_2.1.19-r5_armeb.ipk
to:
 ipkg install cyrus-sasl_2.1.19-r6_armeb.ipk
Changed lines 123-124 from:
 ipkg install postfix_2.0.20-r3_armeb.ipk
to:
 ipkg install postfix_2.0.20-r6_armeb.ipk
Added line 132:
Added line 134:
Added line 136:
Added line 138:
Added line 140:
Added line 144:
Added line 146:
Added line 148:
Changed lines 186-190 from:

Now i hear you say: "You don't need to define this on the right side, just put anything there. 'X' would be enough.". So i answer: "Right man. But if i for whatever reason decide to go maildir, i'm all set with this."

to:

One could argue that it's not necessary to define this on the right side, just put anything there. 'X' would be enough. But if for whatever reason you'd decide to go maildir, you're all set with this.

September 10, 2005, at 11:51 AM by Phil Endecott -- it\'s<->its
Changed lines 5-6 from:

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.

to:

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on its content.

September 04, 2005, at 07:17 PM by ccsmart --
Changed lines 28-29 from:
  • remove directory /initrd (we'll make better use of RAM)
to:
August 16, 2005, at 06:16 PM by ccsmart --
Changed lines 54-55 from:

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell right now. This completely confuses the whole thing, so at least remove the variable from your current environment:

to:

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell. This completely confuses the whole thing, so at least remove the variable from your current environment:

August 10, 2005, at 06:18 PM by ccsmart --
Added line 27:
  • change root password
Changed lines 29-31 from:
  • change root password

Do this before turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root.

to:

You should use

 turnup init

for the configuration steps.

Do this before writing a root image to disk using turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root.

August 09, 2005, at 05:59 PM by ccsmart --
Changed lines 138-140 from:

Before starting postfix again, add at least one user and at least one alias, for the matter of good netizenship, we'll prepare some valuable ones.

to:

Before starting postfix again, add at least one user and at least one alias. For the matter of good netizenship, we'll prepare some valuable ones.

August 09, 2005, at 05:56 PM by ccsmart --
Changed lines 118-119 from:
 ipkg install postfix_2.0.20-r2_armeb.ipk
to:
 ipkg install postfix_2.0.20-r3_armeb.ipk
August 08, 2005, at 07:18 PM by ccsmart -- typo
Changed lines 94-95 from:

The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increases once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

to:

The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increased once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

August 08, 2005, at 07:17 PM by ccsmart -- Added info about TZ
Changed lines 48-54 from:
to:

Openslug comes with a default of setting the Posix TZ Variable for adjustment of timezone if it doesn't find /etc/localtime. This is the case for you, so right now you got two sets of timezone information applied to your shell right now. This completely confuses the whole thing, so at least remove the variable from your current environment:

 unset TZ

If you experience timewarps in /var/log/messages and they irritate you, reboot.

August 07, 2005, at 08:08 PM by ccsmart --
Changed lines 80-94 from:
to:

Here an example of a negative ntpq result:

      remote           refid      st t when poll reach   delay   offset  jitter
 ==============================================================================
  www.unixsage.co 199.249.19.1     3 u  777  128  300  125.201   -0.859  56.616
 *LOCAL(0)        LOCAL(0)        14 l   59   64  377    0.000    0.000   0.008

Now what's wrong with it ? The asterisk (*) pointing to the main timesource in use has stayed on LOCAL and the "when" (777) value of the timeserver ntpd decided to use out of pool.ntp.org is by far greater then the "poll" (128) value. This means that this timeserver is not being polled anymore since this is expected to be done asap after "when" (which is increases once a second) surpasses the "poll" value. Jitter and delay are relatively high. ntpd distrusts the reliability of this server as a timesource. Go and restart ntpd in this case:

 /etc/init.d/ntpd restart

and hope for a better timeserver (e.g., closer to you) to be chosen.

August 07, 2005, at 08:01 PM by ccsmart -- forgot to actually install postfix :)
Changed lines 98-99 from:
to:
 ipkg install postfix_2.0.20-r2_armeb.ipk
August 07, 2005, at 07:24 PM by tman --
Changed lines 9-10 from:

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

to:

You'll need basic Linux skills and know how to use vi (until somebody refines this to be more detailed).

Changed lines 18-19 from:

Flash your slug with a recent glibc based image of Openslug. For now, this means right from monotone, since the packages this is using are not in the official feeds yet.

to:

Flash your slug with a recent glibc based image of OpenSlug. For now, this means right from monotone, since the packages used are not in the official feeds yet.

August 07, 2005, at 05:00 PM by ccsmart -- oh, did i mention this is about c.....
Changed lines 30-31 from:

Do this before turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root.

to:

Do this before turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root.

Changed lines 35-38 from:

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

to:

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Changed lines 42-49 from:

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

ipkg install timezones_1.2.0-r1_armeb.ipk ipkg install timezones-europe_1.2.0-r1_armeb.ipk ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

to:

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

 ipkg install timezones_1.2.0-r1_armeb.ipk
 ipkg install timezones-europe_1.2.0-r1_armeb.ipk
 ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime
Changed lines 61-63 from:

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

to:

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

Changed lines 72-79 from:

With an offset no greater than, say about 20. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency towards 0. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

to:

With an offset no greater than, say about 20. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency towards 0. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

Changed lines 78-81 from:

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

to:

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Changed lines 90-92 from:

The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

to:

The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

Changed lines 99-101 from:

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down:

to:

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down (which don't need to do for changes later on, we just don't want to run it for the wrong domain now):

Changed lines 148-150 from:

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

to:

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

Changed lines 152-155 from:

Now i hear you say: "You don't need to define this on the right side, just put anything there. 'X' would be enough.". So i answer: "Right man. But if i for whatever reason decide to go maildir, i'm all set with this."

to:

Now i hear you say: "You don't need to define this on the right side, just put anything there. 'X' would be enough.". So i answer: "Right man. But if i for whatever reason decide to go maildir, i'm all set with this."

August 07, 2005, at 04:57 PM by ccsmart -- even more cosmetics
Changed lines 116-128 from:

Set "mydomain=sample.com" to whatever you call your domain internally. Then modify "virtual_mailbox_domains = sample.com, other.net" specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out "virtual_mailbox_base = /var/spool/vmail", "virtual_uid_maps = static:<XXX>" and "virtual_gid_maps = static:<XXX>" with a leading hash character # and remove the same from "#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp" to make it "virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp".

Before starting postfix again, add at least one user and at least one alias, for the matter of good netizenship, we'll prepare some valuable ones.

to:

Set

 "mydomain=sample.com"

to whatever you call your domain internally. Then modify

 "virtual_mailbox_domains = sample.com, other.net"

specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out

 "virtual_mailbox_base = /var/spool/vmail"
 "virtual_uid_maps = static:<XXX>"
 "virtual_gid_maps = static:<XXX>"

with a leading hash character # and remove the same from

 "#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp"

.

Before starting postfix again, add at least one user and at least one alias, for the matter of good netizenship, we'll prepare some valuable ones.

Changed lines 138-141 from:

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

to:

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

August 07, 2005, at 04:54 PM by ccsmart -- more cosmetics, why can't there be just one simpletext format *sigh*
Changed lines 5-6 from:
 This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.
to:

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.

Changed lines 9-10 from:
 You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).
to:

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

Changed lines 13-15 from:
 You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.
to:

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Changed lines 24-29 from:

- IP - hostname - domainname - remove directory /initrd (we'll make better use of RAM) - change root password

to:
  • IP
  • hostname
  • domainname
  • remove directory /initrd (we'll make better use of RAM)
  • change root password
August 07, 2005, at 04:52 PM by ccsmart -- cosmetics
Changed lines 3-12 from:

About

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.

Personally

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

to:

About

 This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.

Personally

 You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

Technically

 You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.
Changed lines 54-57 from:

ipkg install ntpdate_4.2.0-r4_armeb.ipk update-rc.d ntpdate start 19 2 3 4 5 . /etc/init.d/ntpdate start /etc/init.d/ntpdate start

to:
 ipkg install ntpdate_4.2.0-r4_armeb.ipk
 update-rc.d ntpdate start 19 2 3 4 5 .
 /etc/init.d/ntpdate start
 /etc/init.d/ntpdate start
Changed lines 61-63 from:

ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk ipkg install ntp_4.2.0-r4_armeb.ipk

to:
 ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk
 ipkg install ntp_4.2.0-r4_armeb.ipk
Changed lines 67-68 from:

ntpq -p 192.168.2.213

to:
 ntpq -p 192.168.2.213
Changed lines 71-75 from:
     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735 LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008
to:
      remote           refid      st t when poll reach   delay   offset  jitter
 ==============================================================================
 *arg.cmm.ki.si   193.2.4.2        2 u  423  512   37   54.086    5.757   4.735
  LOCAL(0)        LOCAL(0)        14 l   33   64  377    0.000    0.000   0.008
Changed lines 84-85 from:

cat /etc/ntp.drift

to:
 cat /etc/ntp.drift
Changed lines 92-97 from:

ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk ipkg install db3_3.2.9-r1_armeb.ipk ipkg install cyrus-sasl_2.1.19-r5_armeb.ipk ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

to:
 ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk
 ipkg install db3_3.2.9-r1_armeb.ipk
 ipkg install cyrus-sasl_2.1.19-r5_armeb.ipk
 ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk
 ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk
Changed lines 102-104 from:

saslpasswd2 cyrus

to:
 saslpasswd2 cyrus
Changed lines 107-108 from:

ipkg install libpcre0_4.4-r1_armeb.ipk

to:
 ipkg install libpcre0_4.4-r1_armeb.ipk
Changed lines 112-115 from:

/etc/init.d/postfix stop

vi /etc/postfix/main.cf

to:
 /etc/init.d/postfix stop

 vi /etc/postfix/main.cf
Changed lines 131-133 from:

saslpasswd2 -c root

to:
 saslpasswd2 -c root
Changed lines 140-152 from:

cyradm cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Ham 192.168.2.213> cm user.root.Spam

to:
 cyradm

 cyradm> server -noauthenticate 192.168.2.213
 192.168.2.213> auth cyrus
 <enter the password you set above>
 192.168.2.213> cm user.root
 192.168.2.213> cm user.root.Drafts
 192.168.2.213> cm user.root.Outbox
 192.168.2.213> cm user.root.Sent
 192.168.2.213> cm user.root.Trash
 192.168.2.213> cm user.root.Ham
 192.168.2.213> cm user.root.Spam
Changed lines 156-157 from:

vi /etc/postfix/virtual

to:
 vi /etc/postfix/virtual
Changed lines 161-162 from:

root@sample.com sample.com/root/

to:
 root@sample.com  sample.com/root/
Changed lines 169-171 from:

postmap /etc/postfix/virtual

to:
 postmap /etc/postfix/virtual
Changed lines 174-175 from:

vi /etc/postfix/virtual_alias

to:
 vi /etc/postfix/virtual_alias
Changed lines 178-179 from:

postmaster@sample.com root@sample.com

to:
 postmaster@sample.com  root@sample.com
Changed lines 182-184 from:

postmap /etc/postfix/virtual_alias

to:
 postmap /etc/postfix/virtual_alias
Changed line 189 from:

/etc/init.d/postfix start

to:
 /etc/init.d/postfix start
August 07, 2005, at 03:57 PM by ccsmart --
Changed lines 4-6 from:

This HOWTO is new, fresh and YOU are the one that corrects the mishaps in it and improves on it's conten.

to:

This HOWTO is new, fresh and YOU are the one taking part in correcting the mishaps in it and improving on it's content.

Changed lines 7-9 from:

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

to:

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

Changed lines 10-14 from:

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

to:

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Changed lines 15-22 from:

Flash your slug with a recent glibc based image of Openslug. For now, this means right from monotone, since the packages this is using are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

to:

Flash your slug with a recent glibc based image of Openslug. For now, this means right from monotone, since the packages this is using are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

August 07, 2005, at 03:55 PM by ccsmart --
Changed lines 1-2 from:

This is going to be an Cyrus-IMAP storage based postfix installation.

to:

Cyrus-IMAP storage based postfix installation.

August 07, 2005, at 03:54 PM by ccsmart --
Added lines 1-192:

This is going to be an Cyrus-IMAP storage based postfix installation.

About

This HOWTO is new, fresh and YOU are the one that corrects the mishaps in it and improves on it's conten.

Personally

You'll need basic linux skillz and know how to use vi (until somebody refines this to be more detailed).

Technically

You'll need a domain for which you want to use your mailserver and you need another box besides your slug (preferably linux that is) to verify ntp and configure your IMAP server.

Starting from scratch

Flash your slug with a recent glibc based image of Openslug. For now, this means right from monotone, since the packages this is using are not in the official feeds yet.

Connect a USB harddisk, since we will have continuous activity on this server writing logs, timestamps to databases et al. You can use a flashdisk, but the wear will be relatively high.

Configure the image with all basic settings, such as:

- IP - hostname - domainname - remove directory /initrd (we'll make better use of RAM) - change root password

Do this before turnup, because if your disk would fail for whatever reason and your slug reboots, you will be back on local flashdisk as root. This should be enough to get you on and yet safe to be connected to the net. Assume you'd have the default root password of Openslug and your ssh port open to the net...

Reboot to check everything applies ok and use turnup to write your root image to disk. Reboot to start from root on disk.

Installation

Timezones

Install timezones and your local timezone database and set it by linking into /etc/localtime. Example:

ipkg install timezones_1.2.0-r1_armeb.ipk ipkg install timezones-europe_1.2.0-r1_armeb.ipk ln -s /usr/share/zoneinfo/Europe/Zurich /etc/localtime

NTP

ipkg install ntpdate_4.2.0-r4_armeb.ipk update-rc.d ntpdate start 19 2 3 4 5 . /etc/init.d/ntpdate start /etc/init.d/ntpdate start (I really do this 2 times)

ipkg install ntp-tickadj_4.2.0-r4_armeb.ipk ipkg install ntp_4.2.0-r4_armeb.ipk

Remotely verify your ntp server from another machine replacing the IP address in the example with the one of your slug:

ntpq -p 192.168.2.213

This should response with sth. like:

     remote           refid      st t when poll reach   delay   offset  jitter

==============================================================================

  • arg.cmm.ki.si 193.2.4.2 2 u 423 512 37 54.086 5.757 4.735 LOCAL(0) LOCAL(0) 14 l 33 64 377 0.000 0.000 0.008

With an offset no greater than, say about 20. The asterisk in front of that server may first be in line two, but should move to be in front of that server after a few minutes. Repeating the ntpq command later on (later on that is) offset should have a tendency towards 0. After one hour of continuous operation of ntpd we'll do another check (but meanwhile you may continue installation):

cat /etc/ntp.drift

This file will not exist before one hour of continuous operation of ntpd. The contents absolute value shall be no greater than 512.

Cyrus

ipkg install libcrypto0.9.7_0.9.7e-r1_armeb.ipk ipkg install db3_3.2.9-r1_armeb.ipk ipkg install cyrus-sasl_2.1.19-r5_armeb.ipk ipkg install libssl0.9.7_0.9.7e-r1_armeb.ipk ipkg install cyrus-imapd_2.2.12-r6_armeb.ipk

This will give you a readily configured and running IMAPD. The default admin user "cyrus" has a default password of "cyrus" set. You gonna change this NOW:

saslpasswd2 cyrus

Postfix

ipkg install libpcre0_4.4-r1_armeb.ipk

Now you've got an UP AND RUNNING mailserver. We want to change some config first, so shut it down:

/etc/init.d/postfix stop

vi /etc/postfix/main.cf

Set "mydomain=sample.com" to whatever you call your domain internally. Then modify "virtual_mailbox_domains = sample.com, other.net" specifying in a comma separated list your internal domain name, plus whatever domains you are going to serve additionally. Since we are going to use IMAP backend, comment out "virtual_mailbox_base = /var/spool/vmail", "virtual_uid_maps = static:<XXX>" and "virtual_gid_maps = static:<XXX>" with a leading hash character # and remove the same from "#virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp" to make it "virtual_transport = lmtp:unix:/var/lib/cyrus/socket/lmtp".

Before starting postfix again, add at least one user and at least one alias, for the matter of good netizenship, we'll prepare some valuable ones.

Create new user in SASL

saslpasswd2 -c root

Add mailbox storage in IMAPD

Use your administrative box to acccess your mailslug using cyrus administrator, intelligently replacing given samples with your actual IP adress:

cyradm cyradm> server -noauthenticate 192.168.2.213 192.168.2.213> auth cyrus <enter the password you set above> 192.168.2.213> cm user.root 192.168.2.213> cm user.root.Drafts 192.168.2.213> cm user.root.Outbox 192.168.2.213> cm user.root.Sent 192.168.2.213> cm user.root.Trash 192.168.2.213> cm user.root.Ham 192.168.2.213> cm user.root.Spam

Make information about the new account accessible for postfix

vi /etc/postfix/virtual

Some time you won't need the docu in here anymore... so just delete it. Then add a line, intelligently replacing given samples with your actual domain:

root@sample.com sample.com/root/

Now i hear you say: "You don't need to define this on the right side, just put anything there. 'X' would be enough.". So i answer: "Right man. But if i for whatever reason decide to go maildir, i'm all set with this."

Now convert the file/update the db:

postmap /etc/postfix/virtual

We all need postmaster

vi /etc/postfix/virtual_alias

Add the line, intelligently replacing given samples with your actual domain:

postmaster@sample.com root@sample.com

And convert:

postmap /etc/postfix/virtual_alias

Eat that spam

Fire up your new mailserver:

/etc/init.d/postfix start

view · edit · print · history · Last edited by fcarolo.
Based on work by Medved, fcarolo, marceln, morrijr, BrianZhou, Brian Wood, ccsmart, Phil Endecott, and tman.
Originally by ccsmart.
Page last modified on September 01, 2007, at 12:12 AM