5 # Check servername, username, password are supplied.
7 echo "Usage: $0 servername username password"
8 echo "eg: $0 wiki.example.com fred secret"
19 curl="curl -c $cj -o /dev/null -s -w %{http_code}"
21 # Login to the remote server. The side-effect of this is just to put
22 # a cookie in the cookie jar.
23 rv=`$curl -F username="$username" -F password="$password" http://$servername/_bin/login.cmo`
24 if [ "$rv" != 200 ]; then
25 echo "Login failed. Username or password incorrect."
29 curl="curl -b $cj -c $cj -o /dev/null -s -w %{http_code}"
31 # Import the mail messages.
33 rv=`$curl -F file="<$m" http://$servername/_bin/mail_import.cmo`
34 if [ "$rv" != 200 ]; then
35 echo "Warning: Failed to import message $m"
39 # Remove any temporary files.