Sending email to same domain with MX lookup

Discussion in 'General' started by skrb_x, Aug 10, 2017.

  1. skrb_x

    skrb_x New Member

    Hi all, can you guys please help me with this.

    I've followed the Perfect Server: Debian 8 with NginX, my debian is x64. The problem I have is when I try to send an email from a domain but his MX points to another server. Everything is working fine but this.

    The mail server is complete with Amavis, Clamav and SpamAssassin and I get a 10/10 score when send emails outbound, and I do receive mails from outside without any problems too.

    I tested what people suggest on other forums and deleted the hostname domain from "mydestination" parameter but didn't work. The only way that works is by removing this line:

    virtual_mailbox_domains = proxy:mysql:/etc/postfix/

    If I remove the line above all emails will do a MX lookup and delivery as expected but I can't receive any email from outside, example: If I change the MX record pointing to the new server and send an email from my personal Gmail to the domain the email will not be delivery.

    Is there any tip or trick to fix this?

    Thank you any help.
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Do not add the domain which has an external mail server as email domain (in the mail module) in ISPConfig.
  3. skrb_x

    skrb_x New Member

    Thank you @till
    My problem is that I'm trying to setup a mail server which will be used as a SMTP server for sending campaigns with Mautic.
    The domain needs a valid account in the server to authenticate sending, but the MX for that same domain is elsewhere and Postfix try to deliver locally. Is that any workaround for this?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, that's why I told you to try that.
  5. skrb_x

    skrb_x New Member

    I have the following setup:
    - Server A with Mautic
    - Server B with emails accounts which Mautic points the SMTP to
    - Server X (an elsewhere MX server that will receive emails, it could be a Gmail Business account)

    If I send the campaign pointing the smtp to Server B and in emails list there is an email in a domain there is configured in the Server B that email will not arrive because Postfix delivers locally.

    Now I understand your suggestion..
    It will be creating a subdomain in email module like and in Mautic using an account like this: noreply @

    If I'm correct it will send and deliver to proper MX. Is that?
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Yes, using a subdomain is fine.
  7. skrb_x

    skrb_x New Member

    Done. The test was successful.
    After talking to you I remembered this is the way Sendgrid and SendinBlue tell people to setup email campaigns sending. They guide users to use subdomains.

    *There is no need to change anything in

    Thanks for your time Till.

Share This Page