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

[Feature Request] Field for X-Original-To #604

Closed
dartrax opened this issue Jul 1, 2021 · 4 comments
Closed

[Feature Request] Field for X-Original-To #604

dartrax opened this issue Jul 1, 2021 · 4 comments
Labels
enhancement This will enhance this library.

Comments

@dartrax
Copy link

dartrax commented Jul 1, 2021

Is your feature request related to a problem? Please describe.
I've seen mails where the recipients address is not in the "To" or any other field of the email header, only in the "X-Original-To". As an example, the notification mails I receive from github. May be it occurs when a mail was sent only using bcc?

Describe the solution you'd like
I'd like to have the X-Original-To available like this:
$email->x_original_to

Describe alternatives you've considered
May be I've overseen something, but the only way I could find was to parse the headersRaw like so:

if (preg_match('/(X-Original-To:\s)(\S*@\S*)/', $email->headersRaw, $matches))
    $xoriginalto = $matches[2];
@dartrax dartrax added the needs investigation This will be tested / debugged or checked out. label Jul 1, 2021
@Sebbo94BY Sebbo94BY added enhancement This will enhance this library. and removed needs investigation This will be tested / debugged or checked out. labels Nov 19, 2021
Sebbo94BY pushed a commit that referenced this issue Nov 25, 2021
@Sebbo94BY
Copy link
Collaborator

I've added this header property. It's currently only on the develop branch.

@dartrax Can you please check, if it's properly working for you as I don't have any example to test?

$email->xOriginalTo

Sebbo94BY pushed a commit that referenced this issue Dec 14, 2021
@dartrax
Copy link
Author

dartrax commented Dec 14, 2021

Hi @Sebi94nbg,
thanks for implementing that! I've tested it today with two different mails and so far it worked!
I'll use it in my personal mail filter/forwarding script from now on so it'll see nearly every mail I get and I'll report when I encounter any issues.

@Sebbo94BY
Copy link
Collaborator

Great. Thanks for testing and your feedback! :)

I'll hopefully find this week the left time to fix the current pipeline issues and then I'll publish this change in a new release. :)

@Sebbo94BY Sebbo94BY mentioned this issue Dec 27, 2021
@Sebbo94BY
Copy link
Collaborator

This change is included in the release 4.3.0 and newer.

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

No branches or pull requests

2 participants