Преглед изворни кода

Import email from a directory

Bob Mottram пре 10 година
родитељ
комит
82d6ca6733
1 измењених фајлова са 23 додато и 0 уклоњено
  1. 23
    0
      install-freedombone.sh

+ 23
- 0
install-freedombone.sh Прегледај датотеку

75
 MY_GPG_PUBLIC_KEY=
75
 MY_GPG_PUBLIC_KEY=
76
 MY_GPG_PRIVATE_KEY=
76
 MY_GPG_PRIVATE_KEY=
77
 
77
 
78
+# If you have existing mail within a Maildir
79
+# you can specify the directory here and the files
80
+# will be imported
81
+IMPORT_MAILDIR=
82
+
78
 # The Debian package repository to use.
83
 # The Debian package repository to use.
79
 DEBIAN_REPO="ftp.de.debian.org"
84
 DEBIAN_REPO="ftp.de.debian.org"
80
 
85
 
1073
   echo 'dynamic_dns_freedns' >> $COMPLETION_FILE
1078
   echo 'dynamic_dns_freedns' >> $COMPLETION_FILE
1074
 }
1079
 }
1075
 
1080
 
1081
+function import_email {
1082
+  if grep -Fxq "import_email" $COMPLETION_FILE; then
1083
+      return
1084
+  fi
1085
+  if [ $IMPORT_MAILDIR ]; then
1086
+      if [ -d $IMPORT_MAILDIR ]; then
1087
+	      echo 'Transfering email files'
1088
+	      cp -r $IMPORT_MAILDIR/* /home/$MY_USERNAME/Maildir/
1089
+	      chown -R $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/Maildir
1090
+	  else
1091
+		  echo "Email import directory $IMPORT_MAILDIR not found"
1092
+		  exit
1093
+	  fi
1094
+  fi
1095
+  echo 'import_email' >> $COMPLETION_FILE
1096
+}
1097
+
1076
 function install_final {
1098
 function install_final {
1077
   if grep -Fxq "install_final" $COMPLETION_FILE; then
1099
   if grep -Fxq "install_final" $COMPLETION_FILE; then
1078
       return
1100
       return
1115
 folders_for_mailing_lists
1137
 folders_for_mailing_lists
1116
 folders_for_email_addresses
1138
 folders_for_email_addresses
1117
 dynamic_dns_freedns
1139
 dynamic_dns_freedns
1140
+import_email
1118
 install_final
1141
 install_final
1119
 echo 'Freedombone installation is complete'
1142
 echo 'Freedombone installation is complete'