in reply to problem in Rfc2080 date of imap server

Unfortunately, I don't understand what the problem is you're describing. The code looks fine. Your interpretation looks fine.

Could you post the time on your system, and the string returned by Rfc2060_datetime(time) ?

--
.sig : File not found.

  • Comment on Re: problem in Rfc2080 date of imap server

Replies are listed 'Best First'.
Re^2: problem in Rfc2080 date of imap server
by luckypower (Beadle) on Sep 24, 2008 at 13:09 UTC
    Actully I want do delete msgs older than x days from server date not from client date. so i need the server date so i can calculate the timelimit.
      OK - I've found the same song sheet as everyone else now.

      As far as I can see, the IMAP protocol doesn't include an operation to ask the server what it thinks the time is. Perhaps I've missed something?

      I can think of a couple of other ideas, but I don't really like them...

      • Use NTP (Network Time Protocol) to ask the server, which should be fine so long as the server is running an NTP server as well as IMAP server and the firewall doesn't block it. Are you able to influence these factors at all?
        Timezone issues? Dunno.
      • Create a message on the server, query it's date, and delete the message again. Sorry.
      If you excuse me, I feel a little nauseous...

      --
      .sig : File not found.

      Normally a difference of seconds, minutes or even hours should be negligable when you want to delete messages older than 5 days for example. Do you need to be exact or do you want to prevent accidents from a faulty HW-clock on the client (usually an imap-server should use ntp already and have the exact time) ? In the second case something like Net::NTP might help