MailerQ Integration - Default Exchange

Filipe Silva

New Member
When connecting Mailwizz with MailerQ it's required to provide an exchange name.
However in my scenario/configuration I need to send the message to RabbitMQ to the "default exchange" (which means that I should NOT specify the exchange).

Is there a solution for that?


Screen Shot 2017-08-23 at 02.51.29.png
 
When connecting Mailwizz with MailerQ it's required to provide an exchange name.
However in my scenario/configuration I need to send the message to RabbitMQ to the "default exchange" (which means that I should NOT specify the exchange).

Is there a solution for that?


View attachment 3972
If you send to rabbitMQ directly,
then the DS setup would need to be for that (not MailerQ).

PS: Good to know you are a MailerQ user as well ;)
 
If you send to rabbitMQ directly,
then the DS setup would need to be for that (not MailerQ).
RabbitMQ is just a queue server, not a smtp server so there's no such thing as a rabbitmq DS ;)
RabbitMQ is just the backend for email storage for MailerQ ;)
 
Yes, the injection would need to be done differently (with a different DS, i.e. another, new interface/code/api, i.e. new kind of DS, not yet available in mwz).
You can inject with whatever you want, if there's no smtp server to pull the emails from rabbitmq, then nothing happens.
 
You can inject with whatever you want, if there's no smtp server to pull the emails from rabbitmq, then nothing happens.
You mean this one (as mentioned before, sends messages both ways)
https://github.com/gotthardp/rabbitmq-email
(which lists incoming2rabbitmq=smtp2amqp and rabbitmq2outgoing=amqp2smtp)
(May 21, 2016)
does not work?

It supersedes these (both of Dec 24, 2015)
https://www.rabbitmq.com/community-plugins/v3.6.x/rabbitmq_email-0.1.0.ez
https://www.rabbitmq.com/community-plugins/v3.6.x/gen_smtp-0.9.0.ez

;)
 
My current config is already working for several years before I came to this company:
Custom ESP Software + (RabbitMQ + MailerQ)

What I'm trying to do is to replace the "Custom ESP Software" by the Mailwizz, so I'm trying to connect both (Mailwizz + MailerQ).
Which I already did, using the existing integration option on Mailwizz - the problem is that current MailerQ+RabbitMQ is configured to use default exchange.

I know that this could be solved by changing this behaviour (using a defined exchange), the question is that I'm testing the integration before migrating to Mailwizz. I cannot change the production system because I'll break the current business.

If it's not possible to use default exchange I would need plan also a migration on the MailerQ+RabbitMQ side...
 
@Filipe Silva - let's do this, open /apps/common/models/DeliveryServerMailerqWebApi.php and at line 129 you have:
PHP:
$channel = $this->getConnection()->channel();
Above it, try to redeclare the exchange like:
PHP:
// add below line
$this->exchange = '';

// existing code...
$channel = $this->getConnection()->channel();
Save the file and see if that makes any difference for you.
 
Many thanks for the help, but this gives another error:
"ACCESS_REFUSED - operation not permitted on the default exchange"

However I think I'll need to understand very well how is implemented MailerQ here (my company) and try to discover how this should be done.
For instance, I discovered a piece of code in current software that is using a custom header (x-mq-ip) to inform MailerQ which IPs should be used to send the message. As far I could understand, Mailwizz is using a different method.

So I think I really need to go deeply understanding both systems and try to find which is the best practice.
 
I have new information on this subject :)
After investigating about this, I realised that I can send the messages to the correct Queue, which is what matters at the end.
So I've created a new Exchange dedicated to Mailwizz and created a bind with a routing key to the final Queue.

So I'm now able to send the message to the final queue.

However a new problem appeared. I'm receiving this bounce:

[2017-08-24 16:48:06] message:error 1 <info@XXXX> <xxx@xxx.xx> [x.x.x.x] x.x.x.x] [] 550 5.7.1 [x.x.x.x 11] Our system has detected that this message is not RFC 5322 compliant: 'From' header is missing. To reduce the amount of spam sent to Gmail, this message has been blocked. Please visit https://support.google.com/mail/?p=RfcMessageNonCompliant and review RFC 5322 specifications for more information. h6si3673137wrh.246 - gsmtp

I tried to send the DS validation email to an email other than gmail and in fact I received it, but empty:
(...)
From: xxx@xxx.xx
X-Envelope-From: <xxx@xxx.xx>
Received: from xxx.xx (xxx.xx [x.x.x.x) by mxa.mailgun.org with ESMTP id 599f040f.7fcff43cf470-smtp-in-n01; Thu, 24 Aug 2017 16:51:27 -0000 (UTC)
message-id: <2bd01604-6765-49fd@bbed-67c058b442fe>
[ENDS HERE]


Any idea what could be this?

* It's probably my mistake somewhere :p
 
@Filipe Silva - we're sending this info:
PHP:
$sendData = array(
    'domain'    => $domainName,
    'key'      => $this->getMailer()->getEmailMessageId(),
    'keepmime'  => 1,
    'envelope'  => $fromEmail,
    'recipient' => $toEmail,
    'mime'      => $message,
    'ips'       => $ips,
);
The message variable is defined as:
Code:
$message    = $this->getMailer()->getEmailMessage($params);
So it should work just fine. Could you try a var_dump($message); exit; in /apps/common/models/DeliveryServerMailerqWebApi.php at line 139 to make sure it contains the email message as expected?
 
That prints this:

string(908) "4O8qjmwpp6AzKR8Cqly5mcyQCj5MClSPGZMchFtJb4LXFBbE5AfCLm4sMfLaPyOTTlGT9xk0y67yGFGDnV4CpPqDm4s5XR6VHa0XeZtHfx72VVRsW9HmWQCVOF0veBWk9MtwsYLDHtrp6hJRHOYeFTlG2nd79ebcffpYYcsjz1wrK55Dy7Sxqmj0tpkQ5sPTaJEzprHsAYpPh0hksjk8qr36Mpw7pEQoMLznGGa45Z8KTvThTN4QterSABrpZhQzjsGR4VHk7Sz7Lq1XPPo1BVE8a2vgA1J7AK1mEbono3Bq5R0oNCKFklpj0tHwsZ0KOPMzYLRLwwRA5mdW1F7WayxVg5mxNz2RvlkxhxzN8hSPyC7DD7QOrFS6rb1JHq5AoAdgBgje4BvM2OQ4OZrcxQBEzm4OTFfoh2sHxdONlkK8ey9OC6s1S1tcq5sbpAkHQkacsYsdk7afx8EMZyoLM4dKV8T6pWQ0sahjAJpF0aJreMyMKGtT2hxJDcLbJyb3DKsN6B6sLsthVx0MODZq5JxT2nCQ2vDa7OS7CHq34PvN5yqFNLZAswoFVkA5gzorqrL3wVtfJF2tRYfTpRFOoqtmkMcwZMARRm5rdso6Jbvf1peAMsT5LOcXZN1K8Depj75SyvnFadQB5fwdYSf1C6eLBYFAwwhSSZv18ZxKpm7LFkQbS2JzqTT7FDCVqSdoBAr3OyQRWpO4DxDzC5P84ftRn5CywGpznzOdbvrTlnBzloa0xAhfydxtANEdV1WK7w1yrxJYn778OobEgRYtnovwnt3NZksTlBhGMeYQbq6070MLFyC2dnpNmF6D0xkXCwGkyEvwF10P8WfFkpGqXm56AxDpdFAss5YkzNh0Qpf0OaavTkM7ZXKkz5lJwl4ydWhbEAehrYEl"


* I've also printed "var_dump($params);" and they seem ok (at least I can see the HTML that sould be send)
 
I am not sure why you get a base64 encoded string, i knew the reason but i just cannot recall it at this point.
In Backend > Settings > Common, what mailer are you using? can you switch between swift and phpmailer and see if it makes any difference ?
 
Back
Top