Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


What Hostname to keep for Ideal Mail Delivery
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

What Hostname to keep for Ideal Mail Delivery

mehargagsmehargags Member
edited February 2015 in Help

Hello everyone...

I'm going on a bit of confusion...
Can you suggest in general case, what should we keep as out VPS Server's Hostname for a mulch-domain hosting ?

for eg: I have my domain name as domain.com.
Should I have my VPS hostname **as domain.com or something like **srv.mehargags.com ?

I'm asking this in the context of Email Delivery and other Authenticity checks that are done for IP's and Mailhosts.

I have one of my server's hostname set = domain.com but then I find that server isn't able to route mail to its own domain name with : exim -bt [email protected].

Or is there a better way to configure the mail routing to this particular domain ?

Pls suggest. Thanks

Comments

  • rm_rm_ IPv6 Advocate, Veteran

    Use whatever.domain.tld, just make sure that you have rDNS set to the same value, and that your server sends this as HELO.

    Using just "domain.tld" as your hostname is not necessary.

    Thanked by 1mehargags
  • @rm_ said:
    Using just "domain.tld" as your hostname is not necessary.

    Ok so its not ambigious too ?? right ? I'm its ok use domain.tld as hostname.... ?

    If not - I'd like to know the consequences or workarounds

    Thanks

  • JustAMacUserJustAMacUser Member
    edited February 2015

    You can basically use anything you want provided it's a fully qualified domain name (FQDN) and reverse DNS is the same, etc. as @rm_ said.

    Many use something other than mydomain.tld (e.g. server.mydomain.tld or mail.mydomain.tld, and so on), but you could use just mydomain.tld if you want. You just have to be consistent so when other mail servers do lookups the information matches.

    Edit: I just read the last part of your original post. If another of your servers has the same hostname, but doesn't actually handle the mail for said domain, then it's going to have trouble routing the mail because it thinks it is the server that handles that domain. You need to change things around a bit in that case.

  • @JustAMacUser;
    Yes -- the most common problem I detected was routing mail only, as my domain.tld uses Google apps for incoming mail, while the VPS is Sending out PHP APP mails.

    I worked around that by
    editing /etc/exim4/exim4.conf.template & Change domains = !+local_domains to domains = *

    so now when I exim -bt [email protected] it can find the route properly.

    I'm only trying to be sure if this config has any adverse effects or is it normal to go with it ?

    Other than email routing, I don't think its going to be a problem much... or will it ?

  • I hesitated somewhat because, frankly, I'm irritated when someone who obviously needs rather basic help plays his requests as it it was just about a small detail when, in fact, he's basically looking for people to do his job.

    But oh well ...

    Besides diverse checking systems (e.g. spf, DKIM) the basic mechanism is this:

    The DNS records for a domain, say "mehargags.com" list "MX" record(s) which tell the world to which server mail for that domain should be sent. So, let's assume you have a server "mail.mehargags.com" as your mailserver (Note that it might as well be "mail.other.net", i.e. in needs not be in-zone).

    Both the rules and the way virtually all mail servers handle it make it necessary for whatever MX entry you chose to not be CNAME'd and to be reverse resolvable.

    So, if the A record for mail.mehargags.com says 1.2.3.4 there must be a reverse record (PTR) that resolves 1.2.3.4 to mail.mehargags.com.

    Finally, you MTA software, say, exim, must also know who it is (for HELO). Usually an smtp server derives that info from the OS hostname. So you'd better make sure that your /etc/hostname (or whatever, depending on the OS) matches the MX record. Note: Some MTAs also allow to set that hostname in their config.

    In other words: Don't chose some fancy or arbitrary hostname or one that matches the www or whatever. A server that serves as mail server should have all naming directed by that MTA role.

    hostname (OS) = hostname (DNS/MX) and IP must resolve to that same name.

  • JustAMacUserJustAMacUser Member
    edited February 2015

    @mehargags said:

    Others would be better able to field your specific questions about Exim. Typically if you have one server handling e-mail (GApps) and another running web services, their host names are different.

    You can do one of two things: You can give the web server a different host name. You'll then need to set up SPF records, etc. to let other mail servers know that it is allowed to send mail on your domain's behalf. If you have DKIM set up in GApps, this could be an issue as I'm not sure you can set or get the private key to sign outgoing messages from your web server. In which case, you'd need to setup a subdomain (like server.domain.tld) with it's own SPF, DKIM, rDNS, etc. just for your web services (this can be the same as the web server, you'd just make the appropriate settings where necessary).

    Another route is to simply set up the web server to deliver mail via SMTP to a GApps account you create for outbound mail (e.g. [email protected]). (Probably the easiest, to be honest... especially if you fall within Google's sending limits.)

  • @bsdguy,
    Thanks for your valuable insight, I duly understand that jargon. However the case I'm discussing is a little different, in the view that the Webserver is a "null mail client" or "send only" mail server, it doesn't accept any incoming mails so no MX for it. Webserver just needs to ensure PHP Generated mails get delivered properly.

    @JustAMacUser, I could have used gmail as SMTP smarthost if the mails are less than 100/150 a day, and even mandrill or sendgrid if they are <400 a day, but not on a busy portal sending out 4000 mails a day!

    So What I Presume is, just to have a Resolvable PTR & SPF records in place!

    I'm interested in learning if there is a way to DKIM SIGN the PHP Generated mails ? Any pointers guyz ?? Pls consider that the webserver will be hosting multiple domains, and so I'd want to know if Exim can detect the incoming request from PHP and sign the outgoing mail according to domains DKIM Key.

    Thanks alot...

Sign In or Register to comment.