Move Squirrelmail to new web server

I recently rebuild an OS X webserver and migrated websites from an old Panther box. I had a website that was using Squirrelmail and this is what I ran into in moving the site over.

#1. I wasn’t able to login to the website with a valid username and password. I kept getting an APPEND error so I found this in a google search:

Ok. I debugged squirrelmail a little, and I found out, that the error occurs when sending the APPEND Command to IMAP.

I found the error in functions/imap_general.php

Reason: The following command is sent to imap when trying to append the sent message to “Sent” folder:

A004 APPEND "Sent" (\Seen) {$length}

The $length value is not parsed / replaced by php. So I changed line 891 from

fputs ($imap_stream, sqimap_session_id() . " APPEND
\"$sent_folder\" (\\Seen) \{$length}\r\n");


fputs ($imap_stream, sqimap_session_id() . " APPEND
\"$sent_folder\" (\\Seen) {" . $length . "}\r\n");
That resolved the issue of logging in. 

#2. Then I was able to login but I couldn't send out messages.  
I found other google posts that pointed here so I followed the instructions in both posts below and 
was able to get send and receive working. These changes were due to the fact that the new server is running a 
more current version of PHP \
 deliver/Deliver.class.php?r1= \

#3 All was working except attachments. I found all the posts about checking file_uploads enabled in php.ini 
I increased the upload size to 25M even though the attachments were 4kB.  I checked what I thought was the directory the
attachments were being save to and none of it resolved the issue. I ran the config/ and the system squirrelmail said the
attachments were at /var/db/squirrelmail/attachments.

#4. FINALLY I found this and found that my attachments directory for 
that particular site was different than the one from the command line! I created the directory and edited the permissions
as appropriate and viola! Finally all is working!

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s