-
Notifications
You must be signed in to change notification settings - Fork 6
/
maildir2gmail.sh
29 lines (25 loc) · 997 Bytes
/
maildir2gmail.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#############
# You may want to change or omit the String "Old Mail"
# You may want to change [Gmail]/Sent to your language, e.g. [Gmail]/Gesendet for german.
# GMail username and password here
# localuser for changing into local user directory
passwd=PASSWORD
localuser=LOCALUSER
#
#############
shopt -s extglob
cd $localuser
for dir in Maildir/.!(mu-size|Sent|Spam|Trash|Drafts|Templates)
do
echo "Directory: $dir"
label=${dir//\./\/}
label=${label:9}
echo "Converted to label: $label"
python /root/maildir2gmail.py -f "Old Mail/$label" -u $username -p $passwd -n "$dir/new"
python /root/maildir2gmail.py -f "Old Mail/$label" -u $username -p $passwd "$dir/cur"
echo
done
python /root/maildir2gmail.py -f "[Gmail]/Sent" -u $username -p $passwd "Maildir/.Sent/cur"
python /root/maildir2gmail.py -f "INBOX" -u $username -p $passwd "Maildir/cur"
python /root/maildir2gmail.py -f "INBOX" -u $username -p $passwd -n "Maildir/new"