sending HTML emails with inline images attached

#! /usr/bin/python
# -*- coding: utf-8 -*-
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from email.header import Header

def sendEmail(you,greatingLine):
        # me == my email address
        # you == recipient's email address
        me = "VFSN Praesident "

        # Create message container - the correct MIME type is multipart/alternative.
        #msg = MIMEMultipart('alternative')
        msg = MIMEMultipart('related')
        msg['Subject'] = Header("Verein Flugschneise Süd - NEIN","utf-8")
        msg['From'] = me
        msg['To'] = you

        # Create the body of the message (a plain-text and an HTML version).
        f = open('Mail_4.html', 'r')
        mail_content = f.read()
        f.close()
        mail_content = mail_content.replace('%Anrede%',greatingLine)
        mail_content = mail_content.replace('vfsn.gif','cid:vfsn.gif')
        html = mail_content
                                                                                                                                                                                                
        # Record the MIME types of both parts - text/plain and text/html.                                                                                                                       
        part2 = MIMEText(html, 'html')                                                                                                                                                          
                                                                                                                                                                                                
        part3_data = open('vfsn.gif', 'rb').read()                                                                                                                                              
        part3 = MIMEImage(part3_data, 'gif')                                                                                                                                                    
        part3.add_header('Content-ID', '')                                                                                                                                            
        part3.add_header('Content-Disposition', 'attachment', filename='vfsn.gif')
        part3.add_header('Content-Disposition', 'inline', filename='vfsn.gif')

        part4_data = open('Bauverbot im Sueden_2_LQ.pdf', 'rb').read()
        part4 = MIMEImage(part4_data, 'pdf')
        part4.add_header('Content-Disposition', 'attachment', filename='Bauverbot im Sueden_2_LQ.pdf')
        part4.add_header('Content-Disposition', 'inline', filename='Bauverbot im Sueden_2_LQ.pdf')

        # Attach parts into message container.
        # According to RFC 2046, the last part of a multipart message, in this case
        # the HTML message, is best and preferred.
        msg.attach(part2)
        msg.attach(part3)
        msg.attach(part4)

        # Send the message via local SMTP server.
        s = smtplib.SMTP('localhost')
        # sendmail function takes 3 arguments: sender's address, recipient's address
        # and message to send - here it is sent as one string.
        s.sendmail(me, you, msg.as_string())
        s.quit()

csv = open('Adressen_4.csv','r').read()
for line in csv.split('\n')[1:]:
        lineArray=line.split(',')
        try:
                ret=lineArray[7]+" "+lineArray[4]+" "+lineArray[5]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False

        Anrede=ret

        try:
                ret=lineArray[12]
                ret=ret.strip()
                if ret=="":
                        ret=False
        except:
                ret=False

        Mail = ret

        if Mail and Anrede:
                print 'Sending to '+Mail+' with rcp message '+Anrede
                try:
                        sendEmail(Mail,Anrede)
                except:
                        continue

openerp on CentOS-6 (with RPM)

Howdy
First fit the package depencies like described here: http://gurn3ys.tuxfamily.org/?p=65
Somehow the installation prefix of the RPMs from the daily build service(http://nightly.openerp.com/7.0/nightly/rpm/) points to /usr/local which is… unhandy
The solution is to overwrite some rpm macros which check for unpacked files…
echo “%__os_install_post %{nil}” >> ~/.rpmmacros
And then installing and rebuilding the srpm with rpmbuild -ba

networkboot, u-boot, tftp

Hi
I’m using the following boot script in order to boot uImage and device tree blob directly from my PC.
No SD card removal, no flashing.
It boots out of RAM immediately
Edit ips and ethernet address accordingly to your network and hardware configuration.
Enjoy

setenv initrd_high 0xffffffff                                                      
setenv fdt_high 0xffffffff
setenv bootargs "root=/dev/mmcblk0p1  rootdelay=10 rw console=ttyS0,115200 panic=10 clk_ignore_unused"
setenv ethaddr D2:91:80:B7:AB:5C
setenv serverip 192.168.1.147
setenv ipaddr 192.168.1.145
ext4load mmc 0 0x43000000 boot/script.bin
tftp 0x49000000 sun7i-a20-cubieboard2.dtb
tftp 0x46000000 uImage
bootm 0x46000000 - 0x49000000