how to connect mailwizz to mailerq wep api (AMQP) under encryption?

eugen

New Member
Hi folks!
I use mailwizz on my main server with powermta. Same time i have another server with mailerq+rabbitmq.
I know, what mailwizz can connect to mailerq using webapi (AMQP). Default config points to port 5672, and used for PLAIN text.
So i setup an SSL using default guide (https://www.rabbitmq.com/ssl.html).
Next lets send a testing mail:
"Error reading data. Received 0 instead of expected 7 bytes" mailwizz told me from `/backend/delivery-servers/update/type/mailerq-web-api/id/10` URL.
On mailerq server i have such log:
Code:
---
root@core-qmta:~# tcpdump -i eth0 dst port 5671 -v -XX
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
20:44:27.908707 IP (tos 0x0, ttl 63, id 31998, offset 0, flags [DF], proto TCP (6), length 60)
    **DELETED**.60772 > **DELETED**.amqps: Flags [S], cksum 0x2ebc (correct), seq 85293419, win 29200, options [mss 1460,sackOK,TS val 217384341 ecr 0,nop,wscale 9], length 0
    0x0000:  a4bf 0113 4486 00ff ffff fffb 0800 4500  ....D.........E.
    0x0010:  003c 7cfe 4000 3f06 ac22 894a 0003 894a  .<|.@.?..".J...J
    0x0020:  0004 ed64 1627 0515 796b 0000 0000 a002  ...d.'..yk......
    0x0030:  7210 2ebc 0000 0204 05b4 0402 080a 0cf5  r...............
    0x0040:  0595 0000 0000 0103 0309                 ..........
20:44:27.908938 IP (tos 0x0, ttl 63, id 31999, offset 0, flags [DF], proto TCP (6), length 52)
    **DELETED**.60772 > **DELETED**.amqps: Flags [.], cksum 0xc19c (correct), ack 3414604341, win 58, options [nop,nop,TS val 217384341 ecr 755692], length 0
    0x0000:  a4bf 0113 4486 00ff ffff fffb 0800 4500  ....D.........E.
    0x0010:  0034 7cff 4000 3f06 ac29 894a 0003 894a  .4|.@.?..).J...J
    0x0020:  0004 ed64 1627 0515 796c cb86 ba35 8010  ...d.'..yl...5..
    0x0030:  003a c19c 0000 0101 080a 0cf5 0595 000b  .:..............
    0x0040:  87ec                                     ..
20:44:27.909312 IP (tos 0x0, ttl 63, id 32000, offset 0, flags [DF], proto TCP (6), length 60)
    **DELETED**.60772 > **DELETED**.amqps: Flags [P.], cksum 0x25ed (correct), seq 0:8, ack 1, win 58, options [nop,nop,TS val 217384342 ecr 755692], length 8
    0x0000:  a4bf 0113 4486 00ff ffff fffb 0800 4500  ....D.........E.
    0x0010:  003c 7d00 4000 3f06 ac20 894a 0003 894a  .<}.@.?....J...J
    0x0020:  0004 ed64 1627 0515 796c cb86 ba35 8018  ...d.'..yl...5..
    0x0030:  003a 25ed 0000 0101 080a 0cf5 0596 000b  .:%.............
    0x0040:  87ec 414d 5150 0000 0901                 ..AMQP....
^C
3 packets captured
3 packets received by filter
0 packets dropped by kernel
---

with plain AMQP in.
rabbitmq.config is:
Code:
`[
  {rabbit, [
     {ssl_listeners, [5671]},
     {ssl_options, [{cacertfile,"/etc/rabbitmq/testca/cacert.pem"},
                    {certfile,"/etc/rabbitmq/server/cert.pem"},
                    {keyfile,"/etc/rabbitmq/server/key.pem"},
                    {verify, verify_peer},
                    {fail_if_no_peer_cert, true}]}
   ]}
].
`

and rabbitmq management panel show me: `amqp/ssl :: 5671`
So as i see: mailwizz can't connect to mailerq server using AMQP protocol with encryption.
Is there are some solution for mailwizz or affected software (except portforwarding via ssh)?
 
Last edited:
@eugen - This is because we didn't really expected people to use ssl here, so we didn't give you an option for this.
In the best case scenario, we should make the connection like shown at https://github.com/php-amqplib/php-amqplib/blob/master/demo/ssl_connection.php instead of a regular connection, so we would need to give you a way to specify the ssl certificates, and if you do this, we would then use a SSL connection instead of a regular one.
At the moment i have no access to an install with mailerq. If you need this done, PM me with backend login and url to your app and ftp access to it and the path to both certificates as shown at https://github.com/php-amqplib/php-amqplib/blob/master/demo/ssl_connection.php#L9 and i'll try to implement it and also test it on your host and see how it goes.
 
Back
Top