help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] safty of my script


From: Martin
Subject: [Help-bash] safty of my script
Date: Sun, 09 Mar 2014 13:21:35 +0100
User-agent: mu4e 0.9.9.5; emacs 24.3.1

Hi there,

Looking at the web, there is no possibilty to combine offlineimap with
spamassassin.  So I wrote a script, and now I'd like to know about your
experience, how I could make it more safe if there is any problem with
offlineimap or spamc (from spamassasin) not to loose emails.  Here is my
first version so far (which I don't really use, I'm a little afraid of
loosing emails.):


---- start ~/bin/email_sync.sh ----
#!/bin/bash

cd ~/Maildir
touch .before_start_offlineimap
offlineimap

files=$(find . -type f -newer .before_start_offlineimap  | grep new)

for f in ${files}
do
    t=$(mktemp -t email-sync-XXXXXXXXXXXXXX)
    mv "${f}" "${t}"
    spamc < "${t}" > "${f}"
    rm "${t}"
done

rm .before_start_offlineimap
---- end ----

Thanks for your help,
Martin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]