ISPConfig + GoogleApps Split domain delivery

Discussion in 'ISPConfig 3 Priority Support' started by Ark74, Oct 18, 2017.

  1. Ark74

    Ark74 Member

    I'd like to move this question to this section, thanks in advance.

    I've been trying to setup a domain split configuration with Google Apps as the main mail controller.
    I've seen this post with CPanel and it makes a lot of sense, I'm trying to recreate it on ISPConfig,

    1. root domain ( must have MX records pointing to Google's MX servers;
    2. there must be a subdomain CNAME ( as alias of root domain (, this will be used to deliver mail sent through cPanel or its SMTP;
    3. there must be another subdomain CNAME ( as alias to the cPanel hosting server (in my case, HostGator's server, masked for example purposes);
    4. Google Apps Split Delivery must be correctly configured (Configure split delivery - Google Apps Administrator Help), with the subdomain described in step #3 as the destination (step 7 on this page);
    5. on cPanel, use Local Server as the setting on the MX Records page for the root domain;
    6. on cPanel, set a Domain Forwarder with "from:" and "to:";
    7. on Google Apps, set a default route to change envelope recipient of all mail that corresponds to the REGEXP "\[email protected]" with the "Replace Recipient" setting, set to the "[email protected]" option.

    I'm stuck at Point 5 forward, if i'm running DNS from the test server, I believe that that point is already done... maybe(?)
    On Point 6, should I Alias (Domain alias) or Route (Email Routing) the from =>

    Any ideas or suggestions are welcome. :)
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I haven't used google apps nor do I know cpanel in details, so I can just guess what they mean.
    (5) They refer most likely to a normal MX record here.
    (6) is probably an email route.
  3. Ark74

    Ark74 Member


    On a follow up question, I've configured split delivery, and emails reach the ispconfig mail but I'm getting this weird behavior.

    Nov 1 11:18:21 pos postfix/smtp[20410]: 4B743272573: to=<[email protected]>, relay=[]:10024, delay=0.77, delays=0.4/0.01/0/0.36, dsn=2.0.0, status=sent (250 2.0.0 from MTA(smtp:[]:10025): 250 2.0.0 Ok: queued as 05038272574)
    Nov 1 11:18:21 pos postfix/qmgr[18803]: 4B743272573: removed
    Nov 1 11:18:21 pos postfix/local[20415]: 05038272574: to=<[email protected]>, relay=local, delay=0.03, delays=0.01/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "address")​

    Where address is a valid email/mailbox on the ISPConfig server, seems that it's not reading the
    Any advice?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please check that is not used as server hostname and that it is not used in /etc/mailname or /etc/postfix/ files. In these places, a subdomain must be used like
  5. Ark74

    Ark74 Member

    Edit: Sorry didn't see the message when I sent this one.
    Seems that it is related to this other message.
    postfix/trivial-rewrite[19344]: warning: do not list domain in BOTH mydestination and virtual_mailbox_domains​
    Investigating this issue.

    In fact I have in both places,
    Do I need to use a valid (DNS) subdomain or can it be a
    Last edited: Nov 1, 2017
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Try to remove it from mydestination line and then restart postfix.
  7. Ark74

    Ark74 Member

    Mmm, it complains about it.
    postfix/smtpd[23035]: connect from[]
    postfix/trivial-rewrite[23822]: fatal: myorigin file /etc/mailname is empty
    postfix/master[1943]: warning: process /usr/lib/postfix/sbin/trivial-rewrite pid 23822 exit status 1
    postfix/master[1943]: warning: /usr/lib/postfix/sbin/trivial-rewrite: bad command startup -- throttling​

    Should I change/remove from /etc/postfix/
    At this test is still there.
  8. Ark74

    Ark74 Member


    If i left mailname with
    but change to

    It works!
    It delivers the message! :)
  9. Ark74

    Ark74 Member

    Thank you very much for the heads up! :)

    Should I still change mailname to
  10. Ark74

    Ark74 Member

    After some tweaks its working.
    I can confirm it was email route (not alias).
    Priority support totally worth it.

    Thanks guys, cheers! ;)
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    If it's working now, then leave it as it is.
  12. Ark74

    Ark74 Member

    Maybe I talked to early.
    I've found that enabling email routing would prevent receiving mails on the valid ISPConfig accounts mailbox even when setting up relay recepient.
    Using Domain alias will not work either.

    The only missing feature is to send mail from a ISPConfig account to a GoogleApps hosted email address.
    Can send and retrieve from any email address (local and external) even from GoogleAPps to {ispc} local emails.

    So i guess this is a issue on forwarding domain ->
    how can it be accomplished making sense of these instructions.

  13. till

    till Super Moderator Staff Member ISPConfig Developer

    You can not use relaying and local mailboxes for the same domain at the same time. Either email get's relayed, then gmail is responsible for it, or email is local, then your server is responsible for it and not gmail.
  14. Ark74

    Ark74 Member

    As far as I understand.
    That's the reason for using 2 identifiers one for each server.
    cp/ -> ispc3 server -> google

    So emails sending from the ISPConfig server to [email protected] will rewrite to [email protected] and reach the Google server, once there #7 will change it back from to
    7. on Google Apps, set a default route to change envelope recipient of all mail that corresponds to the REGEXP "\[email protected]" with the "Replace Recipient" setting, set to the "[email protected]" option.
    I'm more of a graphic person, so this is my undestanding / state of the process. maps.png
    So if a subdomain won't work, should I get a different domain to pull this out?

    PS. Google Apps can receive mails delivered to from the ispc3 and other hosts.
    Last edited: Nov 2, 2017
    sweekeong81 likes this.
  15. Ark74

    Ark74 Member

    Finally I got it working.
    Seems that I added the gapps alias domain to Google Apps at the end, so all my (previous) test were rejected and taken as wrong.
    Sorry for the silly mistake. After adding the domain alias to GoogleApps and setup MX records for pointing for GoogleApps.
    I only needed to add forward for each address with "send as" enabled. ispconifg.png
    Thanks again for the support.
    Turbanator and till like this.
  16. till

    till Super Moderator Staff Member ISPConfig Developer

    Thank you for posting your solution! I'm sure this will help others with a similar problem.

Share This Page