In a message dated Tue, 27 May 2003, Adam Witney writes: > Our sysadmins have decided to put a quota on the size of our email > mailboxes. They have implemented a 'function' to warn the user when he gets > close to the limit... However they have only implemented this function for > windows mail clients! > > I was wondering if there was anything I could do in perl to be able to > connect to the IMAP server and report back the size of my mailbox? > > I have had a quick look through Mail-IMAPClient and Net-IMAP-Simple, but > didn't see anything in there that would do what I wanted > > Any ideas of how I might think about doing this? If indeed it is possible?
Yay, a question on this list I can answer. That happens so rarely. Of course, this is completely OT for this list, so maybe that's why... :-) RFC 2087 defines the quota extension for IMAP: http://www.faqs.org/rfcs/rfc2087.html The problem is that your sysadmins may not be using an IMAP server which implements quotas--instead they may be using filesystem quotas on the mail spool as a dodge. (This is exceedingly bad practice, btw, for reasons I can go into if you're interested, but I was on the original IETF IMAP4rev1 working group, so I may be biased. :-) It is very easy to determine by hand, before you spend any time coding, which mechanism they're using (The lines starting with '>>>' represent what you type, but you don't type the '>>>'): % telnet <yourmailserver> imap >>> 000 LOGIN <yourusername> "<yourpassword>" 000 OK [CAPABILITY IMAP4REV1 IDLE NAMESPACE MAILBOX-REFERRALS SCAN SORT THREAD=REFERENCES THREAD=ORDEREDSUBJECT MULTIAPPEND QUOTA] User <yourusername> authenticated >>> 001 GETQUOTA "" To the GETQUOTA command, you will receive either an OK, NO, or BAD. If you get either OK or NO, it means that IMAP quotas are enabled. If you get BAD, then it means they aren't. If they aren't, you'll have to find out what the Windows client does and reverse engineer it. Or maybe just ask your sysadmins--most of us are willing to work with users when their requests are reasonable. (But then again, in my personal experience, sysadmins who implement solutions using Windows are less likely to be generally reasonable people. ;-) Trey -- Trey Harris Vice President SAGE -- The System Administrators Guild (www.sage.org) Opinions above are not necessarily those of SAGE.
