How to send email to specifix MX server?

5,816

If you have the following setup...

Existing MX for example.com has smtp1.example.com as the server for the domain.

The new SMTP server is smtp2.example.com (and that's what will be in the domain's MX set after migration).

You can send a test message to the new server using

swaks --to [email protected] --server smtp2.example.com

If you've got multiple new SMTP servers, just test them one by one.

If the thing you're trying to test is a new DNS zone with new MX records then that should just be a matter of changing the client's DNS config to point at the the DNS servers.

Share:
5,816

Related videos on Youtube

schube
Author by

schube

Updated on September 18, 2022

Comments

  • schube
    schube almost 2 years

    I want to send an email to an specific email server. The MX records of the domain do NOT point to this server, but the receiving server is configured to receive emails of the domain under test, let's say [email protected]

    (Background: This is a migration scenario. We are using the old mailserver and want to switch to the new one as soon it is working as expected)

    Now, when I use my Linux/Mac/Windows client from a dial up line, how can I directly send an email to the MX? I guess most email servers are configured to not accept emails from dial-up lines, right?

    I cannot use the SMTP server of my provider, because this server would send my emails to the official MX of this domain which points to somewhere else.

    How can I send test mails?

    Thank you, schube

    • Aaron Hudon
      Aaron Hudon about 7 years
      Depends on your client and local MTA. If you have a client which specifies the SMTP server you can just point it to the alternative server address. If your mail generating client not use SMTP but calls the local mail delivéry system you just have to reconfigure this to use another host. In the easy case you would sent all mail tomthat server (the config option for that is called smart host). But you can also defining routing rules where you define for a list of domains a target server.
    • Aaron Hudon
      Aaron Hudon about 7 years
      If it is only about a single test mail you can also use telnet or configure a new mail server account in your mail client.
    • Paul Haldane
      Paul Haldane about 7 years
      For simple testing (a bit more convenient than using telnet) SWAKS (Swiss Army Knife for SMTP) is your friend - jetmore.org/john/code/swaks
    • schube
      schube about 7 years
      I could/want to use Swaks, but there I have to provide an SMTP server. This SMTP server would use the official MX records for mail delivery.
  • schube
    schube about 7 years
    Thank you! I had the missconception that I have to use somehow a username/password and didn't know how to use it. This was an info from the the server administrator which totally confused my. Everything works find now!