-
Notifications
You must be signed in to change notification settings - Fork 133
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
issue with link and redirect #254
Comments
Hi @ivang76 |
thanks for the prompt reaction @mirkos93 I'm checking the regex in the function you pointed out, to debug the regex, but I'm noticing a strange thing... the (at the moment as I said I'm forcing that |
Ciao @ivang76 If instead only |
thanks again @mirkos93 so, the $tracker is not empty and I extended the SentMail wiith something like this:
but then I also removed temporary the anonymize function, but still it doesn't work. I don't know, I'll try to do other debug but I'm a bit stuck now. |
@mirkos93 Indeed I'm noticing that the 'content' is null on all the newsletter sent, even in the older ones in the previous years. |
I remembered, the content set to null is correct because stems from the log-content attribute in the configuration file, which I set to false years ago. |
You might be right, we may have to disable the click link tracker if you don't save the content since that was added for security reasons. If someone wants to submit a PR for that, please feel free to. I might be able to look at it but probably after the first of the year would be the soonest I'll get a chance. |
Hi @jdavidbakr I haven't yet found a proper solution and at the moment I'm still forcing in your MailTrackerController.php to return |
I think the solution has to be to disable the link rewrite if the email content is not being saved. I'd be happy to accept a PR if you have time to look at it. |
ok @jdavidbakr, done, let me know. Thanks! |
Thanks for the PR, however that change defeats the purpose of why we're checking the sent mail in the first place - to prevent your site from becoming a relay for malicious links. The solution needs to be for the tracker to not rewrite any links if the content is not being saved. |
Ok, I see... It would probably be quicker if you worked on a solution yourself at this point, since you know the project and the best approaches better. But if you don’t have time, I’ll give it another try. Could you point me in the right direction to avoid rewriting the link? |
@jdavidbakr thank you for this excellent package.
Logic |
Hi @Khuthaily thanks for your contribute to this topic. Yes, I know about the domains returned by the getDomainsInContextAttribute, but since I'm using this package in a webapp that lets the editors create custom newsletter with a lot of news inside, it's really difficult to coverall the possible domains. |
@jdavidbakr & @ivang76 ... I have just submitted this PR. |
I quickly saw the PR @Khuthaily. It is definitely a useful step forward, so thank you! However, in cases like mine (no logged content and a list of possible domains that is too big and varied to be predefined by the developer), it would not fully fix the problem. Let’s see if @jdavidbakr can expand and improve the solution to cover all cases... |
Hi there,
I’ve been using your package for a while without any issues, on a Laravel 9 and PHP 8.1 environment.
Now I’ve updated to Laravel 11, PHP 8.3 and the latest version of your package (previously it was the 6), and I’ve noticed that when a user follows a link received in the newsletter, they are no longer redirected to the target URL. Instead, they always fall back to the home page of the web app.
For example, if in the newsletter I have a link like this:
https://mainurl.something/email/n?l=https://www.github.com/jdavidbakr...
when the user clicks on it, they end up at https://mainurl.something instead to reach your github page.
Do you have any advice on what to check and debug? Have you encountered anything similar with this configuration?
thanks!
update:
I'm debbuging the linkClicked function in your MailTrackerController.php and I notice that the tracker->domains_in_context is empty so the flow fail in the
return redirect(config('mail-tracker.redirect-missing-links-to') ?: '/')
if I force a
return redirect($url);
the behaviour is correct.I read something about the domains_in_context added to the SentEmail in a previous PR #248 by @mirkos93. In my project I needed to anonymize the recipient_email in the SentEmail model, could this create any problems?
The text was updated successfully, but these errors were encountered: