delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/01/07/07:25:54

X-Recipient: archive-cygwin AT delorie DOT com
Resent-Message-ID: <20080107122459 DOT 4446 DOT qmail AT sourceware DOT org>
Message-ID: <4780C136.2010807@googlemail.com>
Date: Sun, 06 Jan 2008 12:53:26 +0100
Reply-To: the DOT spitting DOT bull AT googlemail DOT com
User-Agent: Thunderbird 2.0.0.9 (Windows/20071031)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: How I got UW-IMAP running on Windows XP
From: SpittingBull <the DOT spitting DOT bull AT gmail DOT com>
X-Reason: blocked: the DOT spitting DOT bull AT gmail DOT com 66.249.92.174 -> cygwin AT cygwin DOT com (global body, SA: score=-0.1 required=5.0 tests=PRESCANNED,BAYES_20,J_CHICKENPOX_66,SPF_PASS)
Resent-From: root AT sourceware DOT org
Resent-Date: Mon, 7 Jan 2008 12:24:59 +0000
Resent-To: cygwin AT cygwin DOT com
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Hi list!

Since this is my first post here I thought it might be kinda nice to
start with a tiny Cygwin success story.

Project: Establishing a neat IMAP server that can be used in Thunderbird 
as my central mail storage

Environment:
- Stand-alone Windows XP Pro SP 2
- Cygwin DLL version v1.5.24-2
- uw-imap packages: 2002e-3


First approach: Courier

The README.cygwin in the current Courier IMAP sources v4.3.0 made me 
think compiling Courier IMAP from scratch would be piece o'cake. Turns 
out that README.cygwin was kinda outdated. At the end of .configure 
(which took like 10 minutes) it simply says: you need Courier authlib first.

Tried to compile Courier authlib v0.60.2 two times with the exact same 
result: Zonelabs vsmon crashed during 'make' and Cygwin stopped 
responding. Figure that.


Second approach: uw-imap

Getting uw-imap to work isn't that big a deal. Make it following your 
orders is.

Hint list:

1. Windows XP and HOME
If you are running a stand-alone XP Cygwin seems to have a problem 
generating a proper HOME (your good if you're member of a domain). I 
installed Cygwin in C:\Programs\cygwin and my HOME was set to 
C:\Programs\cygwin\home.

I wanted my HOME to reside in my profile at C:\Documents and Settings. 
So a inserted the follwing command in cygwin.bat:

SET HOME=%HOMEDRIVE%%HOMEPATH%\cygwin

HOMEDRIVE and HOMEPATH are Windows XP user specific environment 
variables. Ah, and don't forget to create the sub-directory 
'C:\Documents and settings\<your profile>\cygwin'.


2. PATH
After I had a HOME I created a .bash_profile there with the following 
content:

#!/bin/bash
PATH="${PATH}":/usr/sbin:.

No magic here just convenience.


3. xinetd
I have a more or less solid Linux background soooo ... inetd stinks. 
Wanted xinetd. So here's the /etc/xinetd.d/imap config file you will 
need for uw-imap:

service imap
{
     socket_type        = stream
     wait            = no
     server            = /usr/sbin/uw-imapd
     user            = <your profile>
     protocol        = tcp
     disable            = no
}

Instead of <your profile> I used the name of my local user. Must be 
stored in /etc/passwd. I tried SYSTEM first but that didn't work: setuid 
- permission denied. I am sure there's a proper solution for this but 
since I'm the only user on my machine I am fine with as it is.


4. First test
I started xinetd in debug mode this way:

/usr/sbin/xinetd -d -filelog /var/log/xinetd.log

Then I launched Thunderbird and created an IMAP account. Bingo!


5. IMAP tricks
uw-imap created a directory 'Mail' in HOME after I created the IMAP 
account in Thunderbird. *BEFORE* I did anything else I opened the 
extended IMAP settings (Thunderbird: right-click IMAP account / 
settings) and set 'IMAP-Server-Directory' to 'Mail'. Attention: 
case-sensitivity!

What's that all good for? Well if you create a new folder for this 
account in your email client (i.e. Thunderbird) uw-imap will create a 
new MBOX in the Mail folder mentioned above instead of your HOME root.

Another thing in Server settings: uncheck everything regarding 'new 
messages'. uw-imap has a problem with INBOX. You will get a error (which 
is actually merely a warning) like: "SELECT failed: Can't open INBOX: 
not a selectable mailbox". I've googled for that issue. Let's just say: 
it's a known one.


6. Symlinks
You may want to add the following symlinks (if you plan to use say exim):

/var/mail pointing to your HOME/Mail and
/var/spool/mail pointing to /var/mail


7. Automizing it
I know there's more than one way to do that. Here's mine:

I created two scripts:

Windows XP: start-xinetd.bat

@echo off
echo Starting xinetd ...

SET HOME=%HOMEDRIVE%%HOMEPATH%\cygwin

C:
chdir C:\Programme\cygwin\bin

bash -l -c /usr/local/bin/startxi

echo xinetd started.


Cygwin: /usr/local/bin/startxi

#!/bin/bash
xinetd -filelog /var/log/xinetd.log

(don't forget to chmod +x /usr/local/bin/startxi  ;-)

start-xinetd will launch Cygwin, start xinetd as window process (check 
task manager) and terminate Cygwin / bash properly afterwards. You could 
include that script in Start / Programs / Autostart.


That's all so far. Do I have to say it? ... I love Cygwin!

Kind regards

Spitting Bull








--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019