Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to use SquirrelMail and Require SSL for IMAP Service?

Hello,

Mac OS X Server v.10.4.9 – Open Directory Master
Providing POP, IMAP, SMTP, web services including webmail via SquirrelMail.
PHP v.4.4.4 Nov. 1, 2006
OpenSSL v.0.9.7l Sept. 2006

I need to require SSL for IMAP access, however, I also need to provide webmail access. SquirrelMail does support TSL it seems and that can be configured from /etc/squirrelmail/config/conf.pl and is discussed briefly here: http://www.squirrelmail.org/wiki/SquirrelMailIMAPS .

When I turn on TSL on SquirrelMail and change the IMAP port number to 993 attempting to log into SquirrelMail provides the following error:

Bad request: IMAP server does not appear to support the authentication method selected. Please contact your system administrator.

According to the above noted page from the SquirrelMail site one needs PHP 4.3 and SSLv3 in order for TSL to work, one must also connect to the IMAP server over port 993. Requirements I appear to meet.

So – how can one require the use of SSL for IMAP and still provide webmail access via SquirrelMail?


I have reviewed these three threads:

http://discussions.apple.com/thread.jspa?threadID=912841&tstart=75
http://discussions.apple.com/thread.jspa?messageID=1457773&#1457773
http://discussions.apple.com/thread.jspa?messageID=3921004&#3921004

However they do not answer the fundamental question of how to use SquirrelMail with SSL required by IMAP. Essentially the conversation revolves around working around the SSL requirement or forgoing it.

Thank you for any assistance.

PowerBook G4 12" 1.5GHz, Mac OS X (10.4.9)

Posted on Apr 25, 2007 1:53 PM

Reply
16 replies

Apr 25, 2007 2:31 PM in response to David Ensteness1

Hi David,

The links to the posts you list by Jeff and Alex summarize this issue.

Basically, on a normal set-up (where SquirrelMail is on the same server as Cyrus), all SquirrelMail communications with Cyrus are local (on the mail server only). For that reason, you don't need (nor, to my understanding, will SquirrelMail support) TSL in that sense. That is why SquirrelMail failed when you required it.

Unless your SquirrelMail installation is running on a different machine than your Cyrus installation this shouldn't be a problem.

You should set up SSL for the users connecting to Squirrelmail, but that is different than connecting from Squrrelmail to Postfix/Cyrus.

Apr 25, 2007 11:20 PM in response to Joel Mcintosh1

@Joel
I think the OP wants to "require" SSL (not "use"). In that case (although it makes no sense), he must enable TLS in SquirrelMail

@David
My recommendation would be to use, but not require SSL. Using Webmail, it is much more important that the user's browser connnection is secured with SSL, rather than SquirrelMail's IMAP connection wich is usually locall anyway.

However if you must/want/...:

The issue you are seeing is not a SquirrelMail, but a PHP issue. A bug in PHP, prevents the use of the OpenSSL module when built as shared. It must be built as static.

I don't know what your skill level is (no offense meant), so I don't know if you want to go down that road. More info is available here:
http://www.squirrelmail.org/docs/admin/admin-5.html#ss5.4
http://bugs.php.net/bug.php?id=29934
http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/72275

If you decide to go down that road, you may want to know what Apple's default PHP configuration looks like. See "Updating PHP on OS X Server" available here: http://osx.topicdesk.com/downloads/


HTH,
Alex

Apr 26, 2007 9:40 AM in response to pterobyte

@pterobyte

Yes that explanation regarding the PHP bug makes sense and thank you, answer understood.

For explanation:

Primarily my users do not use webmail, they use e-mail client software such as Mail. I wish to require those users to turn on SSL in their e-mail client software.

Yet from time to time these same users are in a circumstance where they need to use webmail, thus SquirrelMail needs to work. I am not trying to secure webmail by requiring SSL.

Thanks.

PowerBook G4 12" 1.5GHz Mac OS X (10.4.9)

Apr 26, 2007 11:07 AM in response to David Ensteness1

David,

Yet from time to time these same users are in a
circumstance where they need to use webmail, thus
SquirrelMail needs to work. I am not trying to
secure webmail by requiring SSL.


I see, your problem. In this particular case there is a workaround.

Use different ports for postfix and cyrus limited to localhost, thus catering only to SquirrelMail, thus not needing TLS.

Roughly do this (this is just off the top of my head, may contain errors):

For SMTP / Postfix:
Edit /etc/postfix/master.cf
and add:
465 inet n - n - - smtpd
-o smtpd recipientrestrictions= permit_mynetworks,reject
-o mynetworks=127.0.0.1/32
-o smtpd enforcetls=no
# This will create a port 465 (if you use this alreay pick another one. choose the number wisely, depending ony what is in use on your server)
# This port is only accessible to IP number in "mynetworks"


For IMAP / Cyrus
Edit /etc/cyrus.conf and add (below imap):
imaplocal cmd="imapd -C /etc/imapd-local.conf" listen="127.0.0.1:imap" prefork=0

Next duplicate /etc/imapd.conf and name it imapd-local.conf
Edit /etc/imapd-local.conf
Change
tls serveroptions: require
to
tls serveroptions: use

Next edit:
/etc/services
and create a port called "imaplocal"
(you could probably recycle 585 wich is deprecated, check what is in the services file, make sure no duplicate port numbers).
should look something like:
imaplocal 585/udp
imaplocal 585/tcp


When done with all config files:
Save & restart mail services

Point SquirrelMail to the new ports wich should only be accessible to localhost (check with an external client if it holds 🙂

Sorry for the "draft style" post, but I don't have much time.

Just ask, if anything isn't clear.

HTH,
Alex

Apr 29, 2007 2:04 AM in response to David_x

I think this previous thread covers what Jaydisk is
referring to...

Topic: Best Practice Mail Authentication not really
possible?
http://discussions.apple.com/message.jspa?messageID=16
70953


Yes this covers pretty much most scenarions.

The particular situation of the original poster, can however only be solved by additional ports and configuration files for cyrus.

How to use SquirrelMail and Require SSL for IMAP Service?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.