rpmigrate - rohrpost - A commandline mail client to change the world as we see it.
(HTM) git clone git://r-36.net/rohrpost
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
rpmigrate (465B)
---
1 #!/bin/sh
2
3 if [ $# -lt 3 ];
4 then
5 printf "usage: %s cfgfrom cfgto folder\n" "$(basename $0)" >&2
6 exit 1
7 fi
8
9 cfgfrom="$1"
10 cfgto="$2"
11 folder="$3"
12
13 rpfold -qc "$cfgfrom" -l "$3"
14 if [ $? -gt 0 ];
15 then
16 printf "'%s' does not exist in '%s'\n" "$folder" "$cfgfrom" >&2
17 exit 1
18 fi
19
20 rpfold -qc "$cfgto" -l "$3"
21 [ $? -gt 0 ] && rpfold -n "$3"
22
23 for msg in $(rpids -c "$cfgfrom" :);
24 do
25 printf "msgid %d\n" "$msg"
26 rpview -r -c "$cfgfrom" "$msg" | rpadd -c "$cfgto" -q;
27 done
28