Imap installation

Discussion related to network/web services such as Apache, BIND Sendmail, etc.

Imap installation

Postby dpalme » 15 Nov 2009, 00:30

I was considering installing squirrelmail for a browser mail client, but it appears that I will need to ensure that imap is up and running. Since I have never worked with imap before, is there a specific port that I should be using? I was assuming that it is similar to installing apache, etc.

If I am wrong, some direction would be greatly appreciated.

Douglas
dpalme
Member
 
Posts: 197
Joined: 21 Nov 2008, 00:51

Postby DutchDaemon » 15 Nov 2009, 00:54

There are several IMAP servers in the ports tree. To name a few:
[port]mail/dovecot[/port]
[port]mail/cyrus-imapd23[/port]
[port]mail/courier-imap[/port]
[port]mail/imap-uw[/port]

I'm sure each has a following .. I like Dovecot myself. Setting it up is not unlike any other server (like Apache). You decide where it should run (localhost (127.0.0.1:143) would be sufficient for Squirrelmail or Roundcube ([port]mail/roundcube[/port])). The configuration file will usually end up in [file]/usr/local/etc/[/file] of [file]/usr/local/etc/$portname[/file]. It shouldn't be too hard to figure out, whichever IMAP port you decide to use. Most will have sensible defaults (a huge number of them even) that you can leave alone, only telling them what IP to listen on.

E.g. Dovecot:

Code: Select all
protocols = imap
protocol imap {
        listen = 127.0.0.1:143
}


Tell Squirrelmail to use 127.0.0.1:143 as well, and you should be off for the most part.
User avatar
DutchDaemon
Old Fart
 
Posts: 10463
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby dennylin93 » 15 Nov 2009, 01:02

There are lots of IMAP software available. Just pick one of them. There's [port]mail/dovecot[/port], [port]mail/cyrus-imapd23[/port], [port]mail/courier-imap[/port], and [port]mail/imap-uw[/port]. Personally, I prefer Dovecot.
dennylin93
Member
 
Posts: 784
Joined: 11 Dec 2008, 13:13

Postby DutchDaemon » 15 Nov 2009, 01:08

It's like I have a twin!

</letterman>
User avatar
DutchDaemon
Old Fart
 
Posts: 10463
Joined: 16 Nov 2008, 20:17
Location: The Netherlands

Postby dpalme » 15 Nov 2009, 05:41

Once I have dovecot installed, how do I determine if it is in fact up and running?
dpalme
Member
 
Posts: 197
Joined: 21 Nov 2008, 00:51

Postby dennylin93 » 15 Nov 2009, 06:04

Did you start it yet? If not, put [file]dovecot_enable="YES"[/file] in [file]/etc/rc.conf[/file] and run [cmd=#]/usr/local/etc/rc.d/dovecot start[/cmd]. The config file is located at [file]/usr/local/etc/dovecot.conf[/file].

After that [cmd=#]sockstat -46l[/cmd] should show the ports that Dovecot is using.
dennylin93
Member
 
Posts: 784
Joined: 11 Dec 2008, 13:13

Postby dpalme » 15 Nov 2009, 06:13

Ok we have a problem. When I try to run the start command I get the following error:

Code: Select all
64-150-176-124# /usr/local/etc/rc.d/dovecot start
Error: ssl_cert_file: Can't use /etc/ssl/certs/dovecot.pem: No such file or directory
Fatal: Invalid configuration in /usr/local/etc/dovecot.conf
Error: ssl_cert_file: Can't use /etc/ssl/certs/dovecot.pem: No such file or directory
Fatal: Invalid configuration in /usr/local/etc/dovecot.conf
Error: ssl_cert_file: Can't use /etc/ssl/certs/dovecot.pem: No such file or directory
Fatal: Invalid configuration in /usr/local/etc/dovecot.conf
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...
install: -m: Invalid argument
64-150-176-124#


My config file looks like the following:

Code: Select all
rotocols = imap
   protocol imap {
     listen = 127.0.0.1:143
   }
dpalme
Member
 
Posts: 197
Joined: 21 Nov 2008, 00:51

Postby dennylin93 » 15 Nov 2009, 06:44

SSL is enabled by default, so Dovecot will scream if the SSL certificate and key cannot be found. Try (should be around line 90):
Code: Select all
ssl = no


Modify the other parts of the config file as needed (default options are commented out). The Dovecot Wiki is a great place to start. There's also the Quick Configuration.
dennylin93
Member
 
Posts: 784
Joined: 11 Dec 2008, 13:13

Postby dpalme » 15 Nov 2009, 17:54

Ok I am getting close now....I think I have everything up and running as far as imap is concerned, and squirrelmail's configtest ran ok.

So I added an alias directive to the /usr/local/apache22/extra/httpd-vhosts.conf file as follows:

Code: Select all
Alias /webmail/ "/usr/local/www/squirrelmail/"
<Directory "/usr/local/www/squirrelmail">
    Options Indexes MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>


restarted apache, which was all fine. However, when I point to http://www.domain.com/webmail I get a 404 not found error.

Am I missing a step? I searched the squirrelmail site but did not find anything that seemed to apply.
dpalme
Member
 
Posts: 197
Joined: 21 Nov 2008, 00:51

Postby dpalme » 15 Nov 2009, 18:06

Nevermind I figured it out :)
dpalme
Member
 
Posts: 197
Joined: 21 Nov 2008, 00:51


Return to Web & Network Services

Who is online

Users browsing this forum: joint and 1 guest