( echo "#!/bin/bash"
  [ "x" = "x$1" ] && exit
  echo "touch -d \"\$( egrep '^Date: ' $1 | head -1 | sed 's/^Date: //')\" $1' ) >> 
/tmp/timechange.sh

chmod +x /tmp/timechange.sh

find  /path/to/maildirs -type f | xargs -n 1 /tmp/timechange.sh

This is untested, and it won't be fast, but if you only need to do it
once then it should work.

Note, the above is untested, requires gnu touch, etc. etc.  YMMV, all
colors not available at all dealers.  It shouldn't break anything
aside from the datestamp on your maildir files, so test it first.

-Peter

On Thu, Jul 31, 2003 at 10:56:51AM -0500, DY wrote:
> Hi all,
> 
> Just curious.  I know that mail clients and servers can utilize a couple
> of forms of "dating" for mail messages, one being the actual date header
> and one being the timestamp of the mail file itself (I believe this
> corresponds, for example, to Pine's sorting by date vs. arrival).  I may
> not be exactly right here, and there may be more ways, but what I'm
> wondering is whether anybody knows of an already-written utility to scan
> through a maildir and "reset" the file timestamps based on the date header
> in the mail message.  In transferring a bunch of my mail to my new server,
> I can copy lots of mail back and forth using IMAP, but (especially for
> Pine) it would be nice to actually reset the timestamps on the messages so
> that they really do exist in the order they arrived.  Now, resetting based
> on the date header doesn't help for those messages I've received from
> users whose computers' clocks were set to the year 2024, but those are
> mostly exceptions.
> 
> Anyway, this is not a big deal at all, but I thought somebody might know
> of a utility already written to do this.  I've Googled but haven't found
> anything, and I can't spare the time to write it myself.  It may be that
> everybody else has already determined that this is not worth it (so why
> write a script/utility to do it?), in which case I can just forget about
> it.
> 
> Thanks in advance, if you know of something out there.
> 
> Regards,
> --
> DY
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
> _______________________________________________
> courier-users mailing list
> [EMAIL PROTECTED]
> Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

-- 
The 5 year plan:
In five years we'll make up another plan.
Or just re-use this one.



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to