title: How do I rename multiple files beginning with a Unix timestamp - imapsync issue
body: <p>I didn't got the script from <code>imapsync</code> to rename maildir filenames to work. :-/</p>
  
  <p>So what I need is: </p>
  
  <p>I have a mail folder with thousands of mails. After importing those emails to my new server, the filename of the emails got the creation date as a <code>Unix</code> timestamp in the filename, but the creation date flag of the file is the correct receive date from the email.</p>
  
  <p>ls -l for one file looks like this:</p>
  
  <pre><code>-rw-r--r-- 1 popuser popuser  1350432 2013-03-16 07:22 1363563215.M562903P29332V0000000000000802I0000000000AEA46B_527.my-domain.org,S=1350432:2,S
  </code></pre>
  
  <p>So what the script has to do is: 
  1) read the creation date/time of the file (I found the command</p>
  
  <pre><code>stat -c %y filename
  </code></pre>
  
  <p>does this)</p>
  
  <p>2) convert the date/time from 1) to a Unix timestamp</p>
  
  <pre><code>date -d "2013-03-17 11:19:01.000000000 +0100" "+%s"
  </code></pre>
  
  <p>3) delete the first 10 digits (wrong timestamp) of the filename and us the the timestamp from 2) instead</p>
  
  <p>4) do this for all files in a specific directory</p>
  
  <p>I'm a newby in <code>Linux</code> scripts, can anyone help me with this script?</p>
  
  <p>Thank you!</p>