Home AMX User Forum AMX General Discussion

Problems with attatchment in i!EquipmentMonitor

I'm using i!EquipmentMonitor to send emails to me. I'd like to backup all of my system data every night, I have several settings you can change and sort between and I'd like to have them backed up just in case. (Lets be honest, I'm doing this because I decided I wanted to learn how to write to a file in the flash memory)

I'm generating a file called backupdata.txt. It is emailing correctly as an attatchment, but the data inside is getting messed up. The data file on the Master displays one way, the data file that gets sent through email appears to drop two characters after every '=' that appears.

I'm attaching both files, can anyone help me figure out what would be causing this?

J

Comments

  • viningvining Posts: 4,368
    What are the none printing characters in your text? If it's a LF (line feed) you could be having a SMTP BARE LF problem.

    http://cr.yp.to/docs/smtplf.html

    If it is a LF (decimal 13) or (hex $0A) this function will replace it with CRLF or carriage return line feed.
    DEFINE_FUNCTION CHAR[SMTP_MSG_MAX]fnFIX_BARE_LF(CHAR iMSG[])
         
         {
         stack_var char iTempStr[SMTP_MSG_MAX]
         
         while (find_string(iMSG,"LF",1))
    	  {
    	  iTempStr = "iTempStr,fnReplace(remove_string(iMSG,"10",1),"LF", "CRLF")" ;
    	  }
    	  
         RETURN "iTempStr,iMSG,CRLF" ;
         }
    

    You'll need to create the constants LF and CRLF ;
  • JeffJeff Posts: 374
    It always happens on the first two characters after an = sign. The first 4 lines (STNAME=, EMAIL1=, EMAIL2=, EMAIL3=) all eliminate some random text after the =. The next 4 (SNDEM1=, SNDEM2=, SNDEM3=, SNDEM4=) eliminate a single ASCII character and a decimal 13, but the decimal 10 still appears.

    My guess is that its not actually the 13 thats causing the problem, because the letters St, HQ, Je, and HQ are eliminated in exactly the same manner. I'll try your function a little later today just in case.

    J
  • JeffJeff Posts: 374
    Furthermore, after reading more of your link, I can say that I'm using a Carriage Return before every Line Feed. The only bare line feeds in this email are generated because the = is somehow causing my carriage return to be deleted.

    J
  • viningvining Posts: 4,368
    Open the text doc in an editor and in the view tab click "show all characters" to see what's actually there or not.
  • JeffJeff Posts: 374
    Tried that, no dice. The characters are legitimately missing. The file from the master is 1586 bytes, the file from the email is 1411 bytes.

    A line that should read

    EMAIL1=HQS-DG-lst-AMX_Alerts@uscg.mil

    reads

    EMAIL1=S-DG-lst-AMX_Alerts@uscg.mil

    A line that should read

    EMAIL2=jeffrey.d.mcaleer@uscg.mil

    reads

    EMAIL2=ffrey.d.mcaleer@uscg.mil

    A line that should read

    SNDEM1=1

    causes more problems. Its actually "'SNDEM1=1',13,10" Somewhere in this process, two characters after every = are being deleted. This means that the ascii 1 in this line is being deleted, but also the decimal 13, leaving the 10 hanging by itself, which is causing problems, not to mention the fact that I've completely lost the data itself (whether its a 1 or a 0).

    J
Sign In or Register to comment.