Bug 956380

Summary: clicking on a mailto link in Firefox brings up a second Claws Mail window / Firefox overrides $TMPDIR
Product: [Fedora] Fedora Reporter: Aram Agajanian <agajania>
Component: claws-mailAssignee: Andreas Bierfert <andreas.bierfert>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 18CC: andreas.bierfert, andrew, bugs.michael, ossman
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1070264 (view as bug list) Environment:
Last Closed: 2013-12-21 17:05:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1161110    

Description Aram Agajanian 2013-04-24 20:49:07 UTC
Description of problem:
Clicking on a mailto link in Firefox when Claws Mail is already running brings up a second Claws Mail window along with the Compose Message window.

Version-Release number of selected component (if applicable):
claws-mail-3.9.0-1.fc18.x86_64

How reproducible:
Happens every time

Steps to Reproduce:
1.  Start Claws Mail.
2.  Start Firefox.
3.  Direct Firefox to a page with a mailto link.
4.  Click on the mailto link.
  
Actual results:
A new Claws Mail window appears along with a new Compose Message window.

Expected results:
A new Compose Message window should appear.

Additional info:
If I right-click on an email address in a Terminal and select the "Send Mail To..." option when Claws Mail is already running, a new Compose Message window comes up without a new Claws Mail window.

Comment 1 Michael Schwendt 2013-04-24 21:24:42 UTC
Reproducible with claws-mail-3.9.0-9.cvs122.fc19.x86_64
A second process "claws-mail mailto:address-here" is started.

Comment 2 Michael Schwendt 2013-05-20 08:49:23 UTC
Currently not reproducible anymore with claws-mail-3.9.1-1.fc19.x86_64
Only another Claws Mail compose window is opened.

 2164 ?        Sl     0:00 claws-mail first
 2178 ?        S      0:00  \_ claws-mail first
 2179 ?        Sl     0:00  |   \_ emacs --no-splash /home/ms19a/.claws-mail/tmp/tmpmsg.0x16594e0
 2194 ?        S      0:00  \_ claws-mail first
 2195 ?        Sl     0:00  |   \_ emacs --no-splash /home/ms19a/.claws-mail/tmp/tmpmsg.0xe92c00
 2311 ?        S      0:00  \_ claws-mail first
 2312 ?        Sl     0:00      \_ emacs --no-splash /home/ms19a/.claws-mail/tmp/tmpmsg.0x20f31a0

Comment 3 Michael Schwendt 2013-05-22 18:41:39 UTC
Seems to be a more generic issue specific to Firefox. Cannot say that Claws Mail 3.9.1 would fix it.

Comment 4 Aram Agajanian 2013-05-22 20:06:52 UTC
I can no longer reproduce this bug on Fedora 18.  I have tested with firefox releases 20.0-1 and 21.0-3.

Comment 5 Michael Schwendt 2013-05-22 20:14:46 UTC
Okay, I've had a look.

The /usr/bin/firefox shell script does something nasty:

  ##
  ## Use $MOZ_TMPDIR if set. Otherwise use /var/tmp instead of /tmp
  ## because of 1GB /tmp limit in Fedora 18 and later.
  ## See: https://bugzilla.redhat.com/show_bug.cgi?id=867073
  ##
  TMPDIR="${MOZ_TMPDIR:-/var/tmp}"
  export TMPDIR

Claws Mail on the other hand relies on g_get_tmp_dir(), which reads the env vars TMPDIR, TMP, TEMP (in that order), and if none is defined, defaults to /tmp.

So, the tmp_dir path varies depending on whether Claws Mail is started from within Firefox or the desktop env (or shell).

The firefox script ought to respect a user-defined $TMPDIR and not override it like this. I'll add a comment there.

Comment 6 Aram Agajanian 2013-05-22 20:42:38 UTC
OK, now I can reproduce this bug on Fedora 18.

[agajania@localhost tmp]$ ll /tmp/*claws* /var/tmp/*claws*
srwxrwxr-x. 1 agajania agajania 0 May 22 16:36 /tmp/claws-mail-1000
srwxrwxr-x. 1 agajania agajania 0 May 22 16:36 /var/tmp/claws-mail-1000

Comment 7 Michael Schwendt 2013-05-24 08:33:58 UTC
I've posted about this also to Claws Mail users' list.

Temporary work-around: Set TMPDIR and MOZ_TMPDIR environment variables to the same location.

Comment 8 Michael Schwendt 2013-07-08 17:45:11 UTC
So, where are we now?

Meanwhile, Fedora /usr/bin/firefox respects $TMPDIR if set. That's a work-around for users who know about this and do set $TMPDIR.

That doesn't help us much with regard to this issue. If $TMPDIR is not set when Claws Mail is started, it will fall back to using /tmp (see comment 5). When launching Claws Mail from within Firefox, /var/tmp will be used instead.

I don't feel like replacing  g_get_tmp_dir()  with something that would do the same as Fedora's /usr/bin/firefox shell script.

What about a README.Fedora for mentioning this $TMPDIR detail? The least we could do, IMO.

Comment 9 Michael Schwendt 2013-07-21 18:18:36 UTC
I've had a discussion yesterday about a similar problem and also about this particular issue then:

  https://fedoraproject.org/wiki/Staying_close_to_upstream_projects

Basically, patching Claws Mail in Fedora would result in a significant deviation from upstream. Behaviour of Fedora's Claws Mail would differ from upstream. That would already be a problem when switching back and forth between Fedora packages and a snapshot from git. Also, Firefox only messes with $TMPDIR in Fedora. It doesn't do that in RHEL (yet).

Comment 10 Fedora End Of Life 2013-12-21 15:29:51 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.