Why are many mail servers using subdomains like mail.example.com?

114

Solution 1

The main reason to use a domain like mail.example.com or smtp.example.com to enable moving it without impacting other services running on the main domain. Only computers should be looking up the SMTP server, and that will be using the MX record for example.com Your users may need to provide the domains when setting up their client, but many (most?) will guess correctly based on their [email protected] email address.

With very few exceptions, only spambots use a second level (example.com), almost always spoofed, domain. The few legitimate servers using domains like example.com are usually broken in several other respects as well. Using a second level domain can contribute to the spam score for mail you are sending.

Professional administrators use dedicated sub-domains for mail services. In most cases, this will be a sub-domain that does not reflect the name of server on which the service is running.

I haven't had any problems sending or receiving SMTP mail on my server with a self-signed cert. The connecting site already knows it has the correct site based on your MX record. Recently, I have had a couple of servers fail on the startTLS command, but they reconnected without TLS. I believe they were using SSLv3 and got rejected on that basis, rather than a CA basis. A review of the most recent failures shows that spambots are disconnecting incorrectly generating errors. A significant portion of my email traffic is now TLS encrypted and there is no problems the certificate from my self-signed CA.

Using trusted certificates is one way to authenticate co-operating servers within a domain. However, you would want to either restrict the signed domains or use a private (self-signed) CA. There are other cases, such as a VPN, where you might also use a private CA.

Where you may run into issues is with Dovecot, but it will be your users who will be connecting. This is not a service for the general public to use. If you generated a CA to sign your certificate, you can make the CA certificate available to your users to import into their email client. This will resolve the issue.

You can get a signed certificate for free now. If not, the Let's Encrypt Certificate Authority should be available this fall. (It is now available.)

Solution 2

Just to correct @Ram.

MX record MUST NOT point to "example.com" as per RFC specifications. That is completely wrong. You must instead point an MX record to your "mail.example.com" record and point your "mail.example.com" record to your server IP.

Solution 3

By the past, i think many sys admins have chosen mail.example.com over example.com because they used to host the mail server on a different server with a different IP address than their web server by adding a different A record to mail.example.com

Today, all the major web hosting control panel (cpanel, directadmin, plesk...) setup all the services (http,ftp,smtp,imap,pop) on the same machine. Consequently, there is no need adding a subdomain since it would point to the same server IP.

Solution 4

A server is supposed to have a "fully qualified domain name" (see https://en.wikipedia.org/wiki/Fully_qualified_domain_name). In your example, calling it just "example.com" would be partially qualified because it's a domain name without a server name.

In practice, many spam filters treat any server that doesn't have a proper FQDN with a great deal of suspicion. Even a name of the form 123.123.123.123.example.com would probably get you blacklisted because it's obviously automatically generated and hence probably a temporary (virtual) machine used to avoid spam blocking filters.

So you have to call it something.example.com and the reason people use "mail" for the "something" is simply that it's memorable and easy to guess. If you create an email account in an email client it will sometimes guess this, saving the user the trouble of trying to find out the server name.

Solution 5

mail.example.com is not necessarily a subdomain.

mail.example.com is usually set up as an A and MX DNS records for mail to example.com

Share:
114

Related videos on Youtube

User
Author by

User

Updated on September 18, 2022

Comments

  • User
    User over 1 year

    Given the code below

    import pandas as pd
    import numpy as np
    import matplotlib.pyplot as plt
    
    from sklearn.mixture import BayesianGaussianMixture
    
    df = pd.read_csv("dataset", delimiter=" ")
    data = df.to_numpy()
    X_train = np.reshape(data, (10*data.shape[0],2))
    
    bgmm = BayesianGaussianMixture(n_components=15,
                                   random_state=7,
                                   max_iter=5000,
                                   n_init=10,
                                   weight_concentration_prior_type="dirichlet_distribution")
    
    bgmm.fit(X_train)
    logprob = bgmm.score_samples(X_train)
    pdf = np.exp(logprob)
    
    x = np.linspace(0, 1, num=20)
    plt.plot(x, pdf, '-k', label='Mixture PDF')
    plt.show()
    

    I get the following discrete pdf:

    enter image description here

    How can I plot a smooth continuous version of this pdf?

    Edit:

    Here is the the dataset:
    
    [[6.11507621 6.2285484 ]
     [5.61154419 7.4166868 ]
     [5.3638034  8.64581576]
     [8.58030274 6.01384676]
     [2.06883754 8.5662325 ]
     [7.772149   2.29177372]
     [0.66223423 0.01642353]
     [7.42461573 5.46288677]
     [0.82355307 3.60322705]
     [1.12966405 9.54888118]
     [4.34716189 3.63203485]
     [7.95368286 5.74659859]
     [3.21564946 3.67576324]
     [6.48021187 7.35190659]
     [3.02668358 4.41981514]
     [0.01745485 7.49153586]
     [1.08490595 0.91004064]
     [1.89995405 0.38728879]
     [4.40549506 2.48715052]
     [4.52857064 1.24935027]]
    
    • joeqwerty
      joeqwerty almost 9 years
      smtp.mail.example.com? - I don't think I've personally seen any of that. What I have seen is smtp.example.com, or mail.example.com, etc.
    • sleepless
      sleepless almost 9 years
      hink smtp.mail.yahoo.com - but still, why is it good use to use subdomains for emails?
    • Michael Hampton
      Michael Hampton almost 9 years
      You'll have a wide variety of serious problems if you name a server using the naked domain name. The first being that the server won't be able to tell what its domain is.
    • Robert Dodier
      Robert Dodier over 2 years
      Not sure what's going on, but try num=200 or something like that in the arguments for linspace.
    • User
      User over 2 years
      @RobertDodier: The pdf variable includes only 20 entries. So, choosing anything except num=20 yields to mismatch while plotting.
    • Robert Dodier
      Robert Dodier over 2 years
      Well, a Gaussian mixture is a continuous function, so you can add smoothness to the plot by evaluating it at many points, even if those parts are not in the data set. Anyway it wouldn't hurt if you would post the data set you're working with.
    • User
      User over 2 years
      @RobertDodier: I just added the dataset, if you check the edit.
    • Robert Dodier
      Robert Dodier over 2 years
      I don't think what's being plotted is the pdf of the GM; either you want to plot something else (not the pdf), or you want to plot the pdf, and you need to change the plotting stuff. I'll assume you actually do want the pdf, in which case what you need to do is construct a two-dimensional grid with more or less the same range as the data sample, and evaluate the GM pdf on that grid. You might want to only use a few bumps (let's say 2 or 3) if you have only 20 data points.
    • Ulises Bussi
      Ulises Bussi over 2 years
      I don't understand your data input is a Nx2 array and the you evaluate with some vector to try to see pdf?
    • User
      User over 2 years
      Right. I should have tried to create a bivariate pdf.
  • joeqwerty
    joeqwerty almost 9 years
    Technically an A record is a subdomain, but you're right in that most people don't think of them that way.
  • BillThor
    BillThor almost 9 years
    @joeqwerty example.com is a subdomain of com. example.com is one of several domains reserved for documentation. That aside, organizations with large server may farms under, may have subdomains under mail or smtp that they use for sending email. It is unusual, and not recommended, to name a host mail, in which case the domain name mail.example.com could be the FQDN (Fully Qualified Domain Name) of a host.
  • joeqwerty
    joeqwerty almost 9 years
    @BillThor: I was just pointing out that everything to the left of the TLD that is separated by a period is technically a subdomain. - com is a subdomain of . - example is a subdomain of com, - mail is a subdomain of example, etc., etc. While an A record of mail.example.com may be the FQDN of a host, it is in fact technically a subdomain of example.com. That being said, I've never personally seen a mail server with an A record of smtp.mail.example.com or anything like it. I have seen a lot of smtp.example.com and mail.example.com.
  • joeqwerty
    joeqwerty almost 9 years
    To clarify: I'm not referring to the name itself, I'm referring to it's position in the DNS hierarchy.
  • sleepless
    sleepless almost 9 years
    Thank you and all others for the explanation. It helped me a lot to set it all up properly.
  • Esa Jokinen
    Esa Jokinen almost 7 years
    Source RFC and section, please. RFC 5321, 5.1 "If an empty list of MXs is returned, the address is treated as if it was associated with an implicit MX RR, with a preference of 0, pointing to that host.", making MX to self unnecessary, not forbidden. If the domain doesn't accept mail at all there would be a "Null MX" No Service Resource Record, RFC 7505). RFC 2181, 10.3 explains why MX resource record must not be an alias.
  • Tyson Navarre
    Tyson Navarre over 4 years
    I disagree with @BillThor in his assertion that sub domains are almost exclusively used by spammers. From my own experience, this is a legitimate way to protect the reputation of a root domain if you are sending bulk email for any number of reasons. As a marketer sending newsletters or other types of marketing material, setting up a subdomain is a great way to protect your root domain from reputation issues.
  • BillThor
    BillThor over 4 years
    @TysonNavarre Spammers often don't use sub-domains for the sending hostname. It is rare that a legitimate sender does not use a sub-domain.
  • User
    User over 2 years
    Thanks, However when I run the code, it throws: sns.kdeplot(x=data[:, 0], y=data[:, 1], fill=True, ax=ax2) TypeError: kdeplot() missing 1 required positional argument: 'data'
  • JohanC
    JohanC over 2 years
    I tried this with the latest seaborn version 0.11.2
  • Faither
    Faither over 2 years
    In addition, please check the following serverfault.com/a/849232/345785 (MX record must not point to "example.com" as per RFC...)