Mageia Bugzilla – Attachment 3510 Details for
Bug 8725
claws-mail-newmail-plugin is not functional - Error: No such file or directory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Fix problem when ~/Mail does not exist
newmail_fix_maildir.patch (text/plain), 1012 bytes, created by
Yann Lejeune
on 2013-02-11 21:50:34 CET
(
hide
)
Description:
Fix problem when ~/Mail does not exist
Filename:
MIME Type:
Creator:
Yann Lejeune
Created:
2013-02-11 21:50:34 CET
Size:
1012 bytes
patch
obsolete
>diff --git a/src/newmail.c b/src/newmail.c >index aeb863f..92f5252 100644 >--- a/src/newmail.c >+++ b/src/newmail.c >@@ -110,6 +110,8 @@ gint plugin_init (gchar **error) > if (!LogName) { > auto size_t l; > auto char name[260]; >+ auto char maildir[260]; >+ char *d; > (void)snprintf (name, 256, "%s/Mail/NewLog", getenv ("HOME")); > l = strlen (name); > if (l > 255 || !(LogName = (char *)malloc (l + 1))) { >@@ -119,6 +121,18 @@ gint plugin_init (gchar **error) > return (-1); > } > (void)strcpy (LogName, name); >+ >+ (void)snprintf (maildir, 256, "%s/Mail/", getenv ("HOME")); >+ l = strlen (maildir); >+ if (l > 255 || !(d = (char *)malloc (l + 1))) { >+ *error = g_strdup (_("Cannot load plugin NewMail\n" >+ "$HOME is too long\n")); >+ plugin_done (); >+ return (-1); >+ } >+ (void)strcpy (d, maildir); >+ g_mkdir_with_parents (d, 0750); >+ > } > if (!(NewLog = fopen (LogName, mode))) { > *error = g_strdup (sys_errlist[errno]);
diff --git a/src/newmail.c b/src/newmail.c index aeb863f..92f5252 100644 --- a/src/newmail.c +++ b/src/newmail.c @@ -110,6 +110,8 @@ gint plugin_init (gchar **error) if (!LogName) { auto size_t l; auto char name[260]; + auto char maildir[260]; + char *d; (void)snprintf (name, 256, "%s/Mail/NewLog", getenv ("HOME")); l = strlen (name); if (l > 255 || !(LogName = (char *)malloc (l + 1))) { @@ -119,6 +121,18 @@ gint plugin_init (gchar **error) return (-1); } (void)strcpy (LogName, name); + + (void)snprintf (maildir, 256, "%s/Mail/", getenv ("HOME")); + l = strlen (maildir); + if (l > 255 || !(d = (char *)malloc (l + 1))) { + *error = g_strdup (_("Cannot load plugin NewMail\n" + "$HOME is too long\n")); + plugin_done (); + return (-1); + } + (void)strcpy (d, maildir); + g_mkdir_with_parents (d, 0750); + } if (!(NewLog = fopen (LogName, mode))) { *error = g_strdup (sys_errlist[errno]);
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 8725
: 3510