Example #1
0
def cmd_thread(store, strong_id):
    msg = store.open_msg(strong_id)
    if not msg:
        return

    if msg.threadnum():
        run_mutt(store.iter_thread(msg.threadnum()))
    else:
        run_mutt([msg])
Example #2
0
def cmd_find(store, query):
    hits = store.index().search(query, count=30, date_sort=True,
    reverse=False)
    for strong_id in hits:
        msg = store.open_msg(strong_id)
        if not msg:  # HOW???
            continue
        print ('%s  %s  %-20.20s  %s' % (
            msg.date().date(),
            msg.strong_id(),
            msg.from_name() or msg.from_addr(),
            msg.subject()
        )).encode('utf-8')
Example #3
0
def cmd_mutt(store, query):
    hits = store.index().search(query, count=30)
    hits = (store.open_msg(strong_id) for strong_id in hits)
    hits = (h for h in hits if h)
    run_mutt(hits)
Example #4
0
def cmd_mbox(store, query):
    hits = store.index().search(query, count=100)
    for strong_id in hits:
        msg = store.open_msg(strong_id)
        if msg:
            mua.mboxrd.mbox_write(msg)
Example #5
0
def cmd_show(store, *strong_ids):
    for strong_id in strong_ids:
        msg = store.open_msg(strong_id)
        if msg:
            mua.mboxrd.mbox_write(msg)