Log POP, IMAP, and SMTP Traffic in Mozilla Thunderbird

Check the logs to troubleshoot email errors

Woman on laptop in conference room
Hero Images / Getty Images

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 yields 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 Post Office Protocol, Simple Mail Transfer Protocol, and 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

In Microsoft Windows, follow this procedure:

  1. Open the Command Prompt.

    Press Win+X and click Command Prompt to open the Command Prompt.

  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. 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 open tbird_log.txt on your Desktop.

Turning on Transaction Logging in macOS

Use the following procedure on your Mac:

  1. Open a Terminal window.

  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. Press Enter.

  4. 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

In Linux, follow this procedure:

  1. Open a Terminal window.

  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. Press Enter. 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 and

    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 review 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.