PDA

Bekijk de volledige versie : How to install and configure Dovecot?



The Joker
19-05-2007, 01:34
Hi,
i tried to install and configure Dovecot, but it doesn't work. Can somebody tell me how to write a config file for devecot? I want to use the wl500g as a imap server. So that one tool catches the mails from the servers and store it on the router in a MailDir folder-structure and an other tool (devecot) let me administrate the mails.
Can you explain me, how to config fetchmail/getmail to fetch the mails, too?


Thank you
Joker

grishka
19-05-2007, 09:28
/opt/etc/dovecot.conf

base_dir = /opt/var/run/dovecot
protocols = imap
ssl_disable = yes
disable_plaintext_auth = no
log_path =/opt/var/log/dovecot.log
info_log_path =/opt/var/log/dovecot.info
login_user = dovecot
login_process_size = 32
login_process_per_connection = yes
login_processes_count = 3
login_max_processes_count = 128
first_valid_uid = 500
last_valid_uid = 0
default_mail_env = maildir:/opt/home/%u/.maildir

auth default {
# Space separated list of wanted authentication mechanisms:
# plain digest-md5 cram-md5 apop anonymous
mechanisms = plain
passdb passwd-file {
args = /opt/etc/passwd.imap
}
userdb passwd-file {
args = /etc/passwd
}
user = nobody
}

/opt/etc/passwd.imap

#user:{plain}password
medved:{plain}PREVED

and add something like this to rc.local
/opt/etc/rc.local


#!/bin/sh
## ADDUSER !!!!!
adduser -S -D -H -h /opt/var/lib/dovecot/ -s /bin/false dovecot
adduser -S -D -H -h /opt/home/medved -s /opt/bin/bash medved
passwd -l dovecot
passwd -l medved

/opt/etc/init.d/S01rc.local

#!/bin/sh
/opt/etc/rc.local
all this works 4
http://ipkg.nslu2-linux.org/feeds/optware/oleg/cross/unstable/

but i prefer to use debian 4 mipsel in croot
http://wiki.wl500g.info/index.php/Debian%20Distribution

The Joker
19-05-2007, 14:54
Hi,
thank you very much for the config-files. But there is a little problem. When i try to start dovecot there is the following message:
"Error: Error in configuration file /opt/etc/dovecot.conf line 20: Unknown setting: args". I tried to solve it, but it doesn't work :(

Joker

grishka
19-05-2007, 19:24
fixed newline after mechanisms = plain
and you must know that getmail does not work well in unslug thres no maildrop procmail not toerant whith maildir
the best choie is to use debian chroot , i do so

The Joker
19-05-2007, 23:10
Hi,
it seems that the dovecot.conf file is now correct but dovecot doesn't start. the log-file /opt/var/log/docecot.log has the following entries:

dovecot: May 20 00:04:07 Error: Auth process died too early - shutting down
dovecot: May 20 00:04:07 Error: auth(default): Panic: Leaked file fd 7: dev 0.5 inode 5796
dovecot: May 20 00:04:07 Error: child 366 (auth) killed with signal 6

I deleted the file and wrote a new one, but it doesn't help.

What does it mean? A leaked file?
Oh god, why doesn't it work :-(

Joker

grishka
20-05-2007, 10:09
show your /opt/etc/ipkg.conf
can nobody read /opt/etc/passwd.imap

The Joker
20-05-2007, 20:18
Hi,
it seems that there is a problem with the /opt/etc/init.d/S01rc.local file. When i start/reboot the router, all files in /opt/etc/init.d were executed, but when i look in the /etc/passwd file there aren't new entries (dovecot & medved are missing). But there is a new file passwd- with the correct entries??? Why is there a file passwd- ? When i start the file (/opt/etc/init.d/S01rc.local), then there are the correct entries in the passwd file. It's crazy...

Ok. When i start the S01rc.local file manuell then there are the correct entries in the passwd file, but docevot doesn't start.

EDIT:
Ok, i tried to solve the problem, (but i'm a noob :-) .... and that's not good).

My dovecot.conf

base_dir = /opt/var/run/dovecot
protocols = imap pop3
ssl_disable = yes
disable_plaintext_auth = no
log_path =/opt/var/log/dovecot.log
info_log_path =/opt/var/log/dovecot.info
login_user = nobody
login_process_size = 32
login_process_per_connection = yes
login_processes_count = 3
login_max_processes_count = 128
first_valid_uid = 500
last_valid_uid = 0
default_mail_env = maildir:/opt/home/mailer/.maildir

auth default {
# Space separated list of wanted authentication mechanisms:
# plain digest-md5 cram-md5 apop anonymous
mechanisms = plain
passdb passwd-file {
args = /opt/etc/passwd.imap
}
userdb passwd-file {
args = /etc/passwd
}
user = admin
}

than i added the user mailer to the /opt/etc/passwd.imap like this
mailer:{plain}test

and i add manuell the user mailer with adduser mailer with an other passwort. like test2.
(manuell, not in the S01rc.local ... because the problem, i wrote on the top):

When i reboot the router now, it starts dovecot.... BUT.... when i try to connect to the pop3 server external it seems all fine. But until i wrote the password (and dovecot says that it is the correct password) the telnet session ends. Here it is:

Last login: Sun May 20 21:22:51 on ttyp2
Welcome to Darwin!
localhost:~ iLoveMyWl500g$ telnet 10.8.0.1 110
Trying 10.8.0.1...
Connected to localhost.
Escape character is '^]'.
+OK Dovecot ready.
USER mailer
+OK
PASS test
+OK Logged in.
Connection closed by foreign host.
localhost:~ iLoveMyWl500g$


Why stop the session? :-(

joker

grishka
20-05-2007, 21:02
thats strange :eek:

The Joker
20-05-2007, 23:09
:( ... right ... :(

May be it's better to use an other imap server? Like these :
cyrus-imapd - 2.2.12-13 - The Carnegie Mellon University Cyrus IMAP Server
imap - 2006h-2 - University of Washington IMAP package

Does they work? I tried to install one of them (i can't remember which one), but i could not config them. It seems that they ignore the parameters i set. What should i do? I want an imap server on the wl500gp :-(

grishka
21-05-2007, 06:24
better use debian chroot there work all
do all like in howto but whith etch not sarge
and :
/usr/local/sbin/post-boot

#!/bin/sh
# Start ssh server
#dropbear

# test if USB disc has been attached
# if not - then insert needed modules
if [ ! -d /dev/discs ]
then
insmod scsi_mod && insmod sd_mod && insmod usb-storage && sleep 5s
fi

# Wait for /opt to mount
mkdir -p /tmp/harddisk
mount /dev/discs/disc0/part1 /tmp/harddisk
swapon /dev/discs/disc0/part2
mount -o bind /dev /tmp/harddisk/debian/dev
chroot /tmp/harddisk/debian /rc.start


/tmp/harddisk/debian/etc/fstab

proc /proc proc defaults 0 0
procbususb /proc/bus/usb usbfs rw 0 0

/tmp/harddisk/debian/rc.start


#!/bin/sh
# mount Them all
mount /proc
mount -a
### Start RC system Yeahh!!! :)
/etc/init.d/rc 2

chroot //tmp/harddisk/debian
echo "deb ftp://mir1.ovh.net/debian stable main contrib non-free" >> /etc/apt/sources.list
echo "deb ftp://mir1.ovh.net/debian stable-proposed-updates main contrib non-free" >> /etc/apt/sources.list
apt-get update
apt-get -y upgrade
apt-get -y install dovecot-imapd exim4-daemon-light getmail4 maildrop bogofilter

http://gentoo-wiki.com/Maildrop_configuration

The Joker
21-05-2007, 12:58
Hi,
ok i try it with a debian chroot, but i'm working on a mac.


1 Steps on PC with Debian (sarge)

Create debian-distro directory on PC which will contain the distribution.
cdebootstrap -amipsel sarge debian-distro http://ftp.de.debian.org/debian
That will fail after a while leaving you with a skeleton.
Copy entire directory tree to the Asus harddisk, e.g. /tmp/harddisk/distributions/debian.

Is it possible to download a complete debian-distro for the wl500g? So that i copy the debian directory to the wl500g and conigure it like you wrote? Sorry but, i'm not a linux pro :-( ... hopefully in the future...

joker

grishka
21-05-2007, 14:09
:rolleyes: did you try to search forum for word 'debian'
PS 11f link :D