ef8512e54e8bbba986756d4dc218e5dd561a2d26
[mail.git] / getmail.sh
1 #/bin/bash
2
3 # Copyright (C) 2014, 2015 Gabriel PĂ©rez-Cerezo <gabriel@gpcf.eu>
4 # See LICENSE file for license details.
5
6 # This script fetches mail over rsync and then deletes the messages
7 # left on the server.
8 . "$HOME/.mail_config.sh"
9 ssh-add -l > /dev/null || if [ -n "$DISPLAY" ]; then ssh-add < /dev/null ; else ssh-add; fi
10 RSYNC_CONNECT_PROG='torify ssh' rsync --remove-source-files --timeout 20 -avzhe ssh "$server:$serverdir" "$inboxnew" > /dev/null 2>&1 || [ $? -eq 23 ]
11 mu index >/dev/null 2>&1 &