-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachments ignored if BODYSTRUCTURE does not contain content disposition (Mercury/32 server) #7214
Comments
|
Sounds like a duplicate of #7122. |
|
On the other hand, it works for me in git-master. Maybe fixed with #7117. |
|
Hi, thank you very much for your answer. While this inconvenience may be similar to that reported in #7122 it is somewhat different. In #7122, I understand, the inconvenience occurs when responding to emails and attaching files. In my case, the attachments are not shown in the email view either as a preview or as a new window. But, the particular thing is that if I have forwarded that email (of which I don't see the list of attachments), in the compose window appears the list with the attachment. That as it with RC version 1.4.2 downloaded on 01/07/2020. Today, after your response referring to #7117, I downloaded the updated version (as of today, 02/08/2020) and not only that the problem reported is not solved but that now the list of attachments is not shown when trying to resend the email. Jorge |
|
As I've said, it works for me. What exactly did you download? git-master? |
|
Hi, I downloaded the correct version? But I preserves the my own config and plugins. Could there be any conflict with some plugin? TIA Jorge |
|
Full message source, please. |
|
Hi Alec, With Content-ID version: WITHOUT Content-ID version: As you can see, both emails have the same content, and in what they differ it is only in the definition block of the attachment, that one (the first, which malfunctions) has the Content-ID field while the other (the last, that works well) doesn't have it. Attached both files. Thanks in advance. |
|
It works for me. What IMAP server are you using? Enable imap_debug and check in the log what the server returns in BODYSTRUCTURE response. |
|
Hi, Attached you will find the requested log. I have extracted the specific part that corresponds to my work session in which, once imap_debug was enabled, I first checked the email "with problems" (the one that does not show the image) and then the one that normally shows it. The attached file contains all the complete sequence I debugged. Do you need any additional information? Thanks in advance. |
|
So, we're talking about this: Your server does not return Content-Disposition definition in the structure. The image part should look like this: This is the main problem here. I have an idea how we could workaround that. I'll work on this. |
|
This has nothing to do with skins. The fix would have to be in I investigated a bit and it does not look that easy to fix without breaking other things. In a way it is related to #5051. |
|
I get it. I will wait for you to find some solution to the problem. |
|
I would like to clarify one point. |
|
Not really. The issue here is that your specific server ignores the Content-Disposition header (and do not pass it to Roundcube), which is one of the ways to decide whether an email part is attachment or inline. Without this information we have to make assumptions. And indeed we treat the image as inline in this case because of Content-Id existence. I'm not saying we cannot improve the logic on Roundcube side (it's not perfect and some tickets for this already exist). But when I investigated the code I found contradictory code branches that try to workaround email client bugs, like for example sending inline attachments inside mixed parts. So, if we try to fix one thing another might stop working. So, we have to be careful and find a good compromise or a proper solution if at all possible (which might involve a bigger refactoring). The ticket I pointed on before is exactly about one of the possible solutions also for this case. Treat all attachments (images) that aren't referred in the HTML body as non-inline parts. |
|
Hi Alec, According to your answer, I was reviewing the code of the rcube_message module and I was able to adapt it to solve the consulted problem, at least temporarily until there is officially a definitive solution. I do not know much about the complete system or its characteristics, so it is very likely that the solution adopted is not the best or technically correct, so if it is possible that you or someone else has a better approach, please let me know. For the moment and as far as I have been able to test, with the modification made I solve the problem and do not introduce any side effects (until they appear!;)) The modification made consists of the following: In rcube_message::parse_structure(), between lines 845 and 846 add: My explanation: I will appreciate any suggestion or comment that anyone can make. |
|
I was thinking more in the line of: --- a/program/lib/Roundcube/rcube_imap.php
+++ b/program/lib/Roundcube/rcube_imap.php
@@ -2189,10 +2189,6 @@ class rcube_imap extends rcube_storage
// get part ID
if (!empty($part[3])) {
$struct->content_id = $struct->headers['content-id'] = trim($part[3]);
-
- if (empty($struct->disposition)) {
- $struct->disposition = 'inline';
- }
}
// fetch message headers if message/rfc822 or named part (could contain Content-Location header)
but this of course has implications and requires more consideration. |
I have a customer that can't view PDF inline attachments in Roundcube (1.4.6) in an HTML message, that originates from a Microsoft SMTP Server mail server. We can't provide the full E-Mail headers unfortunately or a stripped version of it due to privacy per the customer. I did try the patch mentioned above temporarily just to see if that would fix it and it does. The PDF and other attachments (JPG) does show. Since it is not a official patch, I reverted. |
|
I have this problem on 1.4.10. Is it still this old problem, or new regression? |
|
I have the same problem on 1.6.0 where an email with a JPEG attachment has a Content-ID causing it not to display or be downloadable. |









Hi,
Since updating Roundcube from version 1.3.6 to 1.4.2 I have problems with
some emails from GMAIL generated from a mobile phone with an attached image.
When viewing the email, Roundcube does not detect that it has an attachment,
but if I reply or forward that email it does.
I have detected that the problem appears when the attachment has a
"Content-ID:" valued header and is not used as an inline image.
For example, if the attached image is defined like this, Roundcube does not
detect the attachment:
On the other hand, if it is defined without Content-ID, Roundcube does
detect the attachment and preview the image:
A simplified version of the raw email to reproduce the problem is as follows:
Has anyone had this problem? Could you solve it? Is it a program problem or
something that I have configured incorrectly?
Thanks in advance.
Jorge
The text was updated successfully, but these errors were encountered: