Skip to content
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

Creator/Modifier of msg file is interfering the identification of the sender email address #77

Open
sanastasiadis opened this issue Apr 18, 2024 · 2 comments

Comments

@sanastasiadis
Copy link
Contributor

In OutlookMessage, in the method setProperty, all the following properties are considered to identify the sender email address, leading to setFromEmail:

  • 0xc1f - Sender email
  • 0x65 - Sent repr email
  • 0x3ffa - Creator2, Last modifier name

(According to: fileformat.info, exchange server protocol)

I think that 0x3ffa property has to be excluded from this check, as the sender is not the same person as the creator/modifier of the msg file.

On top of this, even if the message contains all the above 3 properties, if one of them includes a value in X500 data, it will not be taken into consideration, as setFromEmail forces the value set to always contain "@".

sanastasiadis added a commit to sanastasiadis/outlook-message-parser that referenced this issue Apr 18, 2024
1. the property 0x3ffa refers to the creator/last modifier of the message object and it may be unrelated to the sender of the message.
2. the setFromEmail must allow X500 data if the variable is null (and removed unnecessary/duplicated check for "@")
@bbottema
Copy link
Owner

bbottema commented Apr 19, 2024

We have a regex somewhere that detects x500 address and since very recently we have a separate field for x500 address in Recipient (see #73 and #75). Perhaps we should have that check here as well, so we don't overwrite an email address if it is present.

@sanastasiadis
Copy link
Contributor Author

sanastasiadis commented Apr 19, 2024

I agree, it's good to have the regex check.

However, in my PR I still use the "force" flag so the occasional normal email address does not get overwritten. The fromEmail will be updated:

  • if the force flag is true (the incoming address includes "@")

OR

  • if the existing value is null (it may contain either a normal email address or X500 data)
if (force || this.fromEmail == null) {
	this.fromEmail = fromEmail;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants