Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMTP issue

55 views
Skip to first unread message

Robert Hicks

unread,
Apr 20, 2006, 10:26:51 AM4/20/06
to
I am running the same script on 3 different HP servers. One of the
servers is erroring out with the following:

rhicks@lims-dev1$ ./fstats.tcl
key message-id not in header
while executing
"error "key $mixed not in header""
("default" arm line 5)
invoked from within
"switch -- $key {
"" {
set result ""
foreach lower $state(lowerL) mixed $state(mixedL) {
lappend result..."
(procedure "::mime::getheader" line 7)
invoked from within
"::mime::getheader $part ${message-idL} "
invoked from within
"smtp::sendmessage $token -originator $from -recipients $recipient
-servers $server"
(procedure "sendMessage" line 10)
invoked from within
"sendMessage rhicksATlimsdev.dwicgs.com robert.l.hicksATuscg.mil <smtp
address> $msgSubj $msgBody"
(file "./fstats.tcl" line 20)

It has worked before...it just stopped. The only thing that I can think
of that changed was I added mpack to that server but the other servers
already had it on there.

I am running ActiveTcl 8.4.12 on them all.

The script:

#!/opt/ActiveTcl/bin/tclsh

proc sendMessage {from recipient server subject body} {
package require smtp
package require mime

set ::smtp::trf 0

set token [mime::initialize -canonical text/plain -string $body]

mime::setheader $token Subject $subject
smtp::sendmessage $token -originator $from -recipients $recipient
-servers $server
mime::finalize $token
}

set msgBody [exec bdf | grep 8.%]

set msgSubj "LIMS-PRO1: Filesystem Report"

sendMessage rhicksATlimspro1.uscg.mil robert.l.hicksATuscg.mil <smtp
server> $msgSubj $msgBody

Any ideas?

Robert

Donald Arseneau

unread,
Apr 20, 2006, 7:05:59 PM4/20/06
to
"Robert Hicks" <sig...@gmail.com> writes:

> I am running the same script on 3 different HP servers. One of the
> servers is erroring out with the following:
>
> rhicks@lims-dev1$ ./fstats.tcl
> key message-id not in header
> while executing
> "error "key $mixed not in header""
> ("default" arm line 5)

This is an error generated by the smtp script code.
Did you try displaying the header text to see if there was
really a message-id field? Could there be differences
between how the smtp server treats your clients?


--
Donald Arseneau as...@triumf.ca

Robert Hicks

unread,
Apr 20, 2006, 9:14:03 PM4/20/06
to
Anything is possible. What is wierd is that the script worked once in
production (and numerous times in testing) and then stopped.

How would I set a message-id field??? I have no clue about smtp except
to write the script.

Robert

MH

unread,
Apr 20, 2006, 9:24:57 PM4/20/06
to
In article <1145582043.9...@v46g2000cwv.googlegroups.com>,

Well, if you're not using authentication, you could try something like:
telnet smtp-server 25
mail from: rob...@abc.com
rcpt to: rob...@def.com
data
This is a test email
.

and see if the results are different on different servers..

MH

Robert Hicks

unread,
Apr 20, 2006, 9:57:25 PM4/20/06
to
I will try that.

Robert

newtop...@yahoo.com

unread,
Apr 20, 2006, 11:25:12 PM4/20/06
to
Robert Hicks wrote:
> I am running the same script on 3 different HP servers. One of the
> servers is erroring out with the following:
>
> rhicks@lims-dev1$ ./fstats.tcl
> key message-id not in header
> while executing


I faced this very problem recently. No one responded to my post at
first, so after some trial and error, I stumbled upon the solution.
While I did it manually at the time, Jeff Hobbs suggested the same
thing and how it could be done easily via the TDK.

The trick is one of the packages that smtp relies on is not on the
server where you see this error. You can check this manually, or if
you have TDK, use the Scan feature of tclapp. It will resolve all
dependencies and present you with all the packages that you need to
have.

I don't have the source code with me now to give you the list of the
required packages but check to see if you have Trf, mime, smtp, and md5
(and maybe a few others) on the server where you see the problem. If
you can't resolve it, email me and I will send you the list.

Don Porter

unread,
Apr 20, 2006, 11:32:43 PM4/20/06
to
newtop...@yahoo.com wrote:
> The trick is one of the packages that smtp relies on is not on the
> server where you see this error.
...

> I don't have the source code with me now to give you the list of the
> required packages but check to see if you have Trf, mime, smtp, and md5
> (and maybe a few others) on the server where you see the problem. If
> you can't resolve it, email me and I will send you the list.

Since you've done the work tracking the problem down, can you send
error reports to those packages that use commands from other packages
they do not [package require] ?

If each bit of code [package require]s all the packages that provide
any of the commands it uses, then users will get error messages like
"can't find package foo" instead of cryptic things like reported in
this thread.

--
| Don Porter Mathematical and Computational Sciences Division |
| donald...@nist.gov Information Technology Laboratory |
| http://math.nist.gov/~DPorter/ NIST |
|______________________________________________________________________|

newtop...@yahoo.com

unread,
Apr 20, 2006, 11:43:08 PM4/20/06
to
Don Porter wrote:
> Since you've done the work tracking the problem down, can you send
> error reports to those packages that use commands from other packages
> they do not [package require] ?
>
> If each bit of code [package require]s all the packages that provide
> any of the commands it uses, then users will get error messages like
> "can't find package foo" instead of cryptic things like reported in
> this thread.


Sure, I would be glad to this weekend. I should make the disclaimer
that what I did was not very scientific. I was simply scanning all the
source code in tcllib to see who was doing package require/provide. As
I recall, what made it complex was that there was conditional package
require's. So, that may account for silent error messages that slip
by.

Here is the original thread in case anyone is interested:
http://groups.google.com/group/comp.lang.tcl/browse_frm/thread/237d7ff67aa4f223/73d5a442066714e5?q=smtp+starpacks&rnum=1#73d5a442066714e5

Pat Thoyts

unread,
Apr 21, 2006, 5:47:26 AM4/21/06
to
mghe...@harshrealm.uwaterloo.ca (MH) writes:

>In article <1145582043.9...@v46g2000cwv.googlegroups.com>,
>Robert Hicks <sig...@gmail.com> wrote:
>>Anything is possible. What is wierd is that the script worked once in
>>production (and numerous times in testing) and then stopped.
>>
>>How would I set a message-id field??? I have no clue about smtp except
>>to write the script.
>>
>>Robert
>
>Well, if you're not using authentication, you could try something like:
>telnet smtp-server 25
>mail from: rob...@abc.com
>rcpt to: rob...@def.com
>data
>This is a test email

A simpler option is to add -debug 1 to the smtp::sendmessage
options. This will cause it to output to stderr all the SMTP traffic.

--
Pat Thoyts http://www.patthoyts.tk/
To reply, rot13 the return address or read the X-Address header.
PGP fingerprint 2C 6E 98 07 2C 59 C8 97 10 CE 11 E6 04 E0 B9 DD

Robert Hicks

unread,
Apr 21, 2006, 8:11:48 AM4/21/06
to
I am using ActiveTcl so I am pretty sure I have all the required stuff
AND it did work when I tested and once when I set it up in cron (all on
the same machine). "Somehow" it just stopped. I am using the same
ActiveTcl build across 3 servers and only this one is having the issue.

I will investigate some more though.

Robert

Robert Hicks

unread,
Apr 21, 2006, 12:19:38 PM4/21/06
to
Even better! The SMTP server refused my "message", even though I got
250 status messages from everything. Gives me something to go by...

Robert

Robert Hicks

unread,
Apr 26, 2006, 9:51:02 AM4/26/06
to
Here is an oddity. I created a Perl script that does the exact same
thing using the Mail::Sender module and it works. Where as the Tcl
program does not.

Robert

Robert Hicks

unread,
Apr 26, 2006, 10:24:27 AM4/26/06
to
This is the debug output:

Trying [IP ADDRESS]...
<-- 220 [GATEWAY] Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830
ready at Wed, 26 Apr 2006 1
0:19:27 -0400
--> EHLO lims-dev1 (wait upto 300 seconds)
<-- 250-[GATEWAY] Hello [GATEWAY]
<-- 250-TURN
<-- 250-SIZE 10240000
<-- 250-ETRN
<-- 250-PIPELINING
<-- 250-DSN
<-- 250-ENHANCEDSTATUSCODES
<-- 250-8bitmime
<-- 250-BINARYMIME
<-- 250-CHUNKING
<-- 250-VRFY
<-- 250-X-EXPS GSSAPI NTLM LOGIN
<-- 250-X-EXPS=LOGIN
<-- 250-AUTH GSSAPI NTLM LOGIN
<-- 250-AUTH=LOGIN
<-- 250-X-LINK2STATE
<-- 250-XEXCH50
<-- 250 OK
--> MAIL FROM:<EMAIL ADDRESS> SIZE=490 (wait upto 600 seconds)
<-- 250 2.1.0 <EMAIL ADDRESS>....Sender OK
--> RCPT TO:<EMAIL ADDRESS> (wait upto 3600 seconds)
<-- 250 2.1.5 <EMAIL ADDRESS>
--> DATA (wait upto 300 seconds)
<-- 354 Start mail input; end with <CRLF>.<CRLF>
--> . (wait upto 120 seconds)
<-- 550 5.7.1 Requested action not taken: message refused
--> RSET (wait upto 0 seconds)
--> QUIT (wait upto 0 seconds)


key message-id not in header
while executing

"error "key $mixed not in header""
("default" arm line 5)
invoked from within
"switch -- $key {
"" {
set result ""
foreach lower $state(lowerL) mixed $state(mixedL) {
lappend result..."
(procedure "::mime::getheader" line 7)
invoked from within
"::mime::getheader $part ${message-idL} "
invoked from within

"smtp::sendmessage $token -originator $from -recipients $to -servers
$server -debug 1"
(procedure "sendMessage" line 12)
invoked from within
"sendMessage <EMAIL ADDRESS> <EMAIL ADDRESS> <SMTP SERVER> $msgSubj
$msgBody"
(file "./fstats.tcl" line 25)

Maybe a bug in the SMTP module itself???

Robert

MH

unread,
Apr 26, 2006, 1:59:53 PM4/26/06
to
In article <1146061467.6...@u72g2000cwu.googlegroups.com>,

Well, this says to me that there's something wrong with authentication or
addressing..

Compare the mail server logs from your perl script with your tcl script
(turn debugging level up) and see what's different. Maybe one's
authenticating? Maybe one's adding the domain automatically to the
sender/recipient?

MH

0 new messages