diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 4c405dc..0625c5f 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -11,15 +11,13 @@ on: jobs: CI: name: Build and test on Erlang/OTP ${{ matrix.otp-version }} - runs-on: ubuntu-18.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: otp-version: [23, 24] - env: - LATEST_OTP_RELEASE: 24 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: erlef/setup-beam@v1 with: otp-version: ${{matrix.otp-version}} diff --git a/Makefile b/Makefile index 811fa49..ccfb30c 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ DEP_RANCH_VERSION = 2.1.0 dep_ranch = ranch $(DEP_RANCH_VERSION) dep_eiconv = hex 1.0.0 -dep_gen_smtp = git https://github.com/gen-smtp/gen_smtp.git master +dep_gen_smtp = git https://github.com/gen-smtp/gen_smtp.git 1.1.1 DEPS = gen_smtp rabbit_common amqp_client rabbit eiconv diff --git a/README.md b/README.md index ad0d7db..d12ff1d 100644 --- a/README.md +++ b/README.md @@ -19,14 +19,14 @@ contributions are encouraged. ## Installation -Due to the dependency on the `eiconv` library, which has a C source code component, this plugin must be compiled from source. If you are planning to use RabbitMQ version 3.9.10: +Due to the dependency on the `eiconv` library, which has a C source code component, this plugin must be compiled from source. If you are planning to use RabbitMQ version 3.9.13: ``` git clone https://github.com/gotthardp/rabbitmq-email.git cd rabbitmq-email -make RABBITMQ_VERSION=v3.9.10 +make make tests # optional -make dist +make RABBITMQ_VERSION=v3.9.13 dist ``` Copy the following directories to your RabbitMQ `plugins/` directory: @@ -34,10 +34,10 @@ Copy the following directories to your RabbitMQ `plugins/` directory: ``` plugins/eiconv-1.0.0 plugins/gen_smtp-1.1.1 -plugins/rabbitmq_email-1.0.0 +plugins/rabbitmq_email-1.0.1 ``` -Note that as of version 1.0.0 this plugin has been tested with RabbitMQ v3.9.x versions only. +Note that as of version 1.0.1 this plugin has been tested with RabbitMQ v3.9.x versions only. ## Documentation diff --git a/src/rabbit_email_sender.erl b/src/rabbit_email_sender.erl index 0477960..2b2abdf 100644 --- a/src/rabbit_email_sender.erl +++ b/src/rabbit_email_sender.erl @@ -19,8 +19,14 @@ send_email(To, Domain, {Type, Subtype}, Headers, Payload) -> [{<<"From">>, construct_address(From, Domain)}, {<<"To">>, ToAddr}], - Message = mimemail:encode({Type, Subtype, - lists:foldr(fun set_header/2, [], Headers2), [], Payload}), + Headers3 = lists:foldr(fun set_header/2, [], Headers2), + % Note FUTURE for gen_smtp 1.2.0: + % mimemail:encode argument: + % {Type, Subtype, Headers, ContentTypeParams, Parts} + % https://github.com/gen-smtp/gen_smtp/pull/190 + % https://github.com/gen-smtp/gen_smtp/blob/1.1.1/src/mimemail.erl#L82-L89 + % https://github.com/gen-smtp/gen_smtp/blob/c6f25a758d60da9788bf5ddf73e985dacb28f74b/src/mimemail.erl#L98-L108 + Message = mimemail:encode({Type, Subtype, Headers3, [], Payload}), % client_sender must be a valid user, whereas From doesn't have to {ok, Sender} = application:get_env(rabbitmq_email, client_sender), diff --git a/src/rabbitmq_email.app.src b/src/rabbitmq_email.app.src index 2b7edc3..bac401b 100644 --- a/src/rabbitmq_email.app.src +++ b/src/rabbitmq_email.app.src @@ -9,7 +9,7 @@ {application, rabbitmq_email, [{description, " E-mail gateway for AMQP 0-9-1"}, - {vsn, "1.0.0"}, + {vsn, "1.0.1"}, {modules, []}, {registered, []}, {mod, {rabbitmq_email_app, []}},