Skip to content

issue with specifying settings for gen_ #47

@mforde84

Description

@mforde84

We're running into an issue with gen_smtp thats bouncing emails with max length greater than 10mb.

Gen_smtp controls this setting here:
https://github.com/gen-smtp/gen_smtp/blob/master/src/gen_smtp_server_session.erl#L71

However I'm not sure if its configurable in the rabbitmq_email server config block namely because the server_session.erl does not list it as an option:
https://github.com/gen-smtp/gen_smtp/blob/master/src/gen_smtp_server_session.erl#L93

Accompanying gen_smtp documentation seems to confirm this:

gen_smtp_server:start(
    smtp_server_example,
    [{sessionoptions, [{allow_bare_newlines, fix},
                       {callbackoptions, [{parse, true}]}]}]).
...
{sessionoptions, gen_smtp_server_session:options()} - see below
...
Session options are:

    {allow_bare_newlines, false | ignore | fix | strip} - see above
    {hostname, inet:hostname()} - which hostname server should send in response to HELO / EHLO commands. Default: inet:gethostname().
    {tls_options, [ssl:server_option()]} - options to pass to ssl:handshake/3 (OTP-21+) / ssl:ssl_accept/3 when STARTTLS command is sent by the client. Only needed if STARTTLS extension is enabled
    {protocol, smtp | lmtp} - when lmtp is passed, the control flow of the [Local Mail Transfer Protocol](https://tools.ietf.org/html/rfc2033) is applied. LMTP is derived from SMTP with just a few variations and is used by standard [Mail Transfer Agents (MTA)](https://en.wikipedia.org/wiki/Message_transfer_agent), like Postfix, Exim and OpenSMTPD to send incoming email to local mail-handling applications that usually don't have a delivery queue. The default value of this option is smtp.
    {callbackoptions, any()} - value will be passed as 4th argument to callback module's init/4

Am I missing something obvious here where it's possible to override this setting:
https://github.com/gen-smtp/gen_smtp/blob/fe4f164353d1a08fe0a64200c75fa358abe57b29/src/gen_smtp_server_session.erl#L37

I've tried through the rabbitmq_email server_config block but unsuccessfully

	{rabbitmq_email, [
		{server_config, [
			[{port, 2525}, {protocol, tcp}, {domain, "cqvlhbqe001.test.cm.com"},{auth, never}, {tls, never}, {address,{0,0,0,0}}], [{sessionoptions, [{maxsize, 200}]}]

I assume I need to merge a change to gen_smtp_server_session.erl to include maxsize as a definable option, correct? that or i need to fork, and build rabbitmq_email with my fork?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions