[SOLVED] CRM server relay

I have setup a server running MIAB a couple months ago and has been running great. I have another server running Odoo. on the odoo server I’ve installed Postfix as a satellite system. I can send email via prompt from server OK. In Odoo, I have to specify what account I am using. I can send mail from the root@mydomain.com but if I set up any other user, it tells me it can’t send because user is not owned by root.

Is there a way to allow any mail to be relayed from my Odoo server? an spf or dkim record?

Or is there someone that would like to do a little consulting / training?
thanks,
Dave

On the postfix on the ODOO server, https://www.linode.com/docs/email/postfix/postfix-smtp-debian7/

Thanks for the reply. I had originally set up postfix as a Satellite but changed that to be a Internet site. I can sendmail from the server command prompt. But if another user in Odoo tries to send mail it is rejected as “not owned…”

It seems that the hurdle is being able to allow any user to send email. In the postfix password file, you can only set on entry for that server as you get the following error adding another email: postmap: warning: /etc/postfix/relay_password.db: duplicate entry: “box.dsi-hosting.com

It would seem logical to use an alias, but odoo requires a password for the outgoing mail server user and I’ve not found any info on how to set a password for an alias.

I know I’m missing something simple.

thanks,
Dave

I am not familiar with Odoo (don’t even know what it is) but the way to solve your problem is to follow what @murgero has suggested.

Ok so I had to know what we were talking about and came up with this in the documentation:

emails

--email-from <address>

Email address used as when Odoo needs to send mails

--smtp <server>

Address of the SMTP server to connect to in order to send mails

--smtp-port <port>
--smtp-ssl

If set, odoo should use SSL/STARTSSL SMTP connections

--smtp-user <name>

Username to connect to the SMTP server

--smtp-password <password>

Password to connect to the SMTP server

https://www.odoo.com/documentation/12.0/reference/cmdline.html#emails

So, you need to properly configure Odoo to use SMTP. Your MiaB will need to have the user email account that you will be sending from and you will use the details from the admin area mail instructions page to properly configure these settings.

Why reinvent the wheel when the software already has the solution built in?

I have Odoo setup to email and all is working on that end. My issue seems to be with the relay of emails from the server running Odoo and the MIAB server. Inside of Odoo, I have it configured with an SMTP user / password that authenticates back to that user in MIAB. If I am logged into Odoo, I can send emails with no issues. But if another user logs into Odoo and sends an email, they get the “not owned” error message. Since each user has their own email address and Odoo only allows for one SMTP user, the MIAB rejects those emails by other users. Is there a way to tell the MIAB server to accept all emails from another server / ip address? Or how do we assign a password to an MIAB alias so that I can enter that into Odoo’s outgoing mail server config?

Also, we are an Odoo partner and have several customers using it. But they are using other email servers and we do not have this issue. It just seems to be some type of relay or authentication issue.

thanks,
Dave

@davidogles Hi Dave, thanks for that as it gives me more clarity as to the issue you are facing.

How many users are we talking about here?

@davidogles @alento

The issue here is that OP has relaying setup but MIAB is denying the change in the “FROM” address (It is no longer matching the USERNAME address so MIAB is denying access)

What will need to happen is each user will need an alias that is attached to the username used for the relay.

Exactly what I am thinking (just may not be practical if OP has 100 users) … in the MiaB admin area under aliases, add an ‘alias’ pointing back to the same user that odoo mails with and then under permitted senders use the second option - I’ll enter the mail users that can send mail claiming to be from the alias address.

My user management script could handle this, and the migration script can as well.

Thank goodness someone around here is an expert in scripting! :slight_smile:

1 Like

just 5 users right now. Probably won’t grow past 20.

thanks,
Dave

Exactly what I was thinking, but Odoo SMTP user requires a password for authentication and a MIAB alias does not have a password, unless i’m missing something. And from my understanding you can’t have an alias and user with matching email addresses, correct?
thanks
Dave

It works like this, Odoo send the information to the local postfix server (NOT MiaB), which will look like:

Username: user@example.com
Password: SomeS4p3rAw3s0mePassw0rd
FROM ADDRESS: user-alias@example.com

The user used to sign into SMTP never changes, the FROM address (in this case would be the alias) changes. By default MIAB only allows users to send as themselves AND alias ONLY. So the from address needs to match the username OR the from address needs to be an alias.

Ah, Gotcha. Now that is making sense. Let me dig into postfix and configure it this way. thank you very much for the help.

Dave

1 Like

Hi @davidogles

@murgero and I are leading you to two different ways of accomplishing this. I am going to step back and let you follow his instructions.

From my interpretation of the Oodo documentation, it is designed to allow you to automatically send email using a external SMTP server (not specifically the one on localhost) and I am approaching this from that angle.

@murgero is approaching this from the angle of a smtp server on localhost which you would then use to relay the mails to the MiaB server for sending.

If you need help with either approach, we both are in the MiaB slack channel. :slight_smile:

@davidogles

If Odoo allows you to configure an external server, USE THAT INSTEAD. I was under the impression that it did not (like many PHP scripts). @alento’s way is an easier solution here.

https://www.odoo.com/documentation/user/12.0/discuss/email_servers.html

Seems to be a reliable way to pull this off. As always, Slack or PM work for me as well.

I’ve been reading up on postfix and how to configure the Odoo server as a local mail and forward to the MIAB server. I must admit that this seems very difficult to follow. Especially the rules about virtual mappings.

Odoo is setup to send email using an external SMTP server and it works great. It is just that trying to send to the MIAB server with multiple user email addresses is where I’m hitting my head on the wall.

In Odoo, I configure the outgoing mail server settings as follows:
SMTP Server: box.mydomain.com
SMTP Port: 587
SMTP User: dave@mydomain.com
SMTP Password: mypassword

I log into Odoo as my user and I can send emails. But when the other users log into odoo, they get that error of “not owned…” when sending emails. Odoo is trying to send the mail as their user (i.e. user1@mydomain.com). It gets reject saying that user1@mydomain.com Sender address rejected: not owned by user dave@mydomain.com. So if Odoo is “authenticating” for dave@mydomain.com it does not recognize the other emails. Seems to be a purely relay issue.

thanks,
Dave

Also, could an SPF record in the domain fix this relay issue? I am somewhat of a novice on SPF and dkim.
thanks,
dave

Yes, it is a relay issue because the other users are not authorized to send mail. Do try my suggestion. It should work.

No. If mail was being sent to the internet directly from the Odoo server, then yes … but that is NOT the situation here.

1 Like

I have created an alias in MIAB, info@mydomain.com. On my odoo server, I have changed the outgoing mail server config for the SMTP user of info@mydomain.com and leave the password blank since MIAB aliases do not have passwords. When I try to send an email, I get this error:

Connection Test Failed! Here is what we got instead:
535
5.7.8 Error: authentication failed: UGFzc3dvcmQ6

thanks,
dave