Giter VIP home page Giter VIP logo

Comments (10)

ecederstrand avatar ecederstrand commented on September 26, 2024

I think the best option to find out what the difference between sending an item attachment from exchange and from Outlook is to create two identical emails , one from each system, and then use exchangelib to inspect all attriburtes on the two items to find out what the difference is.

from exchangelib.

Gewitsch avatar Gewitsch commented on September 26, 2024

First of all.
Thank you very much for your help :)

For the attributes I am not sure what code line to use.
print([f.name for f in Message.FIELDS if f.is_searchable])
I tried this one with

for f in nachricht.FIELDS:
   fw.write(f'{f.name} = {str(f)}')

with "fw" as a filewrite for a .txt document
The content is big and I do not know if it helps.
If you have a better approach for the needed information let me know.
attribute_0.txt
attribute_1.txt

from exchangelib.

ecederstrand avatar ecederstrand commented on September 26, 2024

I was thinking of something along these lines:

from exchangelib.items import Message

item_from_exchangelib = account.inbox.get(subject="Hello from exchangelib")
item_from_outlook = account.inbox.get(subject="Hello from outlook")

for f in Message.FIELDS:
    exchangelib_val = getattr(item_from_exchangelib, f.name)
    outlook_val = getattr(item_from_outlook, f.name)
    if exchangelib_val != outlook_val:
        print(f"Diff on field {f.name}. exchangelib: {exchangelib_val!r} Outlook: {outlook_val!r}")

from exchangelib.

Gewitsch avatar Gewitsch commented on September 26, 2024

analyse.txt

I got this textfile with the print content.
To the previous tests I reduced the mail to just the attached mail, your suggested subject, "test" as the body and the attached mail itself is very "plain" in its structure.

Hopefully this helps with finding a solution.

from exchangelib.

ecederstrand avatar ecederstrand commented on September 26, 2024

The text file only reports mime_content as being different, and that field is auto-generated. That doesn't get us any further, unfortunately.

from exchangelib.

Gewitsch avatar Gewitsch commented on September 26, 2024

Sorry my mistake. I did not format it in any way.
A little usage of notepad++ later and I got hopefully the same content just being displayed in a better way.

Now the document follows
Diff on field field.name
exchangelib: exchangelib value
Outlook: outlook value

analyse.txt

some values are ... very long.

from exchangelib.

ecederstrand avatar ecederstrand commented on September 26, 2024

The main difference I see is in the attachment:

exchangelib: [ItemAttachment(attachment_id=AttachmentId(id='AAMkADAzOWRmZmE2LWQ0OGYtNGNkOS1hYmMyLWU4MDU4ZGQxNjE0YwBGAAAAAAAqnHhcvxtCR7EVdJ/LFX5nBwC7iw9ZYLsmS4aOWEeRaxxvAAAAAAEMAAC7iw9ZYLsmS4aOWEeRaxxvAAACxrxWAAABEgAQADuaG27ZFkREkFoN0X7Hze8=', root_id=None, root_changekey=None), name='Test', content_type='application/octet-stream', content_id=None, content_location=None, size=4242, last_modified_time=EWSDateTime(2024, 2, 27, 14, 45, 44, tzinfo=EWSTimeZone(key='Europe/Berlin')), is_inline=False)] 
 Outlook: [ItemAttachment(attachment_id=AttachmentId(id='AAMkADAzOWRmZmE2LWQ0OGYtNGNkOS1hYmMyLWU4MDU4ZGQxNjE0YwBGAAAAAAAqnHhcvxtCR7EVdJ/LFX5nBwC7iw9ZYLsmS4aOWEeRaxxvAAAAAAEMAAC7iw9ZYLsmS4aOWEeRaxxvAAACxrxXAAABEgAQADz+vaxnVItFpGTwDeWWFpI=', root_id=None, root_changekey=None), name='Test', content_type=None, content_id=None, content_location=None, size=20814, last_modified_time=EWSDateTime(2024, 2, 27, 14, 46, 28, tzinfo=EWSTimeZone(key='Europe/Berlin')), is_inline=False)]

Main thing here is the difference in size and content_type. I don't know what causes that. Are you attaching the same message in both emails?

from exchangelib.

Gewitsch avatar Gewitsch commented on September 26, 2024

Yes I do attach the same message.

The attached mail has the subject = "Test", body = "Test" and no attachments itself. Very plain and simple.

What can I further do to help solving this issue?

from exchangelib.

ecederstrand avatar ecederstrand commented on September 26, 2024

I don't have any obvious ideas.

I don't really consider this a bug, since it's not a goal of exchangelib to have feature parity with Outlook, but please do post your solution here if you find one.

from exchangelib.

ecederstrand avatar ecederstrand commented on September 26, 2024

Closing, but it would still be great if you post any solution here so others can benefit :-)

from exchangelib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.