Provo. Grazie mille!!
2015-10-16 10:58 GMT+02:00 Riccardo Lemmi <ricca...@reflab.com>: > Riccardo Brazzale wrote: > > > Ciao a tutti. > > > > Premetto che non so se il problema sta dalla parte di python ma ci > > provo, non vorrei che bastasse un niente sul codice e il problema > > scompare.... > > > > Ho questo programma che manda a destra e a manca dei documenti pdf: > > > > msg = MIMEMultipart() > > msg['From'] = mailfrom > > msg['To'] = to > > msg['Subject'] = subject > > part = MIMEBase('application', 'octet-stream') > > part.set_payload(open(attach, 'rb').read()) > > Encoders.encode_base64(part) > > part.add_header('Content-Disposition', > > 'attachment; filename="%s"' % > > os.path.basename(attach)) > > testa = text > > piede = footer > > part1 = MIMEText(testa, 'html') > > part2 = MIMEText(piede, 'html') > > msg.attach(part) > > msg.attach(part1) > > msg.attach(part2) > > server.sendmail(mailusername, to, msg.as_string()) > > server.quit() > > > > Ho dei rarissimi casi in cui mi torna questo: > > > > The message WAS NOT relayed to: > > > > <a...@acme.com <i...@bizeta-macchinehf.it>>: > > > > 554 5.6.0 bounce, id=24119-12 - bad header > > > > This nondelivery report was generated by the program amavisd-new at > > host > > > > s2.asws3.com. Our internal reference code for your message is > > > > 24119-12/qf8Mkr96lFAq > > > > INVALID HEADER > > Missing required header field: "Date" > > > > Googlando in giro ho trovato che amavisd fa di queste cose ma non ho > > trovato un workaround per risolvere tranne quello che il destinatario > > debba mettere le mani sulle configurazioni di spamassasin e amavisd. > > > > Ho qualche speranza? > > > > Grazie > > > > Hai provato ad aggiungere l'header mancate? > > msg['Date'] = time.asctime() > > > -- > Riccardo Lemmi > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python > -- Riccardo Brazzale
_______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python