Is the SMTP addresses of email providers default to: smtp.provedor.com?

3
  

Can there be an email provider that uses a SMTP address that does not start with smtp. ?

     

Or there is some rule that does not allow SMTP servers to be configured outside this standard.

Because I'm implementing an email configurator in my project that allows the user to enter the SMTP address of the provider at hand, without any type of validation at the entry.

  

So I would like to know if I can create some sort of preconfiguration, or blocking that prevents the user from entering something totally absurd.

Well, doing some testing here with the JavaMail library (in a slightly more lite version because my implementation is in android) making e-mail attempts using a host of type: gshshd.gdhfj.com , it takes about 3 minutes to return Exception to my application, which is not a good experience for the user. I've already tried a host of type: smtp.gfdga.com , it returns Exception almost instantly for my application.

  

I would like to be able to even allow hosts that do not start with smtp. if this is a rule.

    
asked by anonymous 14.03.2014 / 21:24

3 answers

4

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

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

private Record[] lookupMxRecords(final String domainPart) throw TextParseException
{
    final Lookup dnsLookup = new Lookup(domainPart, Type.MX);
    return dnsLookup.run();
}
    
14.03.2014 / 21:31
3

I do not think it's a standard, just a conventional practice. At RFC974 does not enforce this restriction while at the address. :)

    
16.03.2014 / 17:07
0

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

    
16.03.2014 / 06:26