Log POP, IMAP, and SMTP Traffic in Mozilla Thunderbird

Logging POP, IMAP, and SMTP email traffic isn't just for the industrious developer. If you want to see what's going on behind the scenes of your email exchanges in Mozilla Thunderbird (especially if what's going on is not going right), logging can yield lots of information that can help you or your tech support person diagnose the problem.

Turning on transaction logging may not be a straightforward affair, but it is not difficult, either. To create a log file with all POP (Post Office Protocol), SMTP (Simple Mail Transfer Protocol), and IMAP (Internet Message Access Protocol) traffic in Mozilla Thunderbird, first make sure it's not running. Then, follow the instructions for your operating system.

Turning on Transaction Logging In Windows

  1. Select All Programs | Accessories | Command Prompt from the Start menu.

  2. Type

    set NSPR_LOG_MODULES=

    followed immediately by:

    POP3:4

    for POP logging

    IMAP:4

    for IMAP logging

    SMTP:4

    for SMTP logging

  3. You can enable logging for multiple protocols by separating them with commas. For example:

    To log both POP and SMTP traffic, type

    set NSPR_LOG_MODULES=POP3:4,SMTP:4

    To log only IMAP traffic, type

    set NSPR_LOG_MODULES=IMAP:4
  4. Press Enter.

  5. Type

    set NSPR_LOG_FILE=%HOMEDRIVE%%HOMEPATH%\Desktop\tbird_log.txt
  6. Press Enter.

  7. Type

    start thunderbird
  8. Press Enter again.

  9. Perform the desired email actions in Mozilla Thunderbird.

  10. Quit Mozilla Thunderbird and find tbird_log.txt on your Desktop.

Turning on Transaction Logging In Mac OS X

  1. Open a Terminal window.

  2. Type

    export NSPR_LOG_MODULES=

    followed immediately by:

    POP3:4

    for POP logging

    IMAP:4

    for IMAP logging

    SMTP:4

    for SMTP logging

  3. Press Enter.

  4. You can enable logging for multiple protocols by separating them with commas. For example:

    To log both POP and SMTP traffic, type

    export NSPR_LOG_MODULES=POP3:4,SMTP:4

    To log only IMAP traffic, type

    export NSPR_LOG_MODULES=IMAP:4
  5. Type

    export NSPR_LOG_FILE=~/Desktop/tbird.log
  6. Press Enter.

  7. Type

    /Applications/Thunderbird.app/Contents/MacOS/thunderbird-bin
  8. Press Enter again.

  9. Perform the desired email actions in Mozilla Thunderbird.

  10. Quit Mozilla Thunderbird and find tbird.log on your Desktop.

Turning on Transaction Logging In Linux

  1. Open a Terminal window.

  2. Type 

    export NSPR_LOG_MODULES=

     followed immediately by:

    POP3:4

    for POP logging

    IMAP:4

    for IMAP logging

    SMTP:4

    for SMTP logging

  3. Press Enter. You can enable logging for multiple protocols by separating them with commas. For example, type:

    export NSPR_LOG_MODULES=POP3:4,SMTP:4

    to log both POP and SMTP traffic

    export NSPR_LOG_MODULES=IMAP:4

    to log only IMAP traffic

  4. Type 

    export NSPR_LOG_FILE=~/tbird.log.txt
  5. Press Enter.

  6. Type 

    thunderbird
  7. Press Enter again.

  8. Perform the desired email actions in Mozilla Thunderbird.

  9. Quit Mozilla Thunderbird and find tbird.log.txt in your Home directory.

Turn Logging off in Mozilla Thunderbird

Traffic logging is enabled only for the session you start from the command line. You do not have to turn it off.