2

I have setup a post.io mail server on a server and configured it towards a domain I own.

By running the first example in their documentation

docker run \
     -p 25:25 \
     -p 80:80 \
     -p 443:443 \
     -p 110:110 \
     -p 143:143 \
     -p 465:465 \
     -p 587:587 \
     -p 993:993 \
     -p 995:995 \
     -e TZ=Europe/Prague \
     -v /your-data-dir/data:/data \
     -t analogic/poste.io

Then I was able to reach to a dashboard in localhost and send emails through GUI.

But I did not know exactly which one is the SMTP domain. This is the python snippet I used:

smtpObj = smtplib.SMTP(NO_IDEA_WHAT_TO_PUT_HERE, 587)
    smtpObj.ehlo()
    smtpObj.starttls()
    smtpObj.login(SENDER, EMAIL_PASSWORD)
    msg = MIMEMultipart()
    msg["Subject"] = SUBJECT
    msg["From"] = SENDER # me!
    msg["To"] = RECIPIENT
    msg['Date'] = formatdate(localtime=True)
    email_body = MIMEText(SOMETHING, 'html')  # text
    msg.attach(email_body)
    smtpObj.send_message(msg)
    smtpObj.quit()

The variable NO_IDEA_WHAT_TO_PUT_HERE was set on mail.poste.io but I get a raise SMTPAuthenticationError(code, resp) smtplib.SMTPAuthenticationError: (535, b'5.7.8 Authentication failed')

Then I consequently tried MY_DOMAIN and mail.MY_DOMAIN. Also here, without any success.

Then I noticed another part of the documentation and tried another command:

docker run \
    --net=host \
    -e TZ=Europe/Prague \
    -v /your-data-dir/data:/data \
    --name "mailserver" \
    -h "mail.MY_DOMAIN" \
    -t analogic/poste.io

Though now I cannot connect on local either as it mentions: sudo: unable to resolve host mail.MY_DOMAIN: Name or service not known

As poste.io claims that you can run your own SMPT server, shouldn't the SMPT server be something like mail.MY_DOMAIN? And in that case, how exactly can I connect?

In "usual" email providers this is also solved through a app-developer third-party, and a new token is generated. At least, this was my experience with most cloud providers: Gmail, OutLook, Yahoo, GMX and FastMail.

Any insight in how to run it correctly? What am I missing here?

purple_lolakos
  • 456
  • 5
  • 15

0 Answers0