Closed smeinecke closed 1 year ago
It is very strange. I wonder why two classes with the same attribute are added to the dparameters
array. Is this a bug in the PHP or I didn't understand something?
We probably should fix the getAttribute method to always use the last (and complete) element.
I agree with you, it should be fixed this way because the issue is directly related to extracting the attribute.
It is very strange. I wonder why two classes with the same attribute are added to the
dparameters
array. Is this a bug in the PHP or I didn't understand something?
I am not sure why imap_fetchstructure
does this. I just checked the documentation and it's not mentioned. I also checked the rfc2184 which shows this as valid writing of the parameter.
We probably should fix the getAttribute method to always use the last (and complete) element.
I agree with you, it should be fixed this way because the issue is directly related to extracting the attribute.
Cool, in commit https://github.com/liuch/dmarc-srg/pull/34/commits/45ad43daee52533ac4b1b0ef0d32814381694712 I changed getAttribute to return last found value.
Just out of curiosity, why is $this->structure
defined in MailMessage
? I did not found that its used anywhere.
Just out of curiosity, why is $this->structure defined in MailMessage? I did not found that its used anywhere.
I have no idea why I did this and I didn't find any mention of these changes in my git history. It seems to be the result of some kind of refactoring at the initial stage of implementation. So I can't satisfy your curiosity and mine. Thanks for pointing this out, I'll fix it.
Attachment extension check fails if a report is send by Mail::DMARC as the filename gets truncated:
As a hotfix, just check if filename in ifparameters is longer. We probably should fix the
getAttribute
method to always use the last (and complete) element.Later, I will add a PR to use mime_content_type if PHP fileinfo extension is found to get compression type instead of the file extension of the attachment.