【将Gmail迁移到googleapps的imapsync脚本】笛里谁知壮士心,沙头空照征人骨。这篇文章主要讲述将Gmail迁移到googleapps的imapsync脚本相关的知识,希望能为你提供帮助。
Based on the good initial coverage [over here](http://www.thamtech.com/blog/2008/03/29/gmail-to-google-apps-email-migration/).
- #!/bin/bash LOGFILE=imapsync.log FOLDERS=( 'Folder1' 'Folder2' 'Folder3' 'Folder4' '...' 'FolderN' 'INBOX' 'All Mail' 'Bin' 'Drafts' 'Starred' 'Sent Mail' ) TIMES=( '--minage 1090' '--maxage 1091 --minage 999' '--maxage 1000 --minage 908' '--maxage 909 --minage 817' '--maxage 818 --minage 726' '--maxage 727 --minage 635' '--maxage 636 --minage 544' '--maxage 545 --minage 453' '--maxage 454 --minage 362' '--maxage 363 --minage 271' '--maxage 272 --minage 180' '--maxage 181 --minage 89' '--maxage 90' ) echo " Starting" > $LOGFILE for FOLDER in " [email protected]" do for ((j=0; j< ${#TIMES}; j++)) do TIME=${TIMES[${j}]} echo " " > > $LOGFILE echo " *** $FOLDER $TIME ***" > > $LOGFILE echo " " > > $LOGFILE while ! ~/imapsync-1.267/imapsync --host1 imap.gmail.com--port1 993 --user1 [email protected]--passfile1 ./passfile --ssl1--host2 imap.gmail.com--port2 993 --user2 [email protected]--passfile2 ./passfile --ssl2--syncinternaldates --split1 100 --split2 100--authmech1 LOGIN --authmech2 LOGIN--include " $FOLDER" $TIME--useheader " Message-ID" --useheader " Date" --skipsize--regexmess 's/Delivered-To: user@gmail.com/Delivered-To: user@domain.com/gi'--regexmess 's/< user@gmail.com> /< user@domain.com> /gi'--regexmess 's/^((To|From|Cc|Bcc):.*)user@gmail.com(.*)$/$1user@domain.com$3/gim'--regexmess 's/Subject:(s*) /Subject: (no--subject)$1 /ig'--regexmess 's/Subject: ([Rr][Ee]):(s*) /Subject: $1: (no--subject)$2 /gi' > > $LOGFILE 2> & 1; do echo " " > > $LOGFILE echo " ***** NOT COMPLETE - $FOLDER $TIME *****" > > $LOGFILE echo " " > > $LOGFILE tail -100 $LOGFILE | mail -s " Imapsync Restarting for $FOLDER $TIME" " [email protected]" echo -n " Sleeping..." > > $LOGFILE sleep 1m echo " Done." > > $LOGFILE done echo " " > > $LOGFILE echo " ***** COMPLETE - $FOLDER $TIME*****" > > $LOGFILE echo " " > > $LOGFILE tail -100 $LOGFILE | mail -s " Imapsync Complete for $FOLDER $TIME" " [email protected]" done done echo " **** DONE ****" > > $LOGFILE tail -100 $LOGFILE | mail -s " Imapsync Complete" -c " [email protected]"
推荐阅读
- 模仿ASP.NET和#039经典ASP中的AppendFormat方法
- 使用applescript创建并发送电子邮件
- 使用Intent从Android发送电子邮件
- 基于adb的Android端口转发
- Android警报对话框
- Appcelerator(简单的邮政编码城市查找器)
- Kickapps(确定用户是否登录到外部页面)
- [jQuery]Appel脚本chez google API
- 在Android应用程序中集成Adobe Photoshop Mobile