Search code examples
tagsimap

Why does IMAP require a tag in front of each command?


Why does IMAP require a tag in front of each command?

A login mylogin mysupersecretpassword

What is the use for this?


Solution

  • There are/were two goals.

    1. Let clients issue several commands at a time and be told unambiguously which command has been completed by the server. (This could be achieved in other ways, such as an explicit ordering rule.)

    2. Debugging. The tag provides convenient client/server logfile correlation.

    Many clients do issue more than one command at a time in practice, even if they're far from the maximum allowed parallelism.