# how to use uw-imap?

## oai79

I'm ashamed to ask this, but I just can't get imap to work.

I have emerged uw-imap. But when I telnet to port 143, the response is connection refused. Also, there's no sign that any process is listening at port 143, even after I manually typed command 'imapd'. Even this action has strange result: it will auto logout.

Does uw-imap (or imap) necessarily bound to inetd? All webpages I've searched starts imap through indet.

If not, what do I need to do to get imap to work?

----------

## kerframil

You can find out for sure if anything is listening on port 143 with

```
netstat -a
```

If it is listening but you can't gain access from other machines it might be because it is only accepting connections from localhost (127.0.0.1) by default. If nothing is showing up then I guess you should see if anything is being reported by your syslog after starting the service (if you're using metalog make sure you give it the signal to flush disk blocks instantly - there's a tip on that in the Gentoo Install docs). You can also try starting the daemon manually, in which case it should interactively give you debugging and diagnostic information which could help pinpoint the problem and most daemons let you set a debug level for increased verbosity. I used courier-imap and had no problems, but I cannot recall whether inetd came into it. In any case, I have xinetd installed on my server.

----------

## fyerk

I'd recommend installing xinetd and starting the IMAP daemon with that. After you install xinetd, re-emerge uw-imap and you should see the imap and imaps files in /etc/xinetd.d

```

# emerge xinetd

# emerge uw-imap

```

Make sure the imap (and optional imaps) file have a line that says disable = no.

Start the xinetd server

```

# /etc/init.d/xinetd start

```

Test to see if the imap server is running with netstat

```

# netstat -antp | egrep '143.*LISTEN'

tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      821/xinetd      

```

----------

## oai79

I'm just reluctant to emerge xinetd. I want my computer as clean as possible. And the way gentoo handles runlevel startup suits me. Why can't (or can it) uw-imap run like that?

I run imapd manually, but it is strange. The screen looks like this

```
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS AUTH=LOGIN] chiayi.csie.nctu.edu.tw IMAP4rev1 2001.315 at Wed, 27 Nov 2002 08:10:02 +0000 (UTC)

* BYE Autologout; idle for too long
```

and after a short time, it logs out. And during this period, no process is listening port 143. Is there any parameters I need to feed?

I can not find any information on imapd's command for interactively debugging and diagnostic. Can you point me a direction?

So, make a brief conclusion, uw-imap needs inetd (or xinetd) to run?

----------

## fyerk

 *oai79 wrote:*   

> I'm just reluctant to emerge xinetd. I want my computer as clean as possible. And the way gentoo handles runlevel startup suits me. Why can't (or can it) uw-imap run like that?
> 
> 

 

UW-IMAP is designed to be run from xinetd (or inetd, but xinetd is superior).

 *oai79 wrote:*   

> 
> 
> So, make a brief conclusion, uw-imap needs inetd (or xinetd) to run?

 

Yes, it needs xinetd to run.

----------

## col

This is how you set up uw-imap:

emerge xinetd

emerge uw-imap

nano /etc/xinetd.d/imap

change :

disable = yes 

to :

disable = no

/etc/init.d/xinetd restart

----------

## allen

I'm posting in this thread because my problem seems to have something in common with the original one. 

I've installed xinet (using emerge) and uw-imap (from own patched source).

I've done what I thought was necessary to install the imapd binary in the right place, and to put the imap configuration files into xinetd.d.

But when I try to access imap from a client, it seems that the imap service is not running.

There's no sign of anything listening on port 143 when I do netstat -a.

I can't check with telnet because telnetd is not available in Gentoo (?).

I've set xinet to log into a file in /var/log, but no log file has appeared.

I've restarted xinetd every time I make a change.

What can be wrong?

What should I look at next?

I've used uw-imap extensively in a more traditional setup (with inetd).

John

----------

## col

Also you need to edit:

nano /etc/xinetd.conf

       only_from      = localhost 192.168.0.0

and add the hosts that you would like to be able to access imap.

----------

## nitro322

I have uw-imap installed and working, but I'd like to enable ssl support for the pop3 daemon.  I see that I can enable imap over ssl by using /etc/xinet.d/imaps, but I can find no equivilant for pop3.  I also see that the uw-imap package installed a certificate for pop3 (/usr/ssl/certs/ipop3d.pem), but again, I see no way to use this.  How can I enable this?  Thanks.

----------

## chaos421

i didn't know where else to post this, so i'm adding it here...

in /etc/xinetd.conf, i am confused abou the "only_from" variable.  from what i understand, this variable lists ip addresses from which you can connect to the imap server.  i want to be able to connect to my imap server from anywhere... 

how can i modify this config file to be able to connect to my imap server from anywhere?

also... instead of modifying the "defaults" section, should i add a "service imap" like over at xinetd.org?

thanks,

/keith

----------

## cybercorty

You might consider using tcpserver instead of xinetd. Faster and smaller and from what people tell more secure than xinetd or inetd. emerge ucspi-tcp and have a look. You can easily write a startup script and integrate uw-imap into Gentoos init system.

Corty

----------

## chaos421

 *cybercorty wrote:*   

> You might consider using tcpserver instead of xinetd. Faster and smaller and from what people tell more secure than xinetd or inetd. emerge ucspi-tcp and have a look. You can easily write a startup script and integrate uw-imap into Gentoos init system.
> 
> Corty

 

thanks for the tip, but this doesn't help at all.  if you want to suggest a different form, at least include more of what you mean or a link... 

can anyone answer more specific questions about "only_from?"

----------

## col

 *chaos421 wrote:*   

> i didn't know where else to post this, so i'm adding it here...
> 
> in /etc/xinetd.conf, i am confused abou the "only_from" variable.  from what i understand, this variable lists ip addresses from which you can connect to the imap server.  i want to be able to connect to my imap server from anywhere... 
> 
> how can i modify this config file to be able to connect to my imap server from anywhere?
> ...

 

try only_from 0.0.0.0

----------

## skknight

 *col wrote:*   

>  *chaos421 wrote:*   i didn't know where else to post this, so i'm adding it here...
> 
> in /etc/xinetd.conf, i am confused abou the "only_from" variable.  from what i understand, this variable lists ip addresses from which you can connect to the imap server.  i want to be able to connect to my imap server from anywhere... 
> 
> how can i modify this config file to be able to connect to my imap server from anywhere?
> ...

 

As far as I understand this, that will only allow the IP address 0.0.0.0 to connect.

I deleted 

only_from

and retstarted xinetd and everything is working fine.

----------

## ekoontz

 *Quote:*   

> As far as I understand this, that will only allow the IP address 0.0.0.0 to connect. 

 

No, 	 *Quote:*   

> only_from      = 0.0.0.0

  will allow ANY host to connect, according to "man 5 xinetd.conf"[/quote]

----------

