Skip to content

[feature request] Replacing labels on mbox-restore #227

Open
@smarek

Description

@smarek

Using latest version of GIT provided GYB

Situation: Google Takeout (G Suite Takeout) is from "Czech" locale (label Inbox is "Doručené", etc...)

Feature request: Map original label name to new label name, such as

./gyb.py --action restore-mbox --label-map Doručené,Inbox --label-map Důležité,Important ...

Temporary solution, i've successfully used, is to replace given labels with new ones in the mbox file, like this

# get list of labels sorted with count
grep X-Gmail-Labels Veškerá\ pošta\ včetně\ spamu\ a\ koše.mbox | sort -h | uniq -c | sort -n
# replace one of the labels appropriately
# care about placing ^ on the beginning of label and $ on the end, to not match partial labels
sed -i "s|^X-Gmail-Labels: =?UTF-8?Q?Odesl=C3=A1no,Nep=C5=99e=C4=8Dten=C3=A9?=$|X-Gmail-Labels: Sent,Unread|g" Veškerá\ pošta\ včetně\ spamu\ a\ koše.mbox
# after all the labels are replaced with correct ones, proceed with restore-mbox action

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions