Exemple #1
0
    #print (subj1==subj2, body==dbbody)

    subjmatch = subj1==subj2
    if not subjmatch:
        subjmatch = subj1==clean_str(subj2)
#    if not subjmatch:
#        subj1=ast.literal_eval('"'+subj1+'"')
#        subjmatch = subj1.replace("\x0A","")==subj2.replace("\x0A","")

    print ("Same subject:",subjmatch)

    match = subjmatch and (body.strip()==dbbody.strip() or dbbody.strip().startswith(body.strip()))

    print("and same body:", match)
    if destdomname=="echo" and match and (destdomname,destaddr)==(dbdd,dbdt):
      os.unlink(os.path.join(DUPDIR,f))
      os.unlink(os.path.join(DUPDIR,f[:-4]+".status"))
      try:
        os.unlink(os.path.join(DUPDIR, fn+".db%d.msg"%dbid))
      except:
        pass

    else:
      dupf=open(os.path.join(DUPDIR, fn+".db%d.msg"%dbid), "wb")
      dbmsg,_=ftnexport.denormalize_message(
        (dbsd, dbst), (dbdd, dbdt),
        dbmsgid, dbheader, dbbody, dbcharset, echodest=ADDRESS, addpath=ADDRESS)
      dupf.write(dbmsg.pack())
      dupf.close()
Exemple #2
0
#        subj1=ast.literal_eval('"'+subj1+'"')
#        subjmatch = subj1.replace("\x0A","")==subj2.replace("\x0A","")

        print("Same subject:", subjmatch)

        match = subjmatch and (body.strip() == dbbody.strip()
                               or dbbody.strip().startswith(body.strip()))

        print("and same body:", match)
        if destdomname == "echo" and match and (destdomname,
                                                destaddr) == (dbdd, dbdt):
            os.unlink(os.path.join(DUPDIR, f))
            os.unlink(os.path.join(DUPDIR, f[:-4] + ".status"))
            try:
                os.unlink(os.path.join(DUPDIR, fn + ".db%d.msg" % dbid))
            except:
                pass

        else:
            dupf = open(os.path.join(DUPDIR, fn + ".db%d.msg" % dbid), "wb")
            dbmsg, _ = ftnexport.denormalize_message((dbsd, dbst),
                                                     (dbdd, dbdt),
                                                     dbmsgid,
                                                     dbheader,
                                                     dbbody,
                                                     dbcharset,
                                                     echodest=ADDRESS,
                                                     addpath=ADDRESS)
            dupf.write(dbmsg.pack())
            dupf.close()
Exemple #3
0
  elif header.find("recipientname").text.lower() in ("filefix", "allfix"):
    fixes_f.append((id_msg, src, time.mktime(time.strptime(header.find("date").text, "%d %b %y  %H:%M:%S")), 
        header.find("sendername").text, header.find("subject").text, msgid, body, is_local))

  else:
    continue

    # leave all other in database for sysop

    srca=db.prepare("select domain, text from addresses where id=$1").first(src)
    dsta=db.prepare("select domain, text from addresses where id=$1").first(dest)

    print(srca)

    m, mcharset = ftnexport.denormalize_message(
        (db.FTN_backdomains[srca[0]], srca[1]),
        (db.FTN_backdomains[dsta[0]], dsta[1]),
        msgid, header, body, origcharset)

    my.append((id_msg, time.mktime(time.strptime(header.find("date").text, "%d %b %y  %H:%M:%S")), m))

    print("*************"+str(id_msg)+"*"+msgid+"*****************")
    print("From:", header.find("sendername").text, src)
    print("To  :", header.find("recipientname").text, dest)
    print("Date:", header.find("date").text)
    #print("Subj:", header.find("subject").text)
#    print(body)
    # process
    # if fail abort
    # if ok update watermark update_subscription_watermark(db, localnetmailsubscription, id_msg)

Exemple #4
0
                 msgid, body, is_local))

        else:
            continue

            # leave all other in database for sysop

            srca = db.prepare(
                "select domain, text from addresses where id=$1").first(src)
            dsta = db.prepare(
                "select domain, text from addresses where id=$1").first(dest)

            print(srca)

            m, mcharset = ftnexport.denormalize_message(
                (db.FTN_backdomains[srca[0]], srca[1]),
                (db.FTN_backdomains[dsta[0]], dsta[1]), msgid, header, body,
                origcharset)

            my.append((id_msg,
                       time.mktime(
                           time.strptime(
                               header.find("date").text,
                               "%d %b %y  %H:%M:%S")), m))

            print("*************" + str(id_msg) + "*" + msgid +
                  "*****************")
            print("From:", header.find("sendername").text, src)
            print("To  :", header.find("recipientname").text, dest)
            print("Date:", header.find("date").text)
            #print("Subj:", header.find("subject").text)
#    print(body)