1

Topic: GSuite & iRedMail relays and local user problem

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1 MARIADB edition
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: Debian 9 stretch
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello,

I am having trouble with the setup of an iRedMail setup.
The situation is the following:
- We have a domain called xyz.com hosted on SMTP Gmail with GSuite, with N accounts configured there and the other mail accounts are relayed to our iRedMail instance (and this works perfectly fine in sending and receiving mails from everywhere)
- We have the other M accounts configured in our iRedMail instance that can send mails to everyone, except the ones which are of the same domain xyz.com and not listed locally, but on the GSuite side.

From what we're seeing, iRedMail is trying to send the mail locally due to the fact that the domain is found locally, but it cannot find the user locally due to the fact that they are on GSuite and so giving us an error.

What should we do to enable iRedMail to send out user accounts of domain xyz.com that are not listed locally to relay on GSuite and thus making everything work out okay?

Thanks in advance

2

Re: GSuite & iRedMail relays and local user problem

Maybe you can try this:
https://gist.github.com/iredmail/fda90a … c18638e047

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

3

Re: GSuite & iRedMail relays and local user problem

You're into something that I have had to deal with lately so here is the solution :-)

Assuming you are using the MySQL backend:

In domain table set the "transport" for the domain name as:

smtp:[some-external-smtp-server-can-be-that-of-g-suite]:587

In mailbox table, set  "transport" field for the user/s hosted on iRedMail only (not on G Suite) as:

dovecot

That's all.

4

Re: GSuite & iRedMail relays and local user problem

hi @MW,

Your solution has one problem: If user on iRedMail server sends an email to a non-existing user (under locally hosted domain), you will get "User unknown" error (returned by Postfix on iRedMail server) and the email will not be sent out.

----

Buy me a cup of coffee ($5) to support iRedMail:

buy me a cup of coffee

5

Re: GSuite & iRedMail relays and local user problem

In fact, I had encountered that and here is the solution:

INSERT INTO `forwardings` (`address`, `forwarding`, `domain`, `dest_domain`, `is_maillist`, `is_list`, `is_forwarding`, `is_alias`, `active`) VALUES ( '@my-domain.com', '@my-domain.com', 'my-domain.com', '', 0, 0, 1, 0, 1);

Simply add a catch-all forwarding rule for the domain.