OfflineIMAP / offlineimap

Read/sync your IMAP mailboxes (python2) [LEGACY: move to offlineimap3]
http://www.offlineimap.org
Other
1.78k stars 360 forks source link

Big email is downloaded despite exceeding size specified in maxsize option #635

Open belugame opened 5 years ago

belugame commented 5 years ago

General informations

uname -a && lsb_release -dr
Linux lemon 5.2.0-3-amd64 #1 SMP Debian 5.2.17-1 (2019-09-26) x86_64 GNU/Linux
Description:    Debian GNU/Linux bullseye/sid
Release:        testing

Configuration file offlineimaprc


# vim: set ft=conf
[general]
ui = Blinkenlights
metadata = ~/.offlineimap
accounts = foo, bar, baz, biz
maxsyncaccounts = 5
socktimeout = 10
pythonfile = ~/dot/offlineimap/helpers.py

[mbnames]
enabled = yes
filename = ~/dot/mutt/mailboxes
header = "mailboxes "
peritem = "+%(accountname)s/%(foldername)s"
sep = " "
footer = "\n"

[Account foo]
localrepository = foo-Local
remoterepository = foo-Remote
autorefresh = 2
quick = 20
postsynchook = ~/dot/offlineimap/post-sync-hook.sh foo
# Ignore messages bigger than 2 MB
maxsize = 2000000

[Repository foo-Local]
type = Maildir
localfolders = ~/mail/foo

[Repository foo-Remote]
type = IMAP
holdconnectionopen = yes
keepalive = 60
realdelete = yes
maxconnections = 2
remotehost = outlook.office365.com
readonly = False
createfolders = False
ssl = yes
sslcacertfile = /etc/ssl/certs/ca-certificates.crt
auth_mechanisms = LOGIN
folderfilter = lambda folder: folder in ['foo']
nametrans = lambda f: translate_folder_foo(f)

Steps to reproduce the error

I send a mail with an attachment of 3.5MB from another email account to account "foo". I'd expect offlineimap to ignore that message as the limit is 2MB, but it gets downloaded as usual.

Did I not configure it right?

lokeshwarlakhi commented 1 year ago

Hello, I am interested in working on this issue and would like to be assigned to it. I have experience in Python and believe I would be a good fit for this task. Adding the maxsize under [Repository foo-Remote] and removing from the [Account foo], will help in this case. Please let me know if I can be assigned to work on this issue. Thank you!

chris001 commented 1 year ago

@lokeshwarlakhi Would you also check to see if this issue possibly exist in , (the new python3 version), and if yes, also submit Pull Request there with a python3 version of your Pull Request from this version here?