<div dir="ltr"><div>Ciao a tutti.<br><br></div><div>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....<br> <br></div>Ho questo programma che manda a destra e a manca dei documenti pdf:<br><div><div><br><span style="font-family:monospace,monospace">msg = MIMEMultipart()<br>msg['From'] = mailfrom<br>msg['To'] = to<br>msg['Subject'] = subject<br>part = MIMEBase('application', 'octet-stream')<br>part.set_payload(open(attach, 'rb').read())<br>Encoders.encode_base64(part)<br>part.add_header('Content-Disposition',<br> 'attachment; filename="%s"' % os.path.basename(attach))<br>testa = text<br>piede = footer<br>part1 = MIMEText(testa, 'html')<br>part2 = MIMEText(piede, 'html')<br>msg.attach(part)<br>msg.attach(part1)<br>msg.attach(part2)<br>server.sendmail(mailusername, to, msg.as_string())<br>server.quit()</span><br><br></div><div>Ho dei rarissimi casi in cui mi torna questo:<br><br><p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">The message WAS NOT relayed to:</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB"><<a href="mailto:info@bizeta-macchinehf.it" target="_blank">abcd@acme.com</a>>:</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">554 5.6.0 bounce, id=24119-12 - bad header</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">This nondelivery report was generated by the program
amavisd-new at host</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB"><a href="http://s2.asws3.com" target="_blank">s2.asws3.com</a>. Our internal reference code for your
message is</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">24119-12/qf8Mkr96lFAq</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<p class="MsoNormal" style="text-autospace:none"><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">INVALID HEADER</span></font><font color="black" face="Courier"><span style="font-family:Courier;color:black" lang="EN-GB"></span></font></p>
<font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">Missing required header field: "Date"<br><br></span></font></div><div><span style="font-family:arial,helvetica,sans-serif"><font color="black" size="2"><span style="font-size:10pt" lang="EN-GB">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.<br><br></span></font></span></div><div><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB"><span style="font-family:arial,helvetica,sans-serif">Ho qualche speranza?<br></span><br></span></font></div><div><font color="black" face="Courier" size="2"><span style="font-size:10pt;font-family:Courier" lang="EN-GB">Grazie<br clear="all"></span></font></div><div><br>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><font face="monospace" size="2">Riccardo Brazzale</font></div><div dir="ltr"><br></div></div></div></div></div>
</div></div></div>