Delete Trash via command line? - also imapsync followup

Discussion in 'Server Operation' started by CapnJoe, May 28, 2012.

  1. CapnJoe

    CapnJoe New Member

    We decided to migrate to a different server with the postfix errors restricting email.

    I made a shell script to transfer from one server to another with imapsync, just a note make sure your end of line (EOL) are in Unix compatibility or it will send the CR as part of the password and fail. After recieving errors from the server of too many files I had to add the flag to skip Trash folders.

    while IFS=',' read u p1 p2
    imapsync --noauthmd5 --host1 localhost --ssl1 --user1 $u --password1 $p1 --host2 box*** --user2 $u --ssl1 --authmech2 LOGIN --password2 $p2 --exclude '(?i)\b(Junk|Spam|Trash)\b'
    echo "User Ran"
    done < KTU-imapsync-rerun.csv
    Called this command and dumped the output into a text file

    ./ | tee

    To MY question: Is there any serverside way to delete the trash files that were transfered from the users?

Share This Page