email attachments should be written to different directory

Description

currently email attachment "temp" files get written to where the process is running from. this is not ideal and should be updated to the confluence-home/temp directory.

Freshdesk Tickets

#2128 (http://artemissoftware.freshdesk.com/helpdesk/tickets/2128) - The attachment feature does not work

Create a Support Ticket

Activity

Show:
Brendan Patterson
September 30, 2014, 5:49 PM

this version of the AddOn displays the target attachments temp directory

Brendan Patterson
September 30, 2014, 5:47 PM

HI , I have attached a new not yet released version of the AddOn which shows the location of the temp directory it is trying to add temp attachments to when you click "Check EMail" as shown:

please try that out. If that doesn't help us quickly solve the problem I will add a custom configuration to specify the destination.

version 2.3.2 attached to this ticket. Feel free to follow up by sending a note to help@artemissoftware.freshdesk.com if that is easier to track.

Brendan

Gino Rossen
September 26, 2014, 7:17 AM
Edited

Maybe some usefull info: our confluence home directory is /appdata/confluence and the main installation is in /opt/atlassian/confluence. Both are on different filesystems.
Confluence is started with the init script which is included in the binary installer and runs under the confluence user (defaults from the binary installer).

Brendan Patterson
September 25, 2014, 4:03 PM

Thank you for trying that out and for the helpful stack trace. It looks like you've identified the problem that the AddOn is having trouble writing the file to the temp directory and getting permission denied. I wonder if it is accidentally trying to write the file somewhere else. In my tests it did write to the correct location, but that is the only thing I can think of - for some reason Confluence might not be handing back the Confluence home directory.

Let me add a statement so we can determine where it is trying to write to and I'll look to see if there is another way to ask for the Confluence home directory. Ultimately I could make the destination directory configurable but shouldn't have to.

More soon.

Gino Rossen
September 25, 2014, 7:18 AM

Hi,

OS: Linux (RHEL 6.5)
Confluence v5.5.3 (installed by the binary installer)
after updating the plugin to v2.3.1 and restarting confluence we are still having problems. If there is no attachment the confluence page gets created, but when there is an attachment, no page gets created and we still have the permissions error:

(the confluence_home/temp directory exsists and is writeable by the confluence user, other plugins such as scrollpdf are able to create temporary files in this directory)

biz.artemissoftware.confluence.sendemailtopage.EMailCheck.handlePart(EMailCheck.java:492) 2014-09-25 09:05:01,159 [scheduler_Worker-2] ERROR Error while saving attachment: m2pAddOn-canDelete-attachment-14116287011570.obj (Permission denied)
java.io.FileNotFoundException: m2pAddOn-canDelete-attachment-14116287011570.obj (Permission denied)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(Unknown Source)
at java.io.FileOutputStream.<init>(Unknown Source)
at biz.artemissoftware.confluence.sendemailtopage.AttachmentWrapper.sendStreamToFileForLaterRetrieval(AttachmentWrapper.java:106)
at biz.artemissoftware.confluence.sendemailtopage.EMailCheck.handlePart(EMailCheck.java:478)
at biz.artemissoftware.confluence.sendemailtopage.EMailCheck.handleMultipart(EMailCheck.java:382)
at biz.artemissoftware.confluence.sendemailtopage.EMailCheck.parseMessages(EMailCheck.java:183)
at biz.artemissoftware.confluence.sendemailtopage.EMailCheck.checkEMail(EMailCheck.java:101)
at biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob.fireEMailCheck(SendEMailToPageJob.java:216)
at biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob.invokeTriggerServlet(SendEMailToPageJob.java:125)
at biz.artemissoftware.confluence.sendemailtopage.SendEMailToPageJob.execute(SendEMailToPageJob.java:456)
at com.atlassian.confluence.plugin.descriptor.JobModuleDescriptor$DelegatingPluginJob.execute(JobModuleDescriptor.java:143)
at org.quartz.core.JobRunShell.run(JobRunShell.java:199)
at com.atlassian.confluence.schedule.quartz.ConfluenceQuartzThreadPool$1.run(ConfluenceQuartzThreadPool.java:20)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)

Fixed
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Ture Hoefner

Reporter

Brendan Patterson

Labels