[GH-ISSUE #546] webmail -> new message -> attach a file : fail to attach file over 1024 bytes #522

Closed
opened 2026-02-27 11:12:12 +03:00 by kerem · 6 comments
Owner

Originally created by @themr0c on GitHub (Apr 14, 2014).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/546

In the webmail, create a new message, then attach a file. If the file size is 1MB or greater, after clicking on the "attach" button, the "Send" action is running indefinitely. If the file is smaller, then the attachment is working as expected.

Tested with files created like that:

dd if=/dev/zero of=emptyfile-1023.dat  bs=1024  count=1023
dd if=/dev/zero of=emptyfile-1024.dat  bs=1024  count=1024

With a file up to 1023 bytes, like emptyfile-1023.dat : attach file is OK.
With a 1024 bytes file, like emptyfile-1024.dat : attach file is OK.

Backtrace:

Internal Server Error: /accounts/logout/
Traceback (most recent call last):
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/core/views/auth.py", line 64, in dologout
    events.raiseEvent("UserLogout", request)
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/lib/events.py", line 145, in raiseEvent
    callback(*args, **kwargs)
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/lib/events.py", line 98, in wrapped_f
    return f(*args, **kwargs)
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/extensions/webmail/general_callbacks.py", line 24, in userlogout
    if not request.user.mailbox_set.count():
  File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/utils/functional.py", line 205, in inner
    return func(self._wrapped, *args)
AttributeError: 'AnonymousUser' object has no attribute 'mailbox_set'

Originally created by @themr0c on GitHub (Apr 14, 2014). Original GitHub issue: https://github.com/modoboa/modoboa/issues/546 In the webmail, create a new message, then attach a file. If the file size is 1MB or greater, after clicking on the "attach" button, the "Send" action is running indefinitely. If the file is smaller, then the attachment is working as expected. Tested with files created like that: ``` dd if=/dev/zero of=emptyfile-1023.dat bs=1024 count=1023 dd if=/dev/zero of=emptyfile-1024.dat bs=1024 count=1024 ``` With a file up to 1023 bytes, like emptyfile-1023.dat : attach file is OK. With a 1024 bytes file, like emptyfile-1024.dat : attach file is OK. Backtrace: ``` Internal Server Error: /accounts/logout/ Traceback (most recent call last): File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/core/views/auth.py", line 64, in dologout events.raiseEvent("UserLogout", request) File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/lib/events.py", line 145, in raiseEvent callback(*args, **kwargs) File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/lib/events.py", line 98, in wrapped_f return f(*args, **kwargs) File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/modoboa/extensions/webmail/general_callbacks.py", line 24, in userlogout if not request.user.mailbox_set.count(): File "/srv/modoboa/python-virtualenv-modoboa-1.1.1/local/lib/python2.7/site-packages/django/utils/functional.py", line 205, in inner return func(self._wrapped, *args) AttributeError: 'AnonymousUser' object has no attribute 'mailbox_set' ```
kerem 2026-02-27 11:12:12 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@tonioo commented on GitHub (Apr 14, 2014):

What is your maximum attachment size ? (see Modoboa > Parameters > Webmail)

<!-- gh-comment-id:40376843 --> @tonioo commented on GitHub (Apr 14, 2014): What is your maximum attachment size ? (see Modoboa > Parameters > Webmail)
Author
Owner

@themr0c commented on GitHub (Apr 15, 2014):

10Mo, so the limit is not reached.

If the max attachment size is reached: is there an error message clearly displayed to the user ? (It should).

<!-- gh-comment-id:40458522 --> @themr0c commented on GitHub (Apr 15, 2014): 10Mo, so the limit is not reached. If the max attachment size is reached: is there an error message clearly displayed to the user ? (It should).
Author
Owner

@tonioo commented on GitHub (Apr 16, 2014):

Your stacktrace is strange because it looks like the one you pasted for #548

Are you sure it is the good one?

<!-- gh-comment-id:40576121 --> @tonioo commented on GitHub (Apr 16, 2014): Your stacktrace is strange because it looks like the one you pasted for #548 Are you sure it is the good one?
Author
Owner

@themr0c commented on GitHub (Apr 16, 2014):

indeed, it doesn't produce any stacktrace

<!-- gh-comment-id:40585167 --> @themr0c commented on GitHub (Apr 16, 2014): indeed, it doesn't produce any stacktrace
Author
Owner

@tonioo commented on GitHub (Apr 16, 2014):

And what about nginx? It seems you receive a 413 error...

<!-- gh-comment-id:40590411 --> @tonioo commented on GitHub (Apr 16, 2014): And what about nginx? It seems you receive a 413 error...
Author
Owner

@themr0c commented on GitHub (Apr 17, 2014):

As you advised me limit has to be configured in modoboa AND in nginx: http://cnedelcu.blogspot.fr/2013/09/nginx-error-413-request-entity-too-large.html

server {
    client_max_body_size 500M; # allows file uploads up to 500 megabytes
    [...]
}

Sorry for the noise.

<!-- gh-comment-id:40722983 --> @themr0c commented on GitHub (Apr 17, 2014): As you advised me limit has to be configured in modoboa AND in nginx: http://cnedelcu.blogspot.fr/2013/09/nginx-error-413-request-entity-too-large.html ``` server { client_max_body_size 500M; # allows file uploads up to 500 megabytes [...] } ``` Sorry for the noise.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#522
No description provided.