Attachments aren't saved on SuiteCRM

Hi, I’m using SuiteCRM 7.6.3 and with any version of the Outlook plugin, I’m not able to save attachments.
Emails are archived correctly
And i’ve also set “Save attachment also” option in settings.
What test should I do more?

I found now that there are older post then mine highlghting this issue:

https://suitecrm.com/forum/suitecrm-outlook-plugin/5987-attachments-not-copying-across-to-suite?start=15

https://suitecrm.com/forum/suitecrm-outlook-plugin/9727-attachments-not-synced-outlook-2010#33352

I believe it even has an open issue on Github (not on the main SuiteCRM project, but on the plugin):

https://github.com/salesagility/SuiteCRM-Outlook-Plugin/issues/1

I tested the plugin on this environment:
a virtual machine with Windows10+Outlook2013 and the SuiteCRM Outlook Plug-In v1.1.0.9
suitecrm was installed locally as LAMP stack (SuiteCRM v 7.6.3)
i succeeded in archiving emails and attachments.

What test do you think i should do to make it work in production evironment?

I really don’t know, it’s hard to say without having at least some idea of the cause could be.

Of course, for debugging, your situation is very promising: having both a working and a non-working system, you can compare the flow of the code in both until you find out exactly how it breaks.

If you can debug your code in a debugger, perfect. If not, maybe just try comparing the logs on both systems when saving an attachment, for example… but the success of these strategies will depend a lot on your technical skills…

Hi pgr, thank you for answering;
yes’ you’re right.

I don’t know how to debug the plugin, because it’s a compiled exe file… (or how to add log messages)

You could download the source code from Github and debug it in Visual Studio. However this is surely a LOT of work, and difficult to do succesfully, so I don’t really recommend it.

Looking at the code of the plugin, I see it generates logs:
string logFilePath = clsSuiteCRMHelper.InstallationPath + “\Logs\”;
logFilePath = logFilePath + “Log-” + System.DateTime.Today.ToString(“MM-dd-yyyy”) + “.” + “txt”;

I don’t know if they are optional, and have to be turned on somewhere. But maybe try looking at those logs and see if any clue comes up.

These logs would be on Windows, on the machine running Outlook, if I’m not mistaken.

1 Like

You were right!

i found logs in:

C:\Users<User Name>\AppData\Roaming\SuiteCRMOutlookAddIn\Logs\

I think this could be useful:

ArchiveEmail method General Exception:
Message:Accesso al percorso ‘MyDocuments\SuiteCRMTempAttachmentPath’ negato.
Source:mscorlib
StackTrace: in System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
in System.IO.Directory.InternalCreateDirectory(String fullPath, String path, Object dirSecurityObj, Boolean checkHost)
in System.IO.Directory.InternalCreateDirectoryHelper(String path, Boolean checkHost)
in SuiteCRMAddIn.ThisAddIn.Base64Encode(Attachment objMailAttachment, MailItem objMail)
in SuiteCRMAddIn.ThisAddIn.ArchiveEmail(MailItem objMail, Int32 intArchiveType, String strExcludedEmails)
Data:System.Collections.ListDictionaryInternal
HResult:-2147024891

Well… in fact the code shows (https://github.com/salesagility/SuiteCRM-Outlook-Plugin/blob/bb44d6bbc113acf973938e095512c74e2ff893e1/SuiteCRMAddIn/ThisAddIn.cs, line 481) it’s trying to create a temporary directory under your “My Documents”.

This doesn’t seem like a good idea, probable the “temp” folder would be more adequate… but I don’t know, there might be valid reasons for this option.

I’m curious, does that folder exist in your system?
MyDocuments\SuiteCRMTempAttachmentPath

Anyway, that doesn’t seem like a complete path to me. I don’t think that could work. To get that path it probably should look something like
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
and not
Environment.SpecialFolder.MyDocuments.ToString()

mayerelyashiv,

can you please try this in your system. Open an elevated command prompt (cmd.exe as Administrator) and type this command:

dir SuiteCRMTempAttachmentPath /s /a

It will take a few minutes to run.

I would like to know if this path is getting created somewhere in your system. I would guess that it is, under Microsoft Outlook’s starting directory.

For example, if Outlook is starting in directory c:\Program Files\Microsoft Outlook
then my guess is you would see a directory called
c:\Program Files\Microsoft Outlook\MyDocuments\SuiteCRMTempAttachmentPath\

That’s what the code is trying to do; but perhaps it never creates the directory because of lack of permissions to write there.

You could try running Outlook as Administrator and see if those errors stay the same.

Hi pgr, yes;
it says to me:

“volume in drive c has no label”
“serial number of the volume: CED8-51F7”
“File not found”

What errors do you get in the logs while saving Attachments if:

a) you start Outlook.exe as an Administrator?

b) you create a shortcut to start Outlook.exe but using another directory as a starting directory? I suggest something writeable by you, like

C:\Users<User Name>\AppData\Roaming\SuiteCRMOutlookAddIn\

1 Like

Hi pgr,
how can i launch Outlook with a different starting directory?

On your Windows desktop, right-click on an empty space, then select “New”, then “Shortcut”.

Then point the shortcut to your Outlook.exe

(you can use

dir \outlook.exe /s /a

from an Administrator command prompt to discover it)

Give the shortcut some name, and click “finish” to close the wizard.

Now right-click on the new shortcut on your Desktop, select “Properties” and change the “Start dir” there.

  1. By the way, please repeat the command I asked you before with the following change (a backslash):
    dir \SuiteCRMTempAttachmentPath /s /a

Tell me your three results here (1. run Outlook as Admin, 2. run Outlook from shortcut, 3. the dir above)