Menu

#7 Automatically create labels

open
ozami
None
5
2015-01-03
2010-08-06
No

If a label does not exit on the imap server, an error is given.
Since I'm not proficient in python, I created a simple patch to create the label.

Simple because, every time I log on, I call the create method, and ignore any resulting errors.
The correct thing to do would be to see if the label already exists, and if not, then create it...

Still, works for me (uploading to a google account) :-)

patch created from imap-upload-1.2

Discussion

  • Jose Carlos Pereira

    patch to automatically create label

     
  • ozami

    ozami - 2010-09-03

    Thank you for your suggestion!
    I'll take in your patch.
    (I may have a try "check if the label already exists" method.)

     
  • ozami

    ozami - 2010-09-03
    • assigned_to: nobody --> ozami
     
  • Adrien Allard

    Adrien Allard - 2015-01-03

    Thanks a lot for this patch. Really helpfull if one have a lot of mbox files to upload. A simple bash script can upload them all directly to an empty GMAIL box. Let it run during the night...

    #all .mbox are in the current directory, without spaces.
    for i in *.mbox 
    do
      python imap_upload.py --user bla --password blu ---gmail --box $(basename $i .mbox) $i
    done
    
     

    Last edit: Adrien Allard 2015-01-03

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.