[SOLVED] Advanced Mail Routing

Discussion in 'General' started by troggie, Sep 6, 2021.

  1. troggie

    troggie New Member

    Is there any way GUI or CLI to force the server to perform lookup for mailboxes that don't exist in the local table to reroute to the routing entries?
    a Quote from a previous thread:

    Regards
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    None that I know. Also I do not understand why it would be desirable.
    If you want to send to other e-mail servers, create Email Forward, for example.
     
  3. troggie

    troggie New Member

    I have mailboxes located on different servers and I was hoping to use the same domain and relay to all different servers based on the email addresses in the Email Routing
     
  4. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    That should work, what did you enter there? Put individual email addresses for the "Domain" and use type smtp to the destination server.
     
  5. troggie

    troggie New Member

    I have indeed.
    In Email Routing -: [email protected]
    In relay recipients: -: [email protected]

    However I suspect that being a "local" domain according to postfix no further lookups are done, the error of "unknown users is presented"

    Some of the other mail boxes are hosted on Google and MS 365, inbound routing is working perfectly, it's just the outbound I need assistance with please.
     
  6. troggie

    troggie New Member

    I was hoping postfix could rather do lookups based on locally hosted mailboxes as opposed to domain.
     
  7. Stephan Ververda

    Stephan Ververda Member HowtoForge Supporter

    That is not really how SMTP is designed. Any routing of e-mails is determined on the domain part, not on the user part. So basically all mail for domain.com is to be delivered to any mail server that is to be found by the MX record in DNS for that domain. If a domain has multiple MX records that is only for the purpopse of backup mailservers. Each and every mailserver in those MX records should be able to handle all e-mail addresses for that domain.

    However, the routing address and the alias address can be used to forward an e-mail to a different user on a different server but for different domains. So for example you can set your alias address for [email protected] and the routing address for [email protected].

    All in all, mailboxes for a certain domain should be hosted within the same server (as far as SMTP routing is concerned)
     
  8. troggie

    troggie New Member

    Ah perfect this makes sense thank you !
     
  9. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    You shouldn't need to add relay recipients, as you're not relying on this being a relay domain. I explained above what to enter for the other fields in Email Routing.

    Correct, if it's a local domain, apart from forwarding to addresses on other domains it will by default deliver locally or reject. You can set a mail transport (ie. Email Routing entry) for individual email addresses to change that.

    Ie. you configured both google and ms365 and your own server to host the same domain, and only setup a partial set of email accounts on each? You can expect to never get that setup right. You can configure your ISPConfig server to work in that picture, but the others will not. Eg. if you tried sending from an account setup on gmail to one that wasn't setup there, it wlll try to delver it locally and fail.

    Using different domains at each provider like this a viable option. Using the same domain on multiple servers really only works when you control all the servers involved, and really only makes sense in uncommon setups - avoid it if possible.
     

Share This Page