[Dovecot] installing dovecot on Mac OS X
Hi,
I'm trying to install dovecot on Mac OS X, and I'm having trouble to make it run. If someone could point me to what I'm doing wrong or suggest some documentation to read, I'd be very glad (I've search the wiki for Mac OS X specific documentation, but could not find any).
I installed dovecot using darwinports. The version installed is 0.99.10.5. (It's running well enough to tell me that when I do a: sudo /opt/local/sbin/dovecot --version ;-)
Before trying to tweak the configuration file, I wanted first to get dovecot to run. When I first launched it, it told me that there was no dovecot user. After searching for a while, I finally found how to create one (and a dovecot group as well), doing the following:
sudo niutil -create / /groups/dovecot
sudo niutil -createprop / /groups/dovecot gid 300
sudo niutil -createprop / /groups/dovecot passwd '*'
sudo niutil -create / /users/dovecot
sudo niutil -createprop / /users/dovecot uid 300
sudo niutil -createprop / /users/dovecot gid 300
sudo niutil -createprop / /users/dovecot name dovecot
sudo niutil -createprop / /users/dovecot passwd '*'
sudo niutil -createprop / /users/dovecot _writers_passwd root
sudo niutil -createprop / /users/dovecot change 0
sudo niutil -createprop / /users/dovecot shell /dev/null
sudo niutil -createprop / /users/dovecot home /var/empty
sudo niutil -deleteprop / /users/dovecot realname
sudo niutil -createprop / /users/dovecot realname 'Dovecot user'
sudo niutil -createprop / /users/dovecot expire 0
This seems to create the correct thing, and looking in NetInfo it looks like the other users and groups used for daemons.
I then launched dovecot and I got (trying to run it as a normal user, then as root):
top% /opt/local/sbin/dovecot
Fatal: fchown() failed for /opt/local/var/run/dovecot: Operation not permitted
top% sudo /opt/local/sbin/dovecot
Warning: Corrected permissions for base directory /opt/local/var/run/dovecot
Warning: Corrected permissions for login directory /opt/local/var/run/dovecot/login
zsh: bus error sudo /opt/local/sbin/dovecot
and it seems that this happens every time I try to launch dovecot.
Could someone point me at what I'm doing wrong?
The setting I'm aiming for is the following:
- being able to read local mail in maildir format using mutt
- being able to read local mail using Mail.app and IMAP access
- being able to use ssh to connect to the machine and locally run the IMAP server (in order to synchronize mail maybe using isync.sf.net)
Thanks a lot,
Alan Schmitt
-- The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On 20.10.2004, at 17:13, Alan Schmitt wrote:
I installed dovecot using darwinports. The version installed is 0.99.10.5. (It's running well enough to tell me that when I do a: sudo /opt/local/sbin/dovecot --version
That's pretty old version.
Before trying to tweak the configuration file, I wanted first to get dovecot to run. When I first launched it, it told me that there was no dovecot user. After searching for a while, I finally found how to create one (and a dovecot group as well), doing the following:
sudo niutil -create / /groups/dovecot ..
Looks difficult, I think I just used the GUI tools :)
zsh: bus error sudo /opt/local/sbin/dovecot
Crashes for some reason. I'd suggest trying newer Dovecot version. I know the latest 1.0-tests work, although after configure you'll have to remove HAVE_MADVISE-line from config.h to avoid warnings about madvise() failures.
- Timo Sirainen (tss@iki.fi) wrote:
On 20.10.2004, at 17:13, Alan Schmitt wrote:
I installed dovecot using darwinports. The version installed is 0.99.10.5. (It's running well enough to tell me that when I do a: sudo /opt/local/sbin/dovecot --version
That's pretty old version.
The numbers looked close to the version announced on the front page, so I did not worry too much about this. (I just upgraded, as I explain below).
Before trying to tweak the configuration file, I wanted first to get dovecot to run. When I first launched it, it told me that there was no dovecot user. After searching for a while, I finally found how to create one (and a dovecot group as well), doing the following:
sudo niutil -create / /groups/dovecot ...
Looks difficult, I think I just used the GUI tools :)
Well, I just switched to Mac OS X (from Gentoo Linux), or rather I am in the process of switching. So I googled for the way to add a user, found these, and just used them (I did check in NetInfo that it was correct, though) ;-)
zsh: bus error sudo /opt/local/sbin/dovecot
Crashes for some reason. I'd suggest trying newer Dovecot version. I know the latest 1.0-tests work, although after configure you'll have to remove HAVE_MADVISE-line from config.h to avoid warnings about madvise() failures.
Thanks for the hints, I just did this and it works. Thanks a lot.
I have a couple other questions:
What authentification method would you recommend? OS X does not keep the users and passwords in /etc/passwd, so I'm using passwd-file method at the moment. I'm wondering how good a choice this is.
I would like to do the following (as described in http://mutt.sourceforge.net/imap/): <quote> 1.2.1.3. Using a tunnel to your IMAP server If you set the configuration variable tunnel, mutt will attempt to run it as a shell command and treat the process as a pipe to an IMAP server, instead of connecting through a normal network socket. Note that the hostname, port and SSL options are ignored when tunnel is set, they are used only to display the mailbox name.
Also note that your tunnel command has no way to interact with the terminal, so it can't, for example, ask you for a password. If you try to use an SSH tunnel with something like
set tunnel="ssh -q mailhost /usr/libexec/imapd"
you'd better make sure that you don't need a password, probably by using ssh-agent. Otherwise you are likely to get a "Broken pipe" error when SSH dies. </quote> however I could not find a imapd to call directly. Is this possible with dovecot?
I see that the maiboxes created under the Maildir directory are of the form .INBOX and .Sent. Could it be possible (maybe using namespaces, I have not really understood how they work) to store them without the leading dot?
Thanks again for helping me with this. I've been struggling with Imap servers for a couple days, and it's the first one I really get working (I'm only testing with mutt, as I'm sshing into the Mac, but I'll test with Mail.app next).
Alan Schmitt
-- The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On 20.10.2004, at 20:34, Alan Schmitt wrote:
- What authentification method would you recommend? OS X does not keep the users and passwords in /etc/passwd, so I'm using passwd-file method at the moment. I'm wondering how good a choice this is.
I think it does update /etc/passwd? At least my userid is there. You should be able to use PAM as passdb, and passwd as userdb.
- I would like to do the following (as described in http://mutt.sourceforge.net/imap/): <quote> 1.2.1.3. Using a tunnel to your IMAP server .. however I could not find a imapd to call directly. Is this possible with dovecot?
/usr/local/libexec/dovecot/imap
- I see that the maiboxes created under the Maildir directory are of the form .INBOX and .Sent. Could it be possible (maybe using namespaces, I have not really understood how they work) to store them without the leading dot?
Not yet. It's the Maildir++ standard. I may implement something else some day.
- Timo Sirainen (tss@iki.fi) wrote:
On 20.10.2004, at 20:34, Alan Schmitt wrote:
- What authentification method would you recommend? OS X does not keep the users and passwords in /etc/passwd, so I'm using passwd-file method at the moment. I'm wondering how good a choice this is.
I think it does update /etc/passwd? At least my userid is there. You should be able to use PAM as passdb, and passwd as userdb.
Unfortunately it does not seem to update it. I see very few things in /etc/passwd.
In fact, the header from the file says:
top% cat /etc/passwd
##
# User Database
#
# Note that this file is consulted when the system is running in single-user
# mode. At other times this information is handled by one or more of:
# lookupd DirectoryServices
# By default, lookupd gets information from NetInfo, so this file will
# not be consulted unless you have changed lookupd's configuration.
# This file is used while in single user mode.
#
# To use this file for normal authentication, you may enable it with
# /Applications/Utilities/Directory Access.
...
however I could not find a imapd to call directly. Is this possible with dovecot?
/usr/local/libexec/dovecot/imap
Great, thanks a lot.
- I see that the maiboxes created under the Maildir directory are of the form .INBOX and .Sent. Could it be possible (maybe using namespaces, I have not really understood how they work) to store them without the leading dot?
Not yet. It's the Maildir++ standard. I may implement something else some day.
OK, this is fine, thanks.
I have a question about procmail, but I'll ask it in another message.
Alan Schmitt
-- The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
On 20.10.2004, at 21:48, Alan Schmitt wrote:
# Note that this file is consulted when the system is running in single-user # mode. At other times this information is handled by one or more of: # lookupd DirectoryServices # By default, lookupd gets information from NetInfo, so this file will # not be consulted unless you have changed lookupd's configuration. # This file is used while in single user mode.
Actually userdb = passwd doesn't actually use /etc/passwd. It uses getpwent() function which apparently in OSX uses lookupd which uses Netinfo.
So, passdb = pam, userdb = passwd should work anyway :)
- Timo Sirainen (tss@iki.fi) wrote:
On 20.10.2004, at 21:48, Alan Schmitt wrote:
# Note that this file is consulted when the system is running in single-user # mode. At other times this information is handled by one or more of: # lookupd DirectoryServices # By default, lookupd gets information from NetInfo, so this file will # not be consulted unless you have changed lookupd's configuration. # This file is used while in single user mode.
Actually userdb = passwd doesn't actually use /etc/passwd. It uses getpwent() function which apparently in OSX uses lookupd which uses Netinfo.
So, passdb = pam, userdb = passwd should work anyway :)
I managed to make it work using the pam.d/imap that was installed by Postfix Enabler. The one suggested in the wiki does not work:
top% cat dovecot auth required pam_unix.so nullok account required pam_unix.so
but this one works:
top% cat imap # pop3, imap, smtp : auth account password session auth required pam_nologin.so auth sufficient pam_securityserver.so auth sufficient pam_unix.so auth required pam_deny.so account required pam_permit.so password required pam_deny.so session required pam_uwtmp.so
Thanks a lot.
Alan Schmitt
-- The hacker: someone who figured things out and made something cool happen. .O. ..O OOO
participants (2)
-
Alan Schmitt
-
Timo Sirainen