Problem with sending mail - 587.

Discussion in 'General' started by xciso, Jul 11, 2022.

  1. xciso

    xciso Member

    Hi. First I want to say that I have searched verry much but dont find a solution.
    I have a VPS Cloud at Hetzner. They block port 25 and 465, but 587 should be open.

    I used the auto installation of IspConfig "The perfect setup" with Debian 11 (Apache2).
    I opened the recommended ports in admin directly after installation. And now my big problem. I can receive mails but I cant send.
    I use Thunderbird as mail client, and I set outgoing (smtp) to port 587, StarTTLS, and my login and password.

    What can I do to get this to work? I followed some guide that I should enable submission in postfix conf but that didnt work.
    I tryed so much so I didnt know how it was from start so I reinstalled hole VPS two times.

    Please help!
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Hetzner Cloud systems installed by the auto-installer work out of the box, I installed several of them, Hetzner neither blocks ports (at least they did not do that a few weeks ago when I installed the last server) nor do you have to do any additional changes. You mentioned that you manually altered the postfix config, this has to be undone first to ensure you have a working setup again.

    Then you can start to find out what you do wrong. Most likely the issue is not the server here, more likely you use wrong settings in the mail client or you did not set a correct hostname (a subdomain of one of your own domains) before you installed the system.

    Check your Thunderbird settings, the username is the complete email address. So if your email address is [email protected], then your username is also [email protected], thunderbird has the bad habit to sometimes strip the domain part, so check that again. It is important to not leave out the domain part, you will not be able to send without it! The SMTP and IMAP server name is the hostname of your server.

    If you are still not able to send, then take a look at the mail.log file to see which exact messages get added there when you try to send an email. And run the test script and post the result: https://forum.howtoforge.com/threads/please-read-before-posting.58408/
     
  3. xciso

    xciso Member

    Hi. Thanks for your super fast answer. First I tested without to change postfix conf of course.
    I have another VPS today in Sweden with IspConfig and that has always worked perfect. Sadly that VPS is verry expensive and thats why I will change to Hetzner.

    When this didnt work i start searching and find that Hetzner block 25 and 465 for cloud (not dedicated) servers. I also talk to them if they could open up the others but they dont do that. 587 is still open.

    My server has hostname example.com, then I set up a client "test" and then I made DNS, website, and email for test.com ([email protected])

    In thunderbird i set as smtp:
    Port 587
    StarTTLS
    login: [email protected]
    Pass: same pass as the mail account i set in admin

    Do you mean that I should use example.com as smtp for all my clients?
    Can you explain what you mean with:
    "or you did not set a correct hostname (a subdomain of one of your own domains) before you installed the system."
     
  4. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    You can't run a standalone mail server without port 25 open. You could setup a secondary server and relay outbound mail through it, or find a mail delivery service which provides that; otherwise you need a different hosting setup.
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    I just had a look at the Hetzner website and the indeed started blocking some ports recently, but you can let them unblock them. From their site (translated):

    That is quite reasonable in my opinion as there is a lot of misuse of cloud systems for spam sending, other cloud providers block email traffic completely and you can't get it unlocked.
    So all you have to do is to wait until the end of the first month and then contact them again.

    The server hostname should be a subdomain, e.g. server1.example.com and not example.com, otherwise you would not be able to use the domain example.com for some services on the system anymore.

    You should use the hostname, which is not example.com but a subdomain of your domain. if you used example.com, then you must fix that as mentioned above. And yes, this is used by all clients as that's the name of your mail system, and all SSL certs on the system incl. dovecot and postfix use that name. using a subdomain of customer domains is possible when you set it up manually, but it would limit your company growth as you can just have a few clients then until you reach max domain limits in the SSL cert plus SSL cert failures and system outages are way more likely if you would use a different setup, that's why systems that are made as hosting servers commonly not use subdomains of customer domains for accessing the mail system.
     
    ahrasis and Th0m like this.
  6. xciso

    xciso Member

    Hi. My hostname is of course server1.example.com and not just example.com as i wrote before. I send a new question to Hetzner to see if they could open up the port. I made this server for 3-4 months ago so I really hope they can open it up.

    When they have opend up the ports (if they do that) you recommend to use smtp domain from server like example.com and not client1.com, client2.com etc...

    Do I need to make any DNS settings then for each client? Today I have separate smtp for each client, but like you say its maybe better that everyone use the same smtp domain. Will it work if I then use username@clientdomain and then smtp example.com
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    You did not write that, that's why I mentioned it. But if you use the correct hostname incl. subdomain and not just example.com, then that's fine.

    The domain of the client needs an MX record that points to the server hostname (or a subdomain of the clients domain which points to the server IP as A-Record).

    This works, of course. Otherwise, it won't be used by most mail systems. The username to authenticate at the IMAP and SMTP server and the domain that is used to connect to the mail system are not connected to each other.
     

Share This Page