Getting squirrelmail working with cyrus imapd

Hey Guys.

i’m having trouble getting squirrelmail working on my opensuse 11.

i’m this far:
i have squirrelmail installed.
i can get email.
i can sent email.

the trouble i’m having is this:
squirrelmail "can’t create inbox.sent"error in left pannel.

at login a need to login twice, first time it doesn’t recognice the user/password.

i’m using:
Squirrelmail 1.4.16
Opensuse 11
Cyrus Imap

can anyone help ??

You could use dovecot instead of cyrus imap, much easier to configure and use.

Suggesting an alternative program isn’t really helping.

I’m having problems with Cyrus and Squirrelmail.
does anyone have a suggestion on how to fix that??

Why not? Going over to dovecot worked for me sometime back. Opinion I have read/heard is that dovecot is easier to deal with than cyrus imap. Anyway, good luck.

Am 23.11.2008 18:46 schrieb arnoldnijboer:
> i have squirrelmail installed.
> i can get email.
> i can sent email.
>
> the trouble i’m having is this:
> squirrelmail "can’t create inbox.sent"error in left pannel.
>
> at login a need to login twice, first time it doesn’t recognice the
> user/password.
>
>
> i’m using:
> Squirrelmail 1.4.16
> Opensuse 11
> Cyrus Imap

Works fine here, with almost the same software combination.
So it must be something with your specific configuration.
Why not share a few more details, such as:
Where are your passwords stored?
What’s your hierarchy separator set to?
What do the logs show when the problems you describe occur?
What are the Cyrus access rights on the Inbox in question?
Also, some simple tests:
What happens if you try create the “inbox.sent” folder on
SquirrelMail’s “Folder” page, or independently from
SquirrelMail via cyradm?

HTH
T.


Tilman Schmidt
Phoenix Software GmbH
Bonn, Germany

Thanks Tilman,

i had figured it out myself and just wanted to post the cure…
when i read you’re reply!

it was indeed the folder prefix. standard set to “.” and it needs to be “/”, and remember to also change the folder settings to INBOX/

the only question remaining:
i need to login twice before my user account is valid.

config of the posix / imap settings are done trough yast.

Hope you can help me?

Am 28.11.2008 17:46 schrieb arnoldnijboer:
> it was indeed the folder prefix. standard set to “.” and it needs to be
> “/”, and remember to also change the folder settings to INBOX/

Ah, good. Thanks for letting me and the forum know.

> the only question remaining:
> i need to login twice before my user account is valid.

Hm, not sure about that one. Can you describe your problem in
some more detail? When you type your username and password into
the SquirrelMail login form and click the Login button, what
happens next? Also, which messages, if any, appear in the
Apache, SquirrelMail and Cyrus logs when you do that?

> config of the posix / imap settings are done trough yast.

Sorry, I don’t use YaST for configuring my mailserver, so I
don’t know what kind of configuration YaST produces. Can you
post the actual configuration files?

HTH
T.

Well found 2 log files which refer to the action.
http://www.neo-hippie.net/var.log.apacheaccess
http://www.neo-hippie.net/var.log.messages

The apache log looks fine…
the other (overall system message log) looks like it’s trying to
validate multiple times, can’t figure out where the problem is.

a description of the problem:
when i go tho the website: http://webmail.arnoldnijboer.info (yes i know… soon coming with https :p)
i get the squirrelmail login screen.
then i type my username and password (i type it every time manual so there is no error in the keyring)
then it goes to the next page… it ads a dividing line (for the menu on the left but no menu is shown…)
and says password or username incorrect please try again, i click on the link an login again… and then it works fine and i get into the mailbox.

Kind regards
Arnold

arnoldnijboer schrieb:
> Well found 2 log files which refer to the action.
> http://www.neo-hippie.net/var.log.apacheaccess
> http://www.neo-hippie.net/var.log.messages
>
> The apache log looks fine…

There seems to be some kind of redirection going on, as the first
login attempt refers to the path “/src/redirect.php” and the
second one to “/webmail/src/redirect.php”. What does your Apache
VirtualHost configuration look like? Playing any tricks with
aliases? What happens if you enter the URL
http://webmail.arnoldnijboer.info/webmail/ into your browser
(ie. add the “/webmail” path prefix yourself)?

For comparison, this is what a successful login on one of my
SquirrelMail servers looks like in the Apache access log:

10.0.1.11 - - [04/Dec/2008:17:38:45 +0100] “POST /src/redirect.php HTTP/1.1” 302 -
10.0.1.11 - - [04/Dec/2008:17:38:46 +0100] “GET /src/webmail.php HTTP/1.1” 200 355
10.0.1.11 - - [04/Dec/2008:17:38:46 +0100] “GET /src/left_main.php HTTP/1.1” 200 13496
10.0.1.11 - - [04/Dec/2008:17:38:46 +0100] “GET /src/right_main.php HTTP/1.1” 200 29230

My VirtualHost has just a plain:

DocumentRoot “/srv/www/htdocs/squirrelmail”

in it, and /srv/www/htdocs/squirrelmail is a symbolic link to the
directory where I installed SquirrelMail.

> the other (overall system message log) looks like it’s trying to
> validate multiple times, can’t figure out where the problem is.

You are authenticating against LDAP, while I am using sasldb, but
I don’t think that should make any difference. It’s strange,
however, that your first login (the one where you get the error
page) appears as:

Dec 1 16:19:12 SkynetServer imap[4602]: login: localhost [127.0.0.1] arnoldnijboer plaintext User logged in
Dec 1 16:19:12 SkynetServer imap[4602]: accepted connection
Dec 1 16:19:12 SkynetServer saslauthd[3582]: do_request : NULL password received
Dec 1 16:19:12 SkynetServer imap[4602]: badlogin: localhost [127.0.0.1] plaintext arnoldnijboer SASL(-13): authentication failure: checkpass failed

So SquirrelMail logs in successfully but immediately afterwards
tries again without a password, which fails of course. That doesn’t
happen the second time, when the URLs are prefixed by “/webmail”.

HTH
T.


Tilman Schmidt
Phoenix Software GmbH
Bonn, Germany

oooh right sorry for that. forgot to mention.
the apache directory is indeed /srv/www/htdocs/squirrelmail for the webmail.

and then i made a symbolic link from /srv/www/arnoldnijboer.info/webmail to it.

in /srv/www/htdocs/arnoldnijboer i have an .htaccess file with mod rewrite to make on the fly subdomains so to speak.
here is the code:
RewriteEngine On
# If directory exists for subdomain, rewrite it.

    RewriteCond %{HTTP_HOST} ^(^\.]+)\.Arnoldnijboer\.info$ [NC]

    RewriteCond %{DOCUMENT_ROOT}/%1 -d [NC]

    RewriteCond %1%{REQUEST_URI} !^(^\.]+)/\1(/.*)?$ 

    RewriteRule ^(.*)$ %1/$1 [L,NC,QSA]

in the vhost.conf i specify the main directory /srv/www/htdocs/Arnoldnijboer.info
and from there the mod rewrite takes over, and checks whats in front of the domainname, and directs you to the proper directory!

so very technically every subdomain is not a prefix but a sufix.
http://arnoldnijboer.info/webmail/

I’ve tryed http://webmail.arnoldnijboer.info/webmail
login is instant then, no second time… no error…

    RewriteCond %{DOCUMENT_ROOT}/%1 -d [NC]

this line produces sometinmes an error in my apache log like:
[Mon Dec 01 16:19:33 2008] [warn] RewriteCond: NoCase option for non-regex pattern ‘-d’ is not supported and will be ignored.

but when i remove the -d the rewrite doesn’t work, and besides the logfile error everything (except squirrelmail) works fine.
phpbb doesn’t have problems with it!
and i can’t find a option in squirrelmail to set the root directory or something.

Anny sugestion??

arnoldnijboer schrieb:
> in /srv/www/htdocs/arnoldnijboer i have an .htaccess file with mod
> rewrite to make on the fly subdomains so to speak.

Uh-huh. Well, I’m sorry but I’m out of my depth there.
I’m not really familiar with the details of how mod_rewrite works.
Perhaps another participant can shed more light on that.

Best of luck
Tilman


Tilman Schmidt
Phoenix Software GmbH
Bonn, Germany

Is there no one out there who can help me?
please…

i can explain the problem once more in a compact style.
someone goes to http://webmail.arnoldnijboer.info
apache(mod-rewrite) changes it to the directory /srv/www/htdocs/Arnoldnijboer.info/webmail/
then he/she tryed to login and squirrelmail failes.
returning to the login page squirrelmail changed the domain to:
http://webmail.Arnoldnijboer.info/webmail
and when you try to login it works.

this tels me 2 things. first squirrelmail isn’t recognising the apache mod-rewrite link/documentroot for it’s login
and second squirrelmail has some folder prefix set to /webmail
sinds apache’s standard documentroot (without mod-rewite) is /srv/www/htdocs/Arnoldnijboer.info/

anyone knows how to fix either one of them?
please i need some help.

I think mod_rewrite is the wrong tool for the job. Since you have a virtual host webmail.arnoldnijboer.info, why not just make the DocumentRoot for that virtual host /srv/www/htdocs/Arnoldnijboer.info/webmail/ and then all the squirrelmail relative URLs are correct wrt this directory.

I assume that the directory /srv/www/htdocs/Arnoldnijboer.info/webmail/ is the top directory of the squirrelmail install, with subdirectories config, src, etc and that index.php in this directory redirects to src/login.php.

Sorry, I don’t see why it has to be complicated with mod_rewrite. I don’t use mod_rewrite with the squirrelmails I have installed. I don’t have a virtual host pointing to the top directory of squirrelmail, it is in fact in /srv/www/htdocs/squirrelmail, but it all works with http://www.example.com/squirrelmail/ and the squirrelmail portion stays there for all URLs, so there is no reason it could be factored out into DocumentRoot.

Well you’re absolutely right why make things difficult.
but i use mod rewrite so i could create “on the fly” sub domains.
i’m hosting a weblog system and every user that creates a weblog gets an subdirectory, witch in terms becomes automatically a subdomain.
and sins i had that system up and running i didn’t feel like messing with apache’s virtual domain settings.
besides i don’t like using 2 kind of settings side bij side, if something goes wrong you need to figure out first were things went wrong.
as for squirrelmail thee directory /srv/www/htdocs/Arnoldnijboer.info/webmail is a symlink to /srv/www/htdocs/squirrelmail/

but thanks for the reply…

Well as Ralf Engelschall wrote: With mod_rewrite you either shoot yourself in the foot the first time and never use it again or love it for the rest of your life because of its power

So it’s up to you whether you want to gain the upper hand and love it or keep hurting your foot. :wink:

oh it’s not a question of love and hate. because i indeed already LOVE it rotfl!

but it’s the little tweaks that get up my …
if someone could help me get squirrelmail working preferably with mod-rewrite it would be appreciated.

You may have more luck in an Apache forum. You obviously know much more about mod_rewrite than I do. I just use the occasional recipe now and then. I’d like to learn more but there are so many round tuits to explore and life is short.

Okey i have posted on a modrewrite forum.

the solution was a new version of my rewrite code.
and then modify the squirrelmail code because the $php_self
still pointed at a wrond document root so to say.

but i’ve got it working just fine;)

thanks again for all the help.