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

302 redirection for inbound email handling for real emails using Mailgun #109

Open
Tiththa opened this issue Jul 21, 2022 · 3 comments
Open

Comments

@Tiththa
Copy link

Tiththa commented Jul 21, 2022

I am using laravel-mailbox on laravel 8 with mailgun driver. I only need to simply forward the email message. The setup works fine and successfully forwards the email as expected when using mailgun sample webhook but not with realworld emails. When an email is sent from gmail or other medium to the mailgun domain configured, application redirects with a 302
image
image

to the root domain. I have tried clearing cache also adding the route laravel-mailbox/mailgun/mime to exclude csrftoken in the middleware, but no luck. Has anyone encountered this? Any help is greatly appreciated.

@joelharkes
Copy link

@Tiththa can you share some code of your setup?

@timstl
Copy link

timstl commented Oct 8, 2024

Hello,

I was wondering if anyone ever found a solution to this problem? I have the same issue: Mailgun's sample POST responds with status code 200 and is processed by Mailbox, but the actual route ends up with a 302 redirect to the base URL /.

  • Laravel 11 w/ Jetstream; Otherwise barebones application
  • Using Expose to test locally
  • Mailgun route points to the Expose URL
  • Tested multiple types of Mailgun routes (specific TO address, catch all, etc)
  • Local environment has been tested with both localhost and the Expose URL as the APP_URL
  • Tried Expose URL as both HTTP and HTTPS in the route (and made sure APP_URL matches)
  • The Laravel Mailbox catchAll implementation is never invoked. It does invoke with the sample post from Mailgun.

My initial guess was that Expose was causing some kind of issue, but I'm confused why the sample POST would work and not the actual route implementation. Anyone know what I'm missing?

Thanks,

Tim

@timstl
Copy link

timstl commented Oct 9, 2024

If anyone else has this issue, it's caused by a setting in your Mailgun route (at least in my case). Using the Forward option instead of Store and notify works. Both methods post the data to the Laravel Mailbox route, but with Store and notify the MailgunController in Laravel Mailbox is never invoked. So I'd personally consider this a closed issue for this repo if it's not expected that Store and notify would be supported.

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

3 participants