It is a standard for email providers' SMTP addresses to be in the default: smtp.provedor.com?

Asked

Viewed 180 times

3

There may be an email provider that uses an address SMTP that does not start with smtp.?

Or is there a rule that doesn’t allow servers to be configured SMTP out of this pattern.

Because I am implementing an email configurator in my project that allows the user to enter the address SMTP of the provider at hand completely, without any kind of validation at the entry of the same.

So I wonder if I can create some kind of preconfiguration, or block that prevents the user to enter with something totally absurd.

For doing some tests here with the library Javamail (in a version a little more lite, because my implementation is in android) making attempts to send email using a host of the kind: gshshd.gdhfj.com, it takes about 3 minutes to return to Exception for my application, which is not a good user experience. I have tried in a host of the kind: smtp.gfdga.com, he returns to Exception almost instantly for my application.

I would like to perhaps even allow host who do not start with smtp., if that’s a rule.

3 answers

4


Yes, there may be email servers that do not use smtp. prefix - mail. being one of the most used.

If you want to know what is the name of the email server of a given domain, see the MX record of it. The following Java code (using dnsJava) can get you that information:

private Record[] lookupMxRecords(final String domainPart) throw TextParseException
{
    final Lookup dnsLookup = new Lookup(domainPart, Type.MX);
    return dnsLookup.run();
}
  • But there is a pattern, even if it is: smtp. or .mail, or it could be anything, like the example I quoted in the question?

  • A pattern per use, perhaps - smtp, mail and the like are an example. Default by specification, no: a server called patolino.looneytunes.com may be a valid entry.

  • 1

    so in my case I can not do a validation and no restriction on user input. What I can try is to check before on MX as you quoted.

3

I believe it is not a standard, just a conventional practice. In RFC974 does not impose such restriction as long as the address. :)

0

The name of the subdomain or host is irrelevant. Just be sure to set up in the DNS zone properly as an MX zone.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.