Old versions of Hmailserver 5.4.1 and earlier used absolute datapaths in the filenames of the .EML files (stored in the database). Upgrading to 5.4.2 or later should involve an automatic process that removes this feature and makes the filename paths relative (that means they will be found in relation to where you have stated the data path to be). This instruction applies up to current latest version of Hmailserver 5.6.x.
It may be that the upgrade process successfully runs the necessary changes and/or you may never need to worry about what I have said above. However, for completeness, and to prevent any doubt of problems in the future being caused due to the lack of changes (problems, for example, when you choose to relocate your data), if possible I advise to do a simply check to ensure that upgrade has completed the changes to your database by following this procedure.
Note: This relies on the ability to access your database and that you are safe in the knowledge you know what you are doing. If you do not know how to access your external database or you are asking "what does he mean by 'database'?" then you should stop reading now and do not go any further! Those using the INTERNAL database to access and update it would require extra 3rd party software such as DatabaseBrowserPortable (archived here). So if you are running the internal database and do not have such software then stop reading now. To access with DatabaseBrowserPortable you will need to decrypt the database password from your hmailserver INI file to access the internal database. See footnote below**.
PERFORM THE CHECK AND UPDATE
CHECK
Open your SQL database prompt/admin tool of choice and connect to your Hmailserver database. Then run the following SQL statement:
Code: Select all
SELECT * FROM hm_messages where LEFT(messagefilename, 1) <> "{";
Alternative: Some SQL flavours do not like the LEFT() function (such as DatabaseBrowser). If you encounter an error due to using incorrect syntax then use this alternative command:
Code: Select all
SELECT * FROM hm_messages where messagefilename not like '{%' ;
UPDATE
The above check MAY show a number of records (containing full pathnames instead of filenames only in the 'filename' field). This indicates records that have not had the absolute path removed. (If no records are returned, then all is fine and you can stop/exit).
Warning: It is also advisable to do this AFTER you have done a database backup first. Again, if you do not know what you are doing here then STOP as you are about to modify your database.
If records were returned in the check, run the following update SQL:
Code: Select all
UPDATE hm_messages SET messagefilename=REPLACE(messagefilename, messagefilename, right(messagefilename,42));
Alternative: Some SQL flavours do not like the RIGHT() or REPLACE functions (such as DatabaseBrowser). If you encounter an error due to using incorrect syntax then use this alternative command:
Code: Select all
UPDATE hm_messages SET messagefilename=substring( messagefilename , len ( messagefilename ) - 41 , 42 ) where messagefilename not like '{%' ;
And then check with the SQL first statement again (this time hopefully not showing any records).
RESTART
If you needed to update the records, then now stop and restart your Hmailserver service.
** FOOTNOTE:
To access the internal database using DatabaseBrowserPortable you wll need the database password:
- a, open your HMAILSERVER.INI file and select the 'password' string under
b, Run hmailsever/Addons/Utilities/DecryptBlowfish.vbs and where prompted enter the string copied. This will create and display a short string of characters (this is the password). Copy this string of characters.[Database]
Password=a2bd344fc6608264d2d6b3ca2f89303
c, Run DatabaseBrowserPortable, and choose 'Connections - Add' and point to your internal Data directory database (remember to choose MSSQL CE as database type). Enter "Hmailserver" as the User name and the above decrypted string as the password.