diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5ab552c7..4083866a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,13 +10,17 @@ on: - master jobs: ci: - name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}} + name: Checks and tests on OTP-${{matrix.otp_vsn}}, ${{matrix.os}}, ${{matrix.profile}} runs-on: ${{matrix.os}} strategy: matrix: - otp_vsn: [20.3, 21.3, 22.3, 23.1] + otp_vsn: [21.3, 22.3, 23.3, 24.0] os: [ubuntu-latest] + profile: [test, ranch18, ranch20] + exclude: + - otp_vsn: 24.0 # ranch 1.7 does not work on OTP24+ + profile: test container: image: erlang:${{matrix.otp_vsn}} @@ -26,10 +30,10 @@ jobs: - name: xref run: make xref - name: Test - run: make test + run: make test REBAR_PROFILE=${{ matrix.profile }} - name: Proper - run: make proper + run: make proper REBAR_PROFILE=${{ matrix.profile }} - name: Cover - run: make cover + run: make cover REBAR_PROFILE=${{ matrix.profile }} - name: Dialyze run: make dialyze diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3b5c3077..7176f4e7 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -10,12 +10,12 @@ on: - master jobs: ci: - name: Run checks and tests over ${{matrix.otp_vsn}} and ${{matrix.os}} + name: Build edocs ${{matrix.otp_vsn}} and ${{matrix.os}} runs-on: ${{matrix.os}} strategy: matrix: - otp_vsn: [21.3, 22.3, 23.1] + otp_vsn: [21.3, 22.3, 23.3, 24.0] os: [ubuntu-latest] container: diff --git a/Makefile b/Makefile index d535a238..136baa5d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ MINIMAL_COVERAGE = 75 +REBAR_PROFILE = test + compile: @./rebar3 compile @@ -8,13 +10,13 @@ clean: test: ERL_AFLAGS="-s ssl" - ./rebar3 eunit -c + ./rebar3 as $(REBAR_PROFILE) eunit -c proper: - ./rebar3 proper -c + ./rebar3 as $(REBAR_PROFILE) proper -c cover: - ./rebar3 cover --verbose --min_coverage $(MINIMAL_COVERAGE) + ./rebar3 as $(REBAR_PROFILE) cover --verbose --min_coverage $(MINIMAL_COVERAGE) dialyze: ./rebar3 as dialyzer dialyzer diff --git a/rebar.config b/rebar.config index ca2cb255..2e607286 100644 --- a/rebar.config +++ b/rebar.config @@ -53,6 +53,8 @@ ]} ]} ]}, + {ranch18, + [{deps, [{ranch, "1.8.0"}]}]}, {ranch20, [{deps, [{ranch, "2.0.0"}]}]}, {test, diff --git a/rebar3 b/rebar3 index 0eb67ca6..c052f9ac 100755 Binary files a/rebar3 and b/rebar3 differ diff --git a/src/gen_smtp_server_session.erl b/src/gen_smtp_server_session.erl index f5de7671..2b11311f 100644 --- a/src/gen_smtp_server_session.erl +++ b/src/gen_smtp_server_session.erl @@ -191,7 +191,8 @@ init([Ref, Transport, Socket, Module, Options]) -> {ok, Banner, CallbackState} -> Transport:send(Socket, ["220 ", Banner, "\r\n"]), ok = Transport:setopts(Socket, [{active, once}, - {packet, line}]), + {packet, line}, + binary]), {ok, #state{socket = Socket, transport = Transport, module = Module, @@ -683,7 +684,7 @@ handle_request({<<"STARTTLS">>, <<>>}, #state{socket = Socket, module = Module, case ranch_ssl:handshake(Socket, [{packet, line}, {mode, list}, {ssl_imp, new} | TlsOpts2], 5000) of %XXX: see smtp_socket:?SSL_LISTEN_OPTIONS {ok, NewSocket} -> ?log(debug, "SSL negotiation sucessful~n"), - ranch_ssl:setopts(NewSocket, [{packet, line}]), + ranch_ssl:setopts(NewSocket, [{packet, line}, binary]), {ok, State#state{socket = NewSocket, transport = ranch_ssl, envelope=undefined, authdata=undefined, waitingauth=false, readmessage=false, tls=true, callbackstate = Module:handle_STARTTLS(OldCallbackState)}};