Virtomize / mail2most

watch emails and send them to mattermost
MIT License
74 stars 20 forks source link

bandwidth eating #85

Open Mohamed-sobhi95 opened 9 months ago

Mohamed-sobhi95 commented 9 months ago

Describe the bug i installed the plugin on my vps with bandwidth 6TB/month before it i used maximum 1TB/month but after it the plugin eats all my 6TB bandwidth in 2 weeks

c-seeger commented 9 months ago

Hello @Mohamed-sobhi95 you can control the bandwidth by setting TimeInterval within the General Settings to a higher value. This should drastically decrease the bandwidth used. e.g: instead of 10 seconds you can set it to 600 (10 minutes).

[General]
  # File contains the default file location where mail2most stores its data
  File = "data.json"
  # RunAsService true:
  # check regularly using TimeInterval for new emails
  # false:
  # just check once when u start - requires to restart mail2most for checking again
  RunAsService = true 
  # global time interval for checking mails in seconds
  TimeInterval = 10 
wetneb commented 3 weeks ago

I can confirm that the bandwidth usage is way beyond what I would expect. Mail2most was pulling about 7MB/s constantly while the IMAP inbox had only occasional new email. The bandwidth consumption should be reasonable with the default settings.

From a cursory read of the code, it seems that it re-downloads all the message bodies and attachments every time it attempts to update. The IMAP protocol makes it easy to only download the new messages (via uid and uidvalidity) so that's what I would expect this tool to do.

wetneb commented 2 weeks ago

I've rewritten this as a Mattermost plugin which also solves this bandwidth issue: https://codeberg.org/mailmirror/mailmirror