Best naming scenario for mail server

Discussion in 'Installation/Configuration' started by Petar, Jan 7, 2019.

  1. Petar

    Petar Member HowtoForge Supporter

    Installed Perfect server debian 9 apache
    If we name the server lets say srv1.domain.com, then when sending email, that is the server which is shown on the "Received: from" line in mail delivery on the email recipient client.

    But we are stating that our mail server is mail.domain.com in the DNS.
    If we make the PTR of the IP address for mail.domain.com, then the recipient mail server will argue about the different names "xxx.xxx.xxx.xxx IP not equal to sender srv1.domain.com"

    So my question is: What would be the best naming convention and setting of PTR, when using one IP address, for the ISPC host server and for the mail server?

    Should we just name the hostname mail.domain.com in the start and then set the PTR for that name and IP or there is another way of doing this?

    I'm asking this because a lot of emails get hold or dismissed or ending in spam at the recipient server (especial if it is outlook.com or some strict server rules).
    At the moment we're doing it like this with not so great acceptance:
    hostname: srv1.domain.com
    mail server: mail.domain.com
    website: www.domain.com

    PTR: mail.domain.com 123.456.789.1

    A @ > 123.456.789.1
    CNAME www > domain.com
    CNAME mail > domain.com
    CNAME srv1 > domain.com
    MX mail.domain.com
    SPF: a mx ip4:123.456.789.1 ~all
    DMARC: v=DMARC1; p=none; rua=mailto:p[email protected]
    DKIM SET

    Sometimes mails are held, sometimes nowhere to be found and sometimes in SPAM...

    I hope that you understood my question, and that you can find some time to write a short tutorial on how to best setup mixed scenario web/mail server, because there are tons of similar problems, questions and answers at the forum and there is no clear tutorial on how to set all this up!

    Merry Christmas, Happy New Year and Hristos se rodi to you all
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Personally I use hostname = mailname = ptr, so I use the same name for everything. This would mean in your case to change ptr and mailname to srv1.... if the server is used for multiple services. If it's a mail server only, I would use mail.... for everything.
     
  3. Petar

    Petar Member HowtoForge Supporter

    Hi Till, Thanks for your fast support during holiday season.
    I need just little more help so i can clear this once for all time.

    Because lot of the users of mailboxes, have already set their email clients, phones, laptops with mail.domain.com as pop3/smtp server,
    in the "Received: from" line i can allways see srv1.domain.com (i think that mail should be sent from mail.server.com)
    should i change in /etc/mailname and put mail.domain.com there, and then set PTR to mail.domain.com=123.456.789.1 ?
    or change the whole server name everywhere instead of srv1 to mail(but then the ISPC will also be at mail.domain.com:8080 and phpmyadmin and so on, and that doesn't make sense...)

    Also i see a lot of:
    Received: from srv1.domain.com ([127.0.0.1]) by localhost (srv1.domain.com [127.0.0.1])
    Can all this be better setup in the /etc/postfix/main.cf ?

    BR
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Like I said above, decide which of the two names you want to use and then set everything to that single name. The actual name does not matter, you can even use 'nomailserver.yourdomain.tld' as mailserver name ;) It's just a text string, so the actual name is not relevant, it has just to be unique and it should be the same for hostname, mail system and ptr.
     

Share This Page