gen-smtp / gen_smtp

The extensible Erlang SMTP client and server library.
Other
683 stars 266 forks source link

rabbitmq-server library support #296

Closed mforde84 closed 3 years ago

mforde84 commented 3 years ago

So we are looking to do a POC with this, incorporating an unmaintained plugin https://github.com/gotthardp/rabbitmq-email

I just have some very basic questions about builds and integrations with our rabbitmq-server stack

Current state is:

rabbitmq:
  rmq_version: '3.8.9-1.el7'
  erlang_version: '23.2.1-1.el7'

This is built off packagecloud.io rabbit and erl yum pkg.

So the rebar3 build looks happy for gen_smtp

[ cdvlhbqr241:gen_smtp ]
10.128.3.228 :: root -> make
===> Fetching rebar3_proper v0.12.1
===> Analyzing applications...
===> Compiling rebar3_proper
===> Verifying dependencies...
===> Fetching hut v1.3.0
===> Fetching ranch v1.8.0
===> Analyzing applications...
===> Compiling hut
===> Compiling ranch
===> Analyzing applications...
===> Compiling gen_smtp

However I'm not to well versed on the dev side here.

Looks like the appropriate lib support is here:

[ cdvlhbqr241:lib ]
10.128.3.228 :: root -> echo $PWD; tree .
/root/gen_smtp/_build/default/lib
.
├── gen_smtp
│   ├── ebin
│   │   ├── binstr.beam
│   │   ├── gen_smtp.app
│   │   ├── gen_smtp_client.beam
│   │   ├── gen_smtp_server.beam
│   │   ├── gen_smtp_server_session.beam
│   │   ├── mimemail.beam
│   │   ├── smtp_rfc5322_parse.beam
│   │   ├── smtp_rfc5322_scan.beam
│   │   ├── smtp_rfc822_parse.beam
│   │   ├── smtp_server_example.beam
│   │   ├── smtp_socket.beam
│   │   └── smtp_util.beam
│   ├── include -> ../../../../include
│   ├── priv -> ../../../../priv
│   └── src -> ../../../../src
├── hut
│   ├── CHANGELOG.md
│   ├── ebin
│   │   ├── hut.app
│   │   └── hut.beam
│   ├── erlang.mk
│   ├── examples
│   │   ├── basic
│   │   │   ├── app.config
│   │   │   ├── Makefile
│   │   │   └── src
│   │   │       ├── hut_example.app.src
│   │   │       └── hut_example.erl
│   │   ├── elixir
│   │   │   ├── config
│   │   │   │   └── config.exs
│   │   │   ├── lib
│   │   │   │   └── hut_example_elixir.ex
│   │   │   ├── Makefile
│   │   │   └── mix.exs
│   │   └── rebar3
│   │       ├── Makefile
│   │       ├── README.md
│   │       ├── rebar.config.default
│   │       ├── rebar.config.lager
│   │       ├── rebar.config.noop
│   │       ├── rebar.config.sasl
│   │       ├── rebar.config.script
│   │       └── src
│   │           ├── hut_example_rebar3.app.src
│   │           └── hut_example_rebar3.erl
│   ├── hex_metadata.config
│   ├── include
│   │   └── hut.hrl
│   ├── LICENSE
│   ├── Makefile
│   ├── README.md
│   ├── rebar.config
│   ├── rebar.lock
│   └── src
│       ├── hut.app.src
│       └── hut.erl
└── ranch
    ├── ebin
    │   ├── ranch_acceptor.beam
    │   ├── ranch_acceptors_sup.beam
    │   ├── ranch.app
    │   ├── ranch_app.beam
    │   ├── ranch.beam
    │   ├── ranch_conns_sup.beam
    │   ├── ranch_crc32c.beam
    │   ├── ranch_listener_sup.beam
    │   ├── ranch_protocol.beam
    │   ├── ranch_proxy_header.beam
    │   ├── ranch_server.beam
    │   ├── ranch_ssl.beam
    │   ├── ranch_sup.beam
    │   ├── ranch_tcp.beam
    │   └── ranch_transport.beam
    ├── erlang.mk
    ├── hex_metadata.config
    ├── LICENSE
    ├── Makefile
    ├── README.asciidoc
    └── src
        ├── ranch_acceptor.erl
        ├── ranch_acceptors_sup.erl
        ├── ranch_app.erl
        ├── ranch_conns_sup.erl
        ├── ranch_crc32c.erl
        ├── ranch.erl
        ├── ranch_listener_sup.erl
        ├── ranch_protocol.erl
        ├── ranch_proxy_header.erl
        ├── ranch_server.erl
        ├── ranch_ssl.erl
        ├── ranch_sup.erl
        ├── ranch_tcp.erl
        └── ranch_transport.erl

18 directories, 78 files

Question is do I have to recompile rabbitmq-server, or erlang to link these libraries, or if I can inject them into the rabbit or erls lib stack.

For the latter option, looks like we have two prospective locations on disk:

1)/var/lib/rabbitmq
2)/usr/lib64/erlang/lib

Im going to test but a little guidance would be helpful, in case I'm going down a rabbithole if erl or rabbit wont recognize the library support without compiling against it.

mforde84 commented 3 years ago

i think were talking erl libs here because all of this is either .erl or .beam files

mforde84 commented 3 years ago

so that dir after inject is

10.128.3.228 :: root -> ll
total 0
drwxr-xr-x.  5 root root  41 May 19 16:18 asn1-5.0.14
drwxr-xr-x.  4 root root  29 May 19 16:18 compiler-7.6.6
drwxr-xr-x.  4 root root  30 May 19 16:18 crypto-4.8.1
drwxr-xr-x.  6 root root  56 May 19 16:18 eldap-1.2.8
drwxr-xr-x.  6 root root  55 May 19 16:18 erl_interface-4.0.1
drwxr-xr-x.  4 root root  29 May 19 16:18 erts-11.1.5
drwxr-xr-x.  5 root root  44 May 19 16:18 eunit-2.6
drwxr-xr-x.  3 root root  56 Oct 22 17:12 gen_smtp
drwxr-xr-x. 11 root root 128 May 19 16:18 hipe-4.0.1
drwxr-xr-x.  6 root root 210 Oct 22 17:12 hut
drwxr-xr-x.  6 root root  56 May 19 16:18 inets-7.3.1
drwxr-xr-x.  5 root root  44 May 19 16:18 kernel-7.2
drwxr-xr-x.  5 root root  44 May 19 16:18 mnesia-4.18.1
drwxr-xr-x.  5 root root  41 May 19 16:18 os_mon-2.6.1
drwxr-xr-x.  4 root root  33 May 19 16:18 parsetools-2.2
drwxr-xr-x.  5 root root  45 May 19 16:18 public_key-1.9.2
drwxr-xr-x.  4 root root 127 Oct 22 17:12 ranch
drwxr-xr-x.  4 root root  29 May 19 16:18 reltool-0.8
drwxr-xr-x.  5 root root  45 May 19 16:18 runtime_tools-1.15.1
drwxr-xr-x.  4 root root  29 May 19 16:18 sasl-4.0.1
drwxr-xr-x.  8 root root  79 May 19 16:18 snmp-5.7
drwxr-xr-x.  4 root root  29 May 19 16:18 ssl-10.2
drwxr-xr-x.  5 root root  44 May 19 16:18 stdlib-3.14
drwxr-xr-x.  4 root root  33 May 19 16:18 syntax_tools-2.4
drwxr-xr-x.  8 root root  78 May 19 16:18 tools-3.4.2
drwxr-xr-x.  5 root root  44 May 19 16:18 xmerl-1.3.26

and rabbitmq-server successfully restarted

mforde84 commented 3 years ago

it is plug and play! thankgod! thankyou. you were my rubber ducky.

arjan commented 3 years ago

Great! :-)