Mailing List Archive

dbmail-export segfaults on one user, user has messages but cannot retrieve them via imapd or pop3d
I'm using 3.2.2 with this patch:

https://github.com/pjstevns/dbmail/commit/254b744e846dee11d6e2374166a4f96653d12c97

Something appears to be corrupt with one user's inbox and this is
causing dbmail-export to segfault.

dbmail-util does not seem to fix the problem.

The user cannot retrieve any mail via dbmail-imapd or dbmail-pop3d
although imapd does show messages available.

Other users are not experiencing any problem. So it would seem to be
something corrupt in the database for the one user.

I've attached an strace of dbmail-export.

Please advise. I would like to avoid loss of the e-mail that is available.

Thanks,

Lee.
Re: dbmail-export segfaults on one user, user has messages but cannot retrieve them via imapd or pop3d [ In reply to ]
On 03/16/2015 01:39 PM, Lee Howard wrote:
> Something appears to be corrupt with one user's inbox and this is
> causing dbmail-export to segfault.
>
> dbmail-util does not seem to fix the problem.
>
> The user cannot retrieve any mail via dbmail-imapd or dbmail-pop3d
> although imapd does show messages available.
>
> Other users are not experiencing any problem. So it would seem to be
> something corrupt in the database for the one user.

The dbmail-export segfault is fixed by the attached patch.
dbmail_message_retrieve() can return NULL, and this condition was not
being handled.

I note that a NULL return from dbmail_message_retrieve() is also not
handled in both src/dm_http.c and src/maintenance.c, but I did not
address these since my immediate use would not have allowed me to test
any code changes to there. I will leave that to you.

dbmail-util was not repairing the problem with the offending/corrupt
mail message.

To resolve the problem I merely had dbmail-export printf the
physmessage_id number of the message that caused
dbmail_message_retrieve() to return NULL (123258), and then I did:

MariaDB [dbmail]> delete from dbmail_physmessage where id = '123258';
Query OK, 1 row affected (0.07 sec)

Once that was done then my e-mail client was able to retrieve all of the
backlogged e-mail as normal and expected.

I am not entirely certain what was wrong with that one message. I did
note that:

MariaDB [dbmail]> select * from dbmail_partlists where physmessage_id =
'123258';
Empty set (0.00 sec)

Since I'm not an expert on the way dbmail expects a mail to be
represented in the database I'm not sure if that was the offending matter.

However, I would like to see dbmail-util resolve this condition. I
would much-prefer to just run dbmail-util than to run hard-code a printf
into dbmail-export and then delete a record from the database. What can
I do?

Thanks,

Lee.