Exemple #1
0
def rawEmail(f, msg, envelope):
    
    header = rawHeader(f)
    body = rawBody(f)
    metaData = getMetaData(msg)        
    statsData = getStatsData(envelope)
    
    #metaData[0] is uid (inbox)
    key = createKey(metaData[0], envelope)
    
    cass.writeMetaData(key, metaData, statsData, [])    
    cass.writeContent(key, envelope, header, body)
Exemple #2
0
def mimeEmail(f, msg, envelope, emailFile):
        
    header = rawHeader(f)    
    metaData = getMetaData(msg)  
    statsData = getStatsData(envelope)
    
    #metaData[0] is uid (inbox)
    key = createKey(metaData[0], envelope)
    
    #find attachment's boundary and write attachments
    attachments = []
    bSet = set()

    metaAttachment(msg, "", 0, attachments, bSet)
    
    if len(attachments) != 0:
        aES = []
        
        for a in attachments:
            aES.append(a)
        
        ret = newRawBody(key, f, attachments, bSet)
        
        if ret:
            (body, attach) = ret        
            
        else:
            print 'Error: Bad email <' + emailFile + '>'
            #
            #write whole email into DB
            body = rawBody(f)
            attach = []
            
        cass.writeMetaData(key, metaData, statsData, attach)    
        
            
    #MIME email w/out attachments
    else:        
        body = rawBody(f)

        cass.writeMetaData(key, metaData, statsData, [])    
        
        
    cass.writeContent(key, envelope, header, body)