KostyaEsmukov / smtp_to_telegram

A small program that listens for SMTP and sends all incoming Email messages to Telegram
MIT License
327 stars 80 forks source link

Make max_size configurable for Guerrilla #21

Closed janost closed 3 years ago

janost commented 3 years ago

Thank you for this, very handy tool!

While sending emails with several attached images I encountered the following issue:

Error: maximum DATA size exceeded

The cause of this issue seems to be that Guerrilla defaults to 10M as the maximum message size. Guerrilla allow this to be configured, however currently smtp_to_telegram doesn't seem to override this configuration.

It would be useful for users to be able to override this limit, because although Telegram has a server side limit of 10MiB for each photo, smtp_to_telegram can receive several photos in a single email and send them one by one to a Telegram chat.

I would like to request to make this configuration exposed as an environment variable or command line option.

KostyaEsmukov commented 3 years ago

Good catch, thank you! Added ST_SMTP_MAX_ENVELOPE_SIZE env var / --smtp-max-envelope-size command line option to specify the Guerrilla's MaxSize property, and raised the default from 10m to 50m.

janost commented 3 years ago

Thank you for implementing this!