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

Sender match matches on from vs sender header #35

Open
echiugoog opened this issue Jul 28, 2020 · 3 comments · May be fixed by #66
Open

Sender match matches on from vs sender header #35

echiugoog opened this issue Jul 28, 2020 · 3 comments · May be fixed by #66
Labels
enhancement New feature or request

Comments

@echiugoog
Copy link

For example an email with:

Expected match would be on the "Sender" header when using "sender" matcher vs matching on the "From" header

@ranmocy ranmocy added the enhancement New feature or request label Jun 5, 2021
@mlsad3
Copy link
Contributor

mlsad3 commented Jul 30, 2022

I'm not sure if this is related, but I noticed that the sender gets both from and reply_to assigned to MessageData.sender:

        this.sender = ([] as string[]).concat(this.from, this.reply_to);

But then it never uses it in condition.ts:

            case ConditionType.FROM: {
                return this.matchAddress(message_data.from);
            }
...
            case ConditionType.SENDER: {
                return this.matchAddress(message_data.from); // Would expect 'message_data.sender'
            }

Is this expected or a accidental copy/paste issue?

For backwards compatibility, I doubt you will be able to implement @echiugoog's wish exactly. Instead, MessageData.sender would include all of:

  • reply_to
  • from
  • sender
  • X-Original-Sender

This is similar to functionality you have in receiver:

  • to
  • cc
  • bcc
  • list

@mlsad3
Copy link
Contributor

mlsad3 commented Jul 30, 2022

I'm not sure what kind of time I can put into this, but if I can get my environment up, I'll also see if we can use getHeader() instead of getRawContent() (and maybe try switching it out for the parseListId as well...but I suspect you used getRawContent() since it maybe isn't a "RFC 2822 header".

mlsad3 pushed a commit to mlsad3/gmail-automata that referenced this issue Aug 5, 2022
Currently Sender only matches on 'from'. This resolves Issue ranmocy#35
by making Sender match:
 - reply_to
 - from
 - sender
 - X-Original-Sender

This is similar to the functionality we have in `receiver`,
which matches 'to', 'cc', 'bcc', and 'list'.

We also speed up analysis by switching from getRawContent to
getHeader.
@mlsad3 mlsad3 linked a pull request Aug 5, 2022 that will close this issue
@mlsad3
Copy link
Contributor

mlsad3 commented Aug 5, 2022

Okay, I've created PR #66. Try it out! :)

mlsad3 pushed a commit to mlsad3/gmail-automata that referenced this issue Aug 6, 2022
Currently Sender only matches on 'from'. This resolves Issue ranmocy#35
by making Sender match:
 - reply_to
 - from
 - sender
 - X-Original-Sender

This is similar to the functionality we have in `receiver`,
which matches 'to', 'cc', 'bcc', and 'list'.

We also speed up analysis by switching from getRawContent to
getHeader.
mlsad3 pushed a commit to mlsad3/gmail-automata that referenced this issue Aug 16, 2022
Currently Sender only matches on 'from'. This resolves Issue ranmocy#35
by making Sender match:
 - reply_to
 - from
 - sender
 - X-Original-Sender

This is similar to the functionality we have in `receiver`,
which matches 'to', 'cc', 'bcc', and 'list'.

We also speed up analysis by switching from getRawContent to
getHeader.
mlsad3 pushed a commit to mlsad3/gmail-automata that referenced this issue Aug 19, 2022
Currently Sender only matches on 'from'. This resolves Issue ranmocy#35
by making Sender match:
 - reply_to
 - from
 - sender
 - X-Original-Sender

This is similar to the functionality we have in `receiver`,
which matches 'to', 'cc', 'bcc', and 'list'.

We also speed up analysis by switching from getRawContent to
getHeader.
mlsad3 pushed a commit to mlsad3/gmail-automata that referenced this issue May 3, 2023
Currently Sender only matches on 'from'. This resolves Issue ranmocy#35
by making Sender match:
 - reply_to
 - from
 - sender
 - X-Original-Sender

This is similar to the functionality we have in `receiver`,
which matches 'to', 'cc', 'bcc', and 'list'.

We also speed up analysis by switching from getRawContent to
getHeader.

The MessageData.list now also includes the header 'List-ID' if it cannot
find a 'Mailing-list' header. This has been seen in a small sample of emails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants