Using MailWizz with CloudFlare SSL

I just finished configuring my installation using CloudFlare and I want to share some issues I run into and how to overcome them.

The idea is to be able to use CloudFlare for our MailWizz app to benefit from their services, specially from their SSL and automated CDN. The problem is that new tracking domains that are not in CF won't be able to set the CNAME record, so we need to use a System tracking domain that bypasses CF and can be used as CNAME for new tracking domains.

1. Setup your main domain (e.g mydomain.com) with CF activated. If you want to serve your domain with SSL make sure your web server accepts https connections. You can also set up a redirect from http to https. Leave the MailWizz System URLs setting as HTTP, and use your server to make redirects to https when needed.

2. Add a subdomain (e.g tracking.mydomain.com) to use as tracking domain without CF activated. This can be a A record to mydomain.com IP, or a CNAME to mydomain.com.

3. Add the tracking domain in MW. You will find that the validation doesn't pass for the reason explained here. If you don't want to wait until we have a version that allows on/off the validation, you can just comment out the code from line 175 to the end of the block at /apps/common/models/TrackingDomain.php.

4. Select that tracking domain for your delivery server and send an email with a link. You will see that the link gets replaced with http://tracking.mydomain.com/xxxxxx. If you did the set up in your server the https version will also work. However there is no way to tell MW to use https instead of http. We would need a new setting to select http or https as default for a tracking domain.

5. Now you can add other tracking domains (e.g tracking.otherdomain.com), but they need to be a CNAME to tracking.mydomain.com, and not to mydomain.com, as it is instructed currently by MW. We would need a new setting "CNAME domain", and enter there "tracking.mydomain.com", or a checkbox when editing a tracking domain to mark it as CNAME doman. Then MW instructions would use this domain instead of the default.

Note that if the new tracking domain (tracking.otherdomain.com) is in CF both the http or https versions will work. If not in CF, only http will work.
 
Back
Top