SquirrelMail
From MyLinuxNotes
c4tracel I installed v1.2.8, but have upgraded to v1.2.10 via handy dandy RPM's. I learned a lot just trying to get this installed and configued the way I wanted it. I had to install and configure CyrusIMAP, ApacheWebserver, MySQL, and php, but hey I had fun in the process!
... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... no changes ... == Install ==
The install was pretty painless, it's configuring it that is the bear. The online documentation is kinda lacking. The rpm I installed put the docs in a wierd place. The source for SM is /usr/share/squirrelmail but the docs are in /usr/share/docs/squirrelmail. I didn't see them right away and waisted a little bit of time.
During this time I got the error:
ERROR : Could not complete request. Query:CREATE "INBOX./Sent" Reason Given: Invalid mailbox name
To correct this for all your users and run ./conf.pl (must be run from config/ in Squirrelmail's root dir) select option 3 then 1 and enter 'none' (without the quotes). Save your changes and exit.
That might fix it, but in the most current version (1.4.0) from the main screen in ./conf.pl choose "D" and then pick your imap server.
If you are still having problems maximize your PHP error reporting by editing php.ini and changing:
display_errors = on error_reporting = E_ALL
Then restart your web server.
MySQL
I then decided to utilize MySQL for the address book and user preferences. Check out db-backend.txt ( I have seen it as both db-backend.txt and db_backend.txt ) for some good instructions for this. As per the instructions make sure you install pear DB and put the path to DB.php in your @INC, by editing include_path in /etc/php.ini like so:
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2" Windows: "\path1;\path2"
include_path = ".:/usr/share/php:/usr/local/lib/php4/pear:/usr/share/pear"
doc_root = ; the root of the php pages, used only if nonempty
user_dir = ; the directory under which php opens the script using /~username,used only if nonempty
extension_dir = /usr/lib/php4 ; directory in which the loadable extensions (modules) reside
enable_dl = On ; Whether or not to enable the dl() function.
; The dl() function does NOT properly work in multithreaded
; servers, such as IIS or Zeus, and is automatically disabled
; on them.
and restarting Apache. I ran into a lot of errors that squirrellmail couldn't access DB.php. It was because DB.php was db.php. Then I got the error:
Error initializing addressbook database.
That was because I didn't have MySQL support in php. I used up2date-nox php-mysql to fix that.
Then as per the instructions in db-backend.txt I made both DSN the same using conf.pl. Now I was getting errors like:
ERROR : Could not complete request. Query:CREATE "Sent" Reason Given: Permission denied
This was due to my setting in Folder Defaults of conf.pl. I had them set as Sent, Trash and Drafts when they should have been INBOX.Sent, INBOX.Trash and INBOX.Drafts.
Plugins
I have taken over the maintenance for the Address Group Plugin and you can find more info on the AbookGroup page.
- Filtering
- I originally used the base mail filters, but found that they REALLY slowed down the system.
- I then decided to use sieve which is a server side mail filter that comes with CyrusIMAP. I enabled sieve by
- uncommenting it's line from
/etc/cyrus.conf. Check and make sure you have the following entry in/etc/imapd.conf:
sievedir: /usr/sieve
- I then installed the SIEVE Mail Filters plugin from http://www.squirrelmail.org/plugins.php. To enable the filter run conf.pl and goto plugins and pick filter. This is a very nice filter and very quick. The only gripe is that it doesn't do the message bodies.
- Addressbook
- I didn't like the way it displayed the names "Firstname Lastname" so I took a look in
/usr/share/squirrelmail/functions/abook_database.phpto see if I could find where to change it to "Lastname, Firstname". Under the comment/* List all addresses */I found the following line:
'name' => "$row[firstname] $row[lastname]",
- and I changed it to:
'name' => "$row[lastname], $row[firstname]",
Errors
Fatal error: Allowed memory size of 8388608 bytes exhausted...blah, blah, blah
From what I can tell this occurrs when you have too much mail in your account. This you can do to resolve them within SquirrelMail is:
- Turn off server side filtering.
- Edit
php.iniby changing thememory_limitvariable to80M. - Then clean out some of the mail.
Check out CyrusIMAP for addtional info on cleaning up mailboxes.
Preference database error (connect failed). Exiting abnormally squirrelmail
I got this doing a server migration from a RedHat box to a DebiaN box. It was due to the DSN contaning "localhost" as opposed to "127.0.0.1". "localhost" resolves normally on the DebiaN box but for some reason SquirrelMail didn't like it.
I got the error below when trying to open my inbox on morning:
ERROR : Connection dropped by imap-server. Query: THREAD REFERENCES ISO-8859-1 ALL
and this in /var/adm/imapd.log:
Apr 19 09:05:57 linuxnotes master[4174]: about to exec /usr/cyrus/bin/imapd Apr 19 09:05:57 linuxnotes imap[4174]: executed Apr 19 09:05:57 linuxnotes imap[4174]: accepted connection Apr 19 09:05:57 linuxnotes imap[4174]: login: localhost [127.0.0.1] quincy plaintext Apr 19 09:05:57 linuxnotes imap[4174]: accepted connection Apr 19 09:05:57 linuxnotes imap[4174]: login: localhost [127.0.0.1] quincy plaintext Apr 19 09:06:19 linuxnotes imap[4174]: skiplist: recovered /var/imap/user/q/quincy.seen (37 records, 18972 bytes) in 22 seconds Apr 19 09:06:19 linuxnotes imap[4174]: seen_db: user quincy opened /var/imap/user/q/quincy.seen Apr 19 09:06:20 linuxnotes imap[4174]: open: user quincy opened INBOX Apr 19 09:06:20 linuxnotes imap[4174]: seen_db: user quincy opened /var/imap/user/q/quincy.seen Apr 19 09:06:20 linuxnotes imap[4174]: open: user quincy opened INBOX Apr 19 09:06:21 linuxnotes imap[4174]: open: user quincy opened INBOX Apr 19 09:06:21 linuxnotes imap[4174]: SQUAT failed to open index file Apr 19 09:06:21 linuxnotes imap[4174]: SQUAT failed Apr 19 09:06:21 linuxnotes master[4126]: process 4174 exited, signaled to death by 7 Apr 19 09:06:21 linuxnotes master[4126]: service imap pid 4174 in BUSY state: terminated abnormally
I corrected this by reconstructing my whole mailbox (as user cyrus):
/usr/cyrus/bin/reconstruct -r user.quincy
