mail-in-a-box / mailinabox

Mail-in-a-Box helps individuals take back control of their email by defining a one-click, easy-to-deploy SMTP+everything else server: a mail server in a box.
https://mailinabox.email/
Creative Commons Zero v1.0 Universal
14k stars 1.44k forks source link

CORS Configuration #1677

Open iFieldSmart-Tech opened 4 years ago

iFieldSmart-Tech commented 4 years ago

I am trying to use the add user api but it fails with the following error in the console.

Access to XMLHttpRequest at ‘https://_miab_host.com_/admin/mail/users/add’ from origin 'https://_my_website.com_’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

The website from where the add request is originating has a different IP and the system where MIAB is hosted has a different IP.

Where would I put the header "Access-Control-Allow-Origin". I am fairly acquainted to Linux and am not sure which file would include this setting. Thanks!

draft13 commented 1 week ago

@iFieldSmart-Tech did you ever find out where to put the cors config?