mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #596] Not able to relay using GMail #383
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#383
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ppuri on GitHub (Dec 20, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/596
First of all, thanks a ton for this wonderful tool.
I am trying to use it an SMTP sink in dev environment and then relay to real email id using GMail SMTP for customer testing, so that they can receive the actual email as well.
I have setup Gmail with an App Password and have setup a relay.yaml with settings given in documentation as below
and then starting mailpit with this command
However, when it comes to relaying Mailpit throws this error in log
To isolate if this is Mailpit issue or Gmail issue, I configured sendmail in xampp using the exact same config (same username/ password/ port), and sendmail is able to send the email using these settings. After this test, it appears that Mailpit is perhaps using a different way to authenticate to Gmail as compared to what sendmail is using.
Is it something that can be fixed please?
@ppuri commented on GitHub (Dec 21, 2025):
Since I reported this issue, I have been trying alternate solutions and I have got one approach working now for relaying emails from Mailpit via Gmail SMTP.
So, I have setup an hMailServer locally and using that to relay using Gmail, which worked straight away. And then setup Mailpit relay to hMailServer running on localhost:25 and Mailpit liked it 👍.
However, this obviously needed some research and extra setup, it would be ideal if Mailpit can be fixed to honour Gmail SMPT settings directly without need of another proxy.
@axllent commented on GitHub (Dec 21, 2025):
Ho @ppuri. I haven't tested this... but it should work. What I know about Gmail is that it won't accept the "from" unless it is already preconfigured in your profile (to avoid spam being relayed), which is what I believe you are trying to do by setting the
from: my-gmail-id@gmail.comvalue in your configuration. Assuming this is correct, then this will be the issue here - it's not calledfromin Mailpit, it'soverride-from: my-gmail-id@gmail.com. See https://mailpit.axllent.org/docs/configuration/smtp-relay/Please confirm if this solves your issue?
@ppuri commented on GitHub (Dec 21, 2025):
@axllent Thanks for your reply. This was definitely an oversight on my end to use
from:instead ofoverride-from:. However changing that alone did not fix the issue. However, it made me review all the other settings for smtp-relay. Finally, I have got it working. It worked after I also usedauth:andreturn-path:as well in the configThanks to your message, as it forced me review all the settings again and make it work.
Below is the final yaml, that worked
@axllent commented on GitHub (Dec 21, 2025):
Excellent, thanks for the feedback. Yes, if the
reply-tois set in your email and does not align with the configured email address(es) in Gmail, then Gmail will probably block you too.