gotthardp / rabbitmq-email

SMTP Gateway Plugin for RabbitMQ
Mozilla Public License 2.0
179 stars 20 forks source link

Duplicated size statement in EHLO #55

Closed a-marcellini closed 1 year ago

a-marcellini commented 1 year ago

I've found a strange problem with the new release: if I use a client to send an email to rabbit directly it works. However, if it is a mail server (postfix) that forward the same mail to rabbit, using it as a relay, it doesn't work. Moreover: If I use telnet:

telnet <rabbitserver> <mailport> The strange answer is:

EHLO MyServer
250-mail.local
250-AUTH PLAIN LOGIN
250-SIZE 41943040
250-SIZE 10485760
250-8BITMIME
250-PIPELINING
250 SMTPUTF8

Where 41943040 is the message size I put in rabbit.config while 10485760 is the default gen_smtp size, I suppose.

lukebakken commented 1 year ago

Thanks for the report. Investigating!

lukebakken commented 1 year ago

@a-marcellini

However, if it is a mail server (postfix) that forward the same mail to rabbit, using it as a relay, it doesn't work.

What is logged by Postfix in this situation?

lukebakken commented 1 year ago

The problem is that I didn't do exactly the same thing as this code:

https://github.com/gen-smtp/gen_smtp/issues/306#issuecomment-1280371371

Note that it deletes the existing SIZE extension.

a-marcellini commented 1 year ago

@a-marcellini

However, if it is a mail server (postfix) that forward the same mail to rabbit, using it as a relay, it doesn't work.

What is logged by Postfix in this situation?

...
mailserver         | Oct 20 14:02:53 mailserver postfix-in/smtp[472]: A08C12A583D: to=<address2@mail.local>, relay=rabbitmq[172.23.0.5]:2525, delay=3.9, delays=3.8/0.03/0.03/0, dsn=5.3.4, status=bounced (message size 13760367 exceeds size limit 10485760 of server rabbitmq[172.23.0.5])

It seems it simply considers the smaller or the last size statement.

lukebakken commented 1 year ago

@a-marcellini - https://github.com/gotthardp/rabbitmq-email/releases/tag/v1.1.1