0

I have a doubt regarding mail servers and mail accounts.

I am wondering whether it is possible to ask a mail server for the number of messages a mail account has sent or has received in its inbox.

I don´t know if this is possible through pop3/imap/smtp protocol or specific mail server api.

Maybe by connecting to the mail server and signing in with a mail account credentials this information is available through mail server api or protocol.

Any idea?

3 Answers 3

0

I dont think you're able to see how many messages has been sent/received during the lifetime of the account.

What I do know is that you can connect to your inbox and get the amount of messages inside the inbox.

0

Those aren't available; IMAP servers aren't required to remember anything at all about what's been deleted.

But for things like gmail, where mail is seldom deleted, an IMAP search such as foo uid search header from "<[email protected]>" in the allmail mailbox will tell you how many messages have your own address as From:, and bar status "[Gmail]/All mail" (messages) (name depends on language) will tell you how many messages exist in total.

0

If your server sequentially numbers the UID as they come into your INBOX, and the UIDVALIDITY has never changed, you can get a good idea of how many messages have ever been in there by looking at UIDNEXT. However, this number is also increased by copying messages in (like if you moved messages to another folder, and moved them back), so it is not perfect. Still, if your UIDNEXT is 103743, you can bet you have received around 100,000 messages or so in the lifetime of your account.

Same for your SENT folder, if your client copies messages into there.

However, the first condition has to be met. Specifically, Yahoo does NOT use sequential UID numbers.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.