Tcl Library Source Code

View Ticket
Login
Ticket UUID: 3308105
Title: Traceback fingers unrelated catch output
Type: Bug Version: None
Submitter: karll Created on: 2011-05-26 19:30:56
Subsystem: smtp Assigned To: mrose
Priority: 5 Medium Severity:
Status: Open Last Modified: 2026-11-15 13:36:40
Resolution: None Closed By:
    Closed on:
Description:
Hi,

We had a problem today where we were getting a traceback from tcllib's smtp package while trying to queue a message.  The traceback pointed to "key message-id not in header", but this wasn't the problem.  The real problem was "451: 4.3.0 Error: queue file write error" because /var was out of space.

Tracing stuff, we found this call, the last line of ::smtp::sendmessage:

    return -code 1 -errorinfo {key message-id not in header\n    while e...} -errorcode NONE {451: 4.3.0 Error: queue file write error}

The errorinfo is incorrect -- it is from a catch of an innocent error 281 lines into the sendmessage proc, where it says...


    if {([lsearch -exact $lowerL ${message-idL}] < 0) \
            && ([catch { ::mime::getheader $part ${message-idL} }])} {

This made it much harder to troubleshoot the actual error.

Please fix the smtp package to finger the correct error -- I'm not sure where the bug is but whatever generated the error "451: 4.3.0 Error: queue file write error" did not get the errorinfo set properly.  I hope this is enough info.
User Comments: serhiy.storchaka added on 2026-11-15 13:36:40:

Since tcllib 1.21 ([1df85e69fb]), when the server rejects a message, smtp::sendmessage returns code 7 with a raw dict instead of raising an error, and a rejected Bcc copy is not reported at all. Proposed fix in branch smtp-rejected-message-error, with a new smtp.test that uses a fake SMTP server.