2 servers

Discussion in 'Server Operation' started by ariban99, Nov 23, 2022.

  1. ariban99

    ariban99 Member

    Hi
    I have ISPCONFIG in one location and i want to use another location (fiber dedicated internet with 5 ips) for emails only.
    How do i setup ISPCONFIG to be used as an SMTP server (so my first server that hosts the website) can connect to it and send all emails from my website via the second server in another state (location)
     
  2. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    just install it as another ispconfig server (see multiserver guides) and set the existing server to use the new sever as a relayhost.
     
  3. ariban99

    ariban99 Member

    thank you for the quick reply. how do i set the first server to use the new server as a relayhost?
    lastly, i have a third server that runs plesk, ist here a way to set plesk to use the new server as a relayhost as well for emails if yes, how do i do that? any links to a tutorial?
     
  4. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    in the ispconfig control panel: system - server config - select server - switch to mail tab - put mailserver fqdn in relayhost field.

    plesk, ssh in as root
    Code:
    postconf -e 'relayhost = [mailserver fqdn]'
    postconf -e 'smtp_tls_security_level = may
    service postfix restart   (or use systemctl depending on OS / release)
    
    or edit /etc/postfix/main.cf manually (line: 'relayhost =') and restart postfix

    add webservers ip(s) to /etc/postfix/main.cf (line 'mynetwork =') on new mailserver

    * this is the simplest method and doesn't have any auth settings, but restricts relaying to the ip's you set.
    google for postfix relayhost tutorials if you want to use ssl/tls and authentication.
     
    ahrasis likes this.
  5. ariban99

    ariban99 Member

    your amazing, thank you!

     
  6. ariban99

    ariban99 Member

    what is the best practice for dns records in teh above case?
     
  7. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    have the correct hostnames and ip's for each server in your dns zone... ;)

    seriously.. just add the public ip's as A or AAAA records, if you have internal networks or use a vpn, put the private ip's in the hosts files on each server.
    mx records should be for the smtp server, spf records should include the smtp server ip. guess you could add the webserver ip as well.
    if you enable dkim for the maildomains, that'll create the dkim records for you in the dns, and apply the dkim keys on the mailserver.
     
    ahrasis likes this.
  8. ariban99

    ariban99 Member

    thank you, i thought so, but wanted to make sure.
     

Share This Page