Bug 3384 - often claws-mail (often) starts with default clawsrc
Summary: often claws-mail (often) starts with default clawsrc
Status: RESOLVED FIXED
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: UI (show other bugs)
Version: 3.11.1
Hardware: PC Linux
: P3 minor
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2015-02-11 17:36 UTC by Jerome
Modified: 2015-10-13 08:12 UTC (History)
1 user (show)

See Also:


Attachments

Description Jerome 2015-02-11 17:36:24 UTC
On Linux debian 3.16.0-4-amd64 claws-mail (often) starts with a default clawsrc

This does not always happen ~ a guess would be 3 times out of 4.

When this happens, I have to close claws-mail & remove that file and rename clawsrc.bak to clawsrc to start claws-mail correctly (works 100%) with all options and plugins loaded correctly.

I have not found a relevant bug - but then maybe I haven't been thourough in my search.

I don't usually quit claws-mail manually and let the computer do it at shutdown - could this be a reason ? 

Thanks for any information that could lead me into resolving this issue.

Jerome
Comment 1 Michael Schwendt 2015-03-25 21:04:29 UTC
At Fedora we've received this fresh bug report:

  Bug 1204967 - Claws Mail keeps forgetting its configuration
  https://bugzilla.redhat.com/1204967

No details known yet.
Comment 2 Paul 2015-03-25 21:07:36 UTC
More than likely the result of not shutting down cleanly.
Comment 3 Michael Schwendt 2015-06-27 16:50:04 UTC
[ forwarding from https://bugzilla.redhat.com/show_bug.cgi?id=1204967#c11 ]

It happened again: I rebooted, and when Claws Mail restarted the column widths were all wrong. (I haven't yet managed to replace Claws Mail entirely. Kmail was still unable to get attachments in signed messages right when I last checked.)

As I now recognize the symptom with the column widths I didn't touch anything in the GUI but immediately listed the contents of ~/.claws-mail. It contained these files:

-rw-------. 11446 19 jan  2013 clawsrc.backup
-rw-------. 11061 27 jun 13.55 clawsrc.bak
-rw-------. 11061 27 jun 13.55 clawsrc.tmp

clawsrc was missing, and clawsrc.bak and clawsrc.tmp were identical.

I closed Claws Mail, and then ~/.claws-mail contained these files:

-rw-------.  9361 27 jun 15.08 clawsrc
-rw-------. 11446 19 jan  2013 clawsrc.backup
-rw-------. 11061 27 jun 13.55 clawsrc.bak

I copied clawsrc.bak to clawsrc and started Claws Mail, and now the configuration is back to how it was.

This seems to confirm that what I've called my greater problem happens when Claws Mail crashes or gets killed after renaming clawsrc to clawsrc.bak but before renaming clawsrc.tmp to clawsrc.

It should be quite possible to look for clawsrc.bak or clawsrc.tmp if clawsrc is missing when the program starts, and do this recovery automatically.
Comment 4 Andrej Kacian 2015-06-27 19:46:40 UTC
Well, if you insist on shutting down uncleanly, I would suggest running claws-mail in a console, and redirecting stdout and stderr to a file. prefs_file_close(), the function responsible for handling the .tmp and .bak files will print out any errors while copying/renaming, and that might bring some insight at where the procedure fails for you.
Comment 5 Michael Schwendt 2015-06-27 23:03:40 UTC
@Andrej : I only forwarded the reporter's comment.

As what likely goes wrong is this when killing Claws Mail while it's trying to terminate: http://lists.claws-mail.org/pipermail/users/2015-March/012638.html
Comment 6 Jerome 2015-06-28 10:31:47 UTC
(In reply to comment #3)
> [ forwarding from https://bugzilla.redhat.com/show_bug.cgi?id=1204967#c11 ]
> 
> It happened again: I rebooted, and when Claws Mail restarted the column
> widths were all wrong.
> [...]
> It should be quite possible to look for clawsrc.bak or clawsrc.tmp if
> clawsrc is missing when the program starts, and do this recovery
> automatically.

This is what I've done round about end of Feb.- which works fine (100%) for me (and not included here) logs all the times one or the other files are present/missing - hadn't though of redirecting stdout and stderr - will do so, just out of curiosity.

... but also after reading Paul's
> More than likely the result of not shutting down cleanly. 
I have progressively taken to clicking "Quit Claws-Mail" before shutting computer down, so bash-script is only really there as a failsafe.

=======
#!/bin/bash
if [ -f ~/.claws-mail/clawsrc.tmp ] && [ ! -f ~/.claws-mail/clawsrc ]
then mv ~/.claws-mail/clawsrc.tmp ~/.claws-mail/clawsrc 
fi

`/usr/bin/claws-mail &` 
=======

Note You need to log in before you can comment on or make changes to this bug.