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, 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 in the DNS.
    If we make the PTR of the IP address for, then the recipient mail server will argue about the different names " IP not equal to sender"

    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 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 or some strict server rules).
    At the moment we're doing it like this with not so great acceptance:
    mail server:

    PTR: 123.456.789.1

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

    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 as pop3/smtp server,
    in the "Received: from" line i can allways see (i think that mail should be sent from
    should i change in /etc/mailname and put there, and then set PTR to ?
    or change the whole server name everywhere instead of srv1 to mail(but then the ISPC will also be at and phpmyadmin and so on, and that doesn't make sense...)

    Also i see a lot of:
    Received: from ([]) by localhost ( [])
    Can all this be better setup in the /etc/postfix/ ?

  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