I have just installed the Outlook 2013 plugin (v1.1.0.9) and am able to sync emails across to SuiteCRM, but the attachments (e.g. .pdf files) are not copying across. Is there a trouble shooting guide to resolve this issue?
I have ticked the “Archive attachments also” box in the Archive tab (see attachment), but they’re still not coming across to SuiteCRM.
Are they not coming over at all or are they corrupt? There is a known bug (not sure if it has been patched yet) which caused attachments to be corrupted.
You can check your logs:
suitecrm.log
php-errors.log (you need to turn on logging PHP errors in php.ini, Google how to do it)
You can also check the permissions on the directory onto which the attachments get copied. I’m afraid I don’t know which directory it is, probably “upload”.
Finally, if you have a debugger you can step through the code and try to see where it breaks.
maybe you can find that out using other attachments. I mean, from other emails where attachments are working, not from the Outlook plugin.
I know what happens for the “Photos” fields, and for the Documents module. These probably (just probably) use a similar mechanism to email attachments. Basically, files get copied over to “upload” directory (mine is called “1711-upload”, I have no idea why), using names like f3f830d9-94fe-b838-45ae-56a00963e3dc_photo which are made up from the id of the corresponding SuiteCRM record. These ids are the ones you find in the database.
I’m sure that if you peek in the database to see the tables relating to email attachments, you can find the ids and look for those files in the file system.
Well, maybe you don’t have any actual data currently there? Are there any attachments in your emails?
You can try simpler queries just to make sure you’re accessing the correct database:
SELECT * FROM emails
SELECT * FROM notes
I’m assuming you will find that your sync to Outlook is generating rows in the “emails” table (otherwise you wouldn’t see any emails in SuiteCRM at all).
If nothing is showing in the “notes” table, then you know that the process of importing attachments is failing at the database level, not just the copying of the files over into the file system.
If that is the case, I don’t know what else could be done, short of debugging the plugin. It’s strange if that fails without any sign in the logs…
I ran the following command in SQL, "SELECT * FROM emails ", and confirmed that I am running it on the correct database and there is in fact data there. Prior to running the query though, I identified a contact to whom I have successfully archived an email via the Outlook plugin, which also contained an attachment (screenshot attached).
I was then able to locate this entry in the database using the command above… and whilst there is an entry for the Subject Header in the database, there does not appear to be any entry for the uploaded / attached file.
Should I be expecting to find an entry for the attachment when I run this query as well?
I’ve found a record in the “notes” table with the same parent_id as that of the email record.
I’ve attached a screenshot of the details and believe the “id” number I should be looking for in the uploads file is “83a6fa16-b73e-652e-17d9-57383bb55055”.
Now you understand the process, so you can try to see which parts are working, and which aren’t. See if you get a record created in the database in “emails”; then see if you get a corresponding record in “notes”; then check to see if the file is actually there.
Maybe this can give you clues and let you try different things (check permissions on the upload directory), try different filenames and extensions, etc.
I know that some extensions are not uploaded “as they are” to the upload directory for security reasons (I think php files get their named changed, for example).
Thanks pgr,
I’ve archived an email containing an attachment into SuiteCRM this morning at work and as expected, the attachment didn’t copy across.
I’ve followed the process we outlined last night and identified that when archiving emails containing attachments at work, the “Email” record in the database contains data in the assigned_user_id field, whereas when i archive an email containing an attachment at home, no data is copied into the assigned_user_id field.
I’ve attached a couple of screenshots highlighting the additional data in the assigned_user_id field, which I can only assume is causing the attachment not to copy across, but I am unable to reconcile why this may be the case… or more importantly, how to resolve it.
I’m sorry, I don’t have much time today, but regarding the attachment that did NOT copy correctly…
do you have a corresponding record in the “notes” table?
if you do, do you have the file in the upload directory, with permissions set correctly?
That’s what seems crucial to me.
The “user assignment” might influence whether a certain document is visible to you or not; but it’s no good checking that unless you know for sure that the database has a reference for it, and the file is there.