Explorar el Código

Import email from a directory

Bob Mottram hace 10 años
padre
commit
82d6ca6733
Se han modificado 1 ficheros con 23 adiciones y 0 borrados
  1. 23
    0
      install-freedombone.sh

+ 23
- 0
install-freedombone.sh Ver fichero

@@ -75,6 +75,11 @@ GPG_KEYSERVER="hkp://keys.gnupg.net"
75 75
 MY_GPG_PUBLIC_KEY=
76 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 83
 # The Debian package repository to use.
79 84
 DEBIAN_REPO="ftp.de.debian.org"
80 85
 
@@ -1073,6 +1078,23 @@ function dynamic_dns_freedns {
1073 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 1098
 function install_final {
1077 1099
   if grep -Fxq "install_final" $COMPLETION_FILE; then
1078 1100
       return
@@ -1115,5 +1137,6 @@ configure_firewall_for_email
1115 1137
 folders_for_mailing_lists
1116 1138
 folders_for_email_addresses
1117 1139
 dynamic_dns_freedns
1140
+import_email
1118 1141
 install_final
1119 1142
 echo 'Freedombone installation is complete'