Path: csiph.com!usenet.pasdenom.info!news.albasani.net!newsfeed.freenet.ag!news2.euro.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'fetch': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:Getting': 0.09; 'complains': 0.16; 'empty.': 0.16; 'mistake;': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'structure.': 0.16; 'specifies': 0.17; 'otherwise,': 0.20; 'header:User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.28; 'went': 0.28; 'fine': 0.28; 'writes:': 0.29; 'structure': 0.32; 'subject:attachment': 0.33; 'to:addr:python-list': 0.33; 'wrong': 0.34; 'something': 0.35; 'received:org': 0.36; 'subject:" ': 0.36; 'subject:with': 0.36; 'should': 0.36; 'charset:us-ascii': 0.36; 'itself': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'received:217': 0.68; 'blame.': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dieter Maurer Subject: Re: Getting "empty" attachment with smtplib Date: Thu, 15 Nov 2012 08:37:24 +0100 References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e092b8.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:kgcWKDFJ8GVquqYS5GDhVmT+yjM= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1352965056 news.xs4all.nl 6878 [2001:888:2000:d::a6]:41019 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:33374 Tobiah writes: > I just found out that the attachment works fine > when I read the mail from the gmail website. Thunderbird > complains that the attachment is empty. The MIME standard (a set of RFCs) specifies how valid messages with attachments should look like. Fetch the mail (unprocessed if possible) and look at its structure. If it is conformant to the MIME standard, then "Thunderbird" made a mistake; otherwise, something went wrong with the message construction. I can already say that "smtplib" is not to blame. It is (mostly) unconcerned with the internal structure of the message -- and by itself will not empty attachments.