o4oren / Ad-Hoc-Email-Server

An ad-hoc disposable temporary mail server. Create and use ad hoc disposable mailboxes for testing or any other purpose.
Apache License 2.0
379 stars 91 forks source link

Can't receive any email except from my domain #38

Open HideakiAtsuyo opened 3 years ago

HideakiAtsuyo commented 3 years ago

1) Setup(OK) 2) Go to the ip:port(OK) So, i tried to use it, it store the "tokens" but not the mailboxes(number is always to 0 in the home of the website) and when i try to send an email to example@mydomain.com with gmail i have: 550 5.1.1 example@mydomain.com: Recipient address rejected: User unknown in virtual mailbox table

(mydomain.com is for the example, it's not my domain)

Solved

HideakiAtsuyo commented 3 years ago

Can't receive any email except from my domain

rshmhrj commented 3 years ago

We were having similar issues with emails not reaching the instance. Hopefully the following may be helpful.

Situation

Problem

We tried adding additional SRV records, listening on every port you could think of (25, 465, 587, 2525, 143, etc.) and nothing successfully worked.

Solution

In searching, came across this post talking about how an email forwarding service Forward Email could make it work

Testing

Validated DNS propagation by looking here: https://www.whatsmydns.net/dns-lookup/txt-records?query=emailDomain.com&server=google and here: https://www.whatsmydns.net/#TXT/emailDomain.com

Next Steps

@o4oren it would be great if we could add some of these details in the README as it may be helpful for any others trying to set this up in a cloud environment which blocks port 25 -- please let me know if you think this makes sense. If it does, I can put it in a PR.

HideakiAtsuyo commented 3 years ago

We were having similar issues with emails not reaching the instance. Hopefully the following may be helpful.

Situation

  • Loaded AHEM onto a VM in GCP with vmDomain.com

    • Wanted this to be where users access the AHEM portal
  • Wanted to use different emailDomain.com for the email addresses

Problem

  • Was able to set MX records in emailDomain pointing to vmDomain's IP address
  • MX communicates solely on port 25
  • GCP blocks port 25
  • no emails were coming through

We tried adding additional SRV records, listening on every port you could think of (25, 465, 587, 2525, 143, etc.) and nothing successfully worked.

Solution

In searching, came across this post talking about how an email forwarding service Forward Email could make it work

  • set AHEM instance to listen on port 2525
  • ensured the following DNS records were set up (following the FAQ)

    • A record for emailDomain.com, www.emailDomain.com pointing to their normal location
    • A record for mail.emailDomain.com pointing to vmDomain.com's IP address
    • 2 MX records for mx1.forwardemail.net & mx2.forwardemail.net
    • TXT: forward-email-port=2525
    • TXT: forward-email=vmDomain.com
    • SPF (TXT) pasted from FAQ: v=spf1 a mx include:spf.forwardemail.net -all

Testing

Validated DNS propagation by looking here: https://www.whatsmydns.net/dns-lookup/txt-records?query=emailDomain.com&server=google and here: https://www.whatsmydns.net/#TXT/emailDomain.com

Next Steps

@o4oren it would be great if we could add some of these details in the README as it may be helpful for any others trying to set this up in a cloud environment which blocks port 25 -- please let me know if you think this makes sense. If it does, I can put it in a PR.

Thanks for you answer, btw my host don't block any port that's why i'm really confused they said it to me in a support ticket, with this the email will be send as "secure" email (ssl/tls) or i have to use an another port again?