[GH-ISSUE #817] Mail show failed #727

Closed
opened 2026-02-27 11:13:15 +03:00 by kerem · 5 comments
Owner

Originally created by @ezhishui on GitHub (Dec 16, 2015).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/817

Hi,
i have sent a mail which contains a picture in body,not as a attachment.
it showed the error when visit "/webmail/#?action=viewmail&mbox=INBOX&mailid=23":

IOError at /webmail/getmailcontent
[Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg'
Request Method: GET
Request URL: https://iwho.xyz/webmail/getmailcontent?mbox=INBOX&mailid=23&links=0
Django Version: 1.7.11
Exception Type: IOError
Exception Value:
[Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg'
Exception Location: /srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py in _fetch_inlines, line 185
Python Executable: /usr/bin/uwsgi-core
Python Version: 2.7.6
Python Path:
['.',
'',
'/srv/modoboa/env/lib/python2.7',
'/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu',
'/srv/modoboa/env/lib/python2.7/lib-tk',
'/srv/modoboa/env/lib/python2.7/lib-old',
'/srv/modoboa/env/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/srv/modoboa/env/local/lib/python2.7/site-packages']
Server time: Wed, 16 Dec 2015 11:34:58 +0100

The traceback:
Environment:

Request Method: GET
Request URL: https://iwho.xyz/webmail/getmailcontent?mbox=INBOX&mailid=23&links=0

Django Version: 1.7.11
Python Version: 2.7.6
Installed Applications:
('django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.sites',
'django.contrib.staticfiles',
'reversion',
'modoboa',
'modoboa.core',
'modoboa.lib',
'modoboa_admin',
'modoboa_admin_relaydomains',
'modoboa_admin_limits',
'modoboa_amavis',
'modoboa_pdfcredentials',
'modoboa_postfix_autoreply',
'modoboa_sievefilters',
'modoboa_stats',
'modoboa_webmail')
Installed Middleware:
('x_forwarded_for.middleware.XForwardedForMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'modoboa.lib.middleware.AjaxLoginRedirect',
'modoboa.lib.middleware.CommonExceptionCatcher',
'modoboa.lib.middleware.RequestCatcherMiddleware')

Traceback:
File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  2.             return func(_args, *_kwargs)
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner
  3.             return func(_args, *_kwargs)
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view
  4.             return view_func(request, _args, *_kwargs)
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/lib.py" in wrapped_f
  5.             return f(request, _args, *_kwargs)
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/views.py" in getmailcontent
  6.     "mailbody": email.body if email.body else ""
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py" in body
  7.         self._fetch_inlines()
    
    File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py" in _fetch_inlines
  8.         with open(path, "wb") as fpo:
    

Exception Type: IOError at /webmail/getmailcontent
Exception Value: [Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg'

Originally created by @ezhishui on GitHub (Dec 16, 2015). Original GitHub issue: https://github.com/modoboa/modoboa/issues/817 Hi, i have sent a mail which contains a picture in body,not as a attachment. it showed the error when visit "/webmail/#?action=viewmail&mbox=INBOX&mailid=23": IOError at /webmail/getmailcontent [Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg' Request Method: GET Request URL: https://iwho.xyz/webmail/getmailcontent?mbox=INBOX&mailid=23&links=0 Django Version: 1.7.11 Exception Type: IOError Exception Value: [Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg' Exception Location: /srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py in _fetch_inlines, line 185 Python Executable: /usr/bin/uwsgi-core Python Version: 2.7.6 Python Path: ['.', '', '/srv/modoboa/env/lib/python2.7', '/srv/modoboa/env/lib/python2.7/plat-x86_64-linux-gnu', '/srv/modoboa/env/lib/python2.7/lib-tk', '/srv/modoboa/env/lib/python2.7/lib-old', '/srv/modoboa/env/lib/python2.7/lib-dynload', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib/python2.7/lib-tk', '/srv/modoboa/env/local/lib/python2.7/site-packages'] Server time: Wed, 16 Dec 2015 11:34:58 +0100 The traceback: Environment: Request Method: GET Request URL: https://iwho.xyz/webmail/getmailcontent?mbox=INBOX&mailid=23&links=0 Django Version: 1.7.11 Python Version: 2.7.6 Installed Applications: ('django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.sites', 'django.contrib.staticfiles', 'reversion', 'modoboa', 'modoboa.core', 'modoboa.lib', 'modoboa_admin', 'modoboa_admin_relaydomains', 'modoboa_admin_limits', 'modoboa_amavis', 'modoboa_pdfcredentials', 'modoboa_postfix_autoreply', 'modoboa_sievefilters', 'modoboa_stats', 'modoboa_webmail') Installed Middleware: ('x_forwarded_for.middleware.XForwardedForMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'modoboa.lib.middleware.AjaxLoginRedirect', 'modoboa.lib.middleware.CommonExceptionCatcher', 'modoboa.lib.middleware.RequestCatcherMiddleware') Traceback: File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response 1. response = wrapped_callback(request, _callback_args, *_callback_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner 2. return func(_args, *_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/db/transaction.py" in inner 3. return func(_args, *_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/django/contrib/auth/decorators.py" in _wrapped_view 4. return view_func(request, _args, *_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_admin/lib.py" in wrapped_f 5. return f(request, _args, *_kwargs) File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/views.py" in getmailcontent 6. "mailbody": email.body if email.body else "" File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py" in body 7. self._fetch_inlines() File "/srv/modoboa/env/local/lib/python2.7/site-packages/modoboa_webmail/lib/imapemail.py" in _fetch_inlines 8. with open(path, "wb") as fpo: Exception Type: IOError at /webmail/getmailcontent Exception Value: [Errno 2] No such file or directory: u'./media/modoboa_webmail/23_DAE3C92E@E70C435A.430E7156.jpg'
kerem closed this issue 2026-02-27 11:13:15 +03:00
Author
Owner

@tonioo commented on GitHub (Dec 16, 2015):

Looks like the /srv/modoboa/instance/media/modoboa_webmail folder does not exist. Create it and your issue should be fixed.

<!-- gh-comment-id:165080816 --> @tonioo commented on GitHub (Dec 16, 2015): Looks like the /srv/modoboa/instance/media/modoboa_webmail folder does not exist. Create it and your issue should be fixed.
Author
Owner

@ezhishui commented on GitHub (Dec 16, 2015):

Thank you, i will have a try tomorrow i am not sure whether the folder is exist.If it will be created automatically when the picture is received will be better.

<!-- gh-comment-id:165095799 --> @ezhishui commented on GitHub (Dec 16, 2015): Thank you, i will have a try tomorrow i am not sure whether the folder is exist.If it will be created automatically when the picture is received will be better.
Author
Owner

@ezhishui commented on GitHub (Dec 17, 2015):

I have create the folder /srv/modoboa/instance/media/modoboa_webmail, and the error disappear but i can not see the picture in the email body from Inbox of modoboa.The picture is in the folder already,and i have read the email in vmail/myuser/cur,the base64 code of the pictrue is exist.

<!-- gh-comment-id:165340442 --> @ezhishui commented on GitHub (Dec 17, 2015): I have create the folder /srv/modoboa/instance/media/modoboa_webmail, and the error disappear but i can not see the picture in the email body from Inbox of modoboa.The picture is in the folder already,and i have read the email in vmail/myuser/cur,the base64 code of the pictrue is exist.
Author
Owner

@ezhishui commented on GitHub (Dec 17, 2015):

The email page source code:

20151217141318

The tag "

" is empty.

<!-- gh-comment-id:165350909 --> @ezhishui commented on GitHub (Dec 17, 2015): The email page source code: ![20151217141318](https://cloud.githubusercontent.com/assets/15809303/11862651/6bdcc246-a4c8-11e5-9658-da1ec2c60e2e.png) The tag "<pre>" is empty.
Author
Owner

@tonioo commented on GitHub (Jan 8, 2016):

Hi, have you tried this: https://github.com/tonioo/modoboa/issues/819 ?

<!-- gh-comment-id:169981381 --> @tonioo commented on GitHub (Jan 8, 2016): Hi, have you tried this: https://github.com/tonioo/modoboa/issues/819 ?
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#727
No description provided.