infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Cloverleaf
msgBody not in email from tcl alerts
Keith McLeod
Recently we had an unscheduled reboot of the Interface Engine.
Find more posts tagged with
Clovertech
Comments
Peter Heggie
I can't help but think the reboot brought in some change. I've never seen mail functionality changed, though. I would go through some trial and error:
- put in an echo to see what the mailfile name is - did [pwd] resolve correctly?
- run just the line containing the 'exec' by itself from within hcitcl, or just run the 'mail' command from the command line, pointing to an existing file (with and without a body). Did it work?
- is there another 'mail' command?
- did the context of the user change?
- is the ampersand (background execution) necessary?
- and what is in proc 'write_file' - is there another one out there now??
Keith McLeod
Thanks Peter. Tried most of what you have in your post. write_file is a tclX command that gives quick syntax to write a string to a file. In old HIE TCL Reference guide. Kind of like for_file gets each line from a file and puts it into a variable....
I have run commands manually and scripted outside of the Alerts.pkg. The procs still run correctly in the test environment. In theory nothing changed from a coding perspective within this file.
The mail command was under suspicion, but works fine from command line. I am going to add more debug info to verify my variables are being populated correctly to write to the temp file.
The reboot occurred apparently as a result of the vm console where a reboot command was issued accidently. I have taken measures to prevent this in the control-alt-delete.conf file and provided a message insisting that Integration be notified before any reboots. Like putting code in place without it being activated, this makes me wonder what has changed. More debugging and ideas welcome. Again thanks.
System
Originally posted by Michael Hertel
This probably isn't it but...
In my upgrade experience from AIX to Linux, I found out the mail acts differently.
If the message body has "control characters" in it, Linux will convert the body to an attachment. ATT.bin
Usually I echo an HL7 message that has carriage returns in it.
While I got away with this in AIX, it got me in Linux land.
When you get no body, is there an attachment?
I was able to resolve my issue by converting carriage returns into line feeds before echoing it as the body.
david_barr
Get rid of the trailing ampersand. It makes the mail command run in the background. That means that the TCL script probably runs the next command (removing the input file) before your mail command has a chance to start up and read it.
Keith McLeod
Thanks for all the help. I ended up doing the following:
set sm [open "| mail -s "Some Subject Here" -r $fromAddress $toAddress" w]
puts $sm $msgBody
close $sm
Seems to work now... Again thanks...
Peter Heggie
I learn something new every day! I have never seen the TCL 'open' command variation where a channel is used instead of a filename. It kind of twists my mind to think that everything between the quotes is resolved
after
the surrounding open/puts/close functions.