YAM - Yet Another Mailer (#2) - ARexx broken? (#28) - Message List

ARexx broken?
 solved

2.6-dev (os3/m86k) 2008-03-25 version seem to have problem with ARex script.

Older versions up to now have been working quite well, nothing has chenged here, new versino did not ask any updating of any external libraries so no changes here except new version.

Now ARexx script is exiting way too fast, it is not running whole script.

  • Message #104

    2.6-dev (os3/m86k) 2008-03-25 version seem to have problem with ARex script.

    Older versions up to now have been working quite well, nothing has chenged here, new versino did not ask any updating of any external libraries so no changes here except new version.

    Now ARexx script is exiting way too fast, it is not running whole script.

    Nothing have been changed in the ARexx layer really. The only thing that could cause your problems might be some kind of side effects of some recent development. So please explain in more detail what exactly is going wrong. In addition, you might submit your Arexx scipt so that we can have a look at it. Please also consider opening a new bugreport item at http://bugs.yam.ch/

    • Message #105

      Ok, here is script.

      It is used for mailinglist, and normally it checks a special folder for any mail belonging to list, then matches subject for list commands, finally forwards message if everything is ok.

      Now it seems to exit right after first check.

          /*
          ** $VER: MailListServer 1.0 (16.6.1)
          ** maililistserver modified and fixed to work with Yam2.3 by kom@sci.fi
          ** based on script written by Peter Greci <midgard@nycmetro.com>
          **
          */
          OPTIONS RESULTS
          ADDRESS YAM
          writeoptions SIG 0
          SetFolder "uimahyppy" /* set folder to list-folder */
          FolderInfo STEM fi. /* get folderinfo to fi.-variables */
          DO i=0 TO fi.total-1 /* set loop to amount of mails in folder */
          SetMail i /* set current mail */
          MailInfo STEM ooh. /* get mailinfo to ooh.-variables */
          IF INDEX(ooh.from,'"')>0 THEN ooh.from=compress(ooh.from,'"') /* remove quotes from name */
          parse var ooh.from crap '<'user'>' /* strip from-info to email-addr. only */
          IF upper(ooh.subject) = 'LIITY' THEN DO /* compare subject with 'subscribe' */
          ADDRESS REXX /* no checking for existing user, yet.. */
          open('plist','listserv:list','A') /* open list of subscribers for adding */
          writeln('plist',user) /* add email of mailsender */
          close('plist') /* close list */
          ADDRESS YAM
          mailmove "Poistetut" /* move mail to sent mail */
          mailwrite QUIET /* create new mail */
          'writeto "'user'"' /* set recipient */
          writefrom '"hyppylista <uimahyppy@meininki.net>"' /* set from-address to list-address */
          writereplyto '"hyppylista <uimahyppy@meininki.net>"' /* set replyto-address to list-address */
          writesubject 'Tervetuloa' /* set subject to "welcome" */
          writeletter 'listserv:welcome' NOSIG /* load welcome-text to mail */
          writequeue /* put mail in queue */
          END /* if loop */
          IF upper(ooh.subject) = 'EROA' THEN DO /* compare subject with 'unsubscribe' */
          mailmove "Poistetut" /* move mail to sent mail */
          mailwrite QUIET /* open new mail */
          'writeto "'user'"' /* set recipient */
          writeoptions SIG 0 /* set mailoptions */
          writefrom '"hyppylista <uimahyppy@meininki.net>"' /* set from-address */
          writereplyto '"hyppylista <uimahyppy@meininki.net>"' /* set replyto-address */
          writesubject 'Eroaminen' /* set subject */
          writeletter 'listserv:bye' NOSIG /* get text to mail */
          /* if verifyuser(user) then removeuser(user) /* check that user exists, then remove user */
          writequeue put mail in queue */
          END /* if loop */
          IF upper(ooh.subject) = 'APUA' THEN DO /* compare subject with 'help' */
          mailmove "Poistetut" /* move mail to sent mail */
          mailwrite QUIET /* open new mail */
          writeoptions SIG 0 /* set mailoptions */
          'writeto "'user'"' /* set recipient */
          writefrom '"hyppylista <uimahyppy@meininki.net>"' /* set from-address */
          writesubject 'Aputietoa' /* set subject */
          writereplyto '"hyppylista <uimahyppy@meininki.net>"' /* set replyto-address */
          writeletter 'listserv:help' NOSIG /* get text to mail */
          writequeue /* put mail in queue */
          END /* if loop */
          IF upper(ooh.subject) = 'LISTA' THEN DO /* compare subject with 'list' */
          mailmove "Poistetut" /* move mail to sent mail */
          mailwrite QUIET /* open new mail */
          writeoptions SIG 0 /* set mail options */
          writefrom '"hyppylista <uimahyppy@meininki.net>"' /* set from-address */
          'writeto "'user'"' /* set recipient */
          writereplyto '"hyppylista <uimahyppy@meininki.net>"' /* set replyto-address */
          writesubject '"Listalla olijat"' /* set subject */
          writeletter 'listserv:list' NOSIG /* add list of users to mail */
          writequeue /* put mail in queue */
          END /* if loop */
          mailstatus O /* set status to READ */
          END
          myname=uimahyppy@meininki.net /* set list address for testing */
          admin=kom@sci.fi /* my own address */
          ADDRESS YAM
          SetFolder "uimahyppy" /* set folder to list-folder */
          FolderInfo STEM fi. /* get folderinfo to fi.-variables */
          DO i=0 TO fi.total-1 /* set loop to amount of mails */
          SetMail i /* set current mail */
          MailInfo STEM ooh. /* get info from current mail */
          IF INDEX(ooh.from,'"')>0 THEN ooh.from=compress(ooh.from,'"') /* remove quotes from name */
          /* if attachent(s) in mail, check separately */
          if checkattachment(i)=1 THEN DO /* there was something suspicious! */
          readclose
          mailmove "archived" /* move it to storage folder */
          END /* no more looping.. */
          ELSE DO
          parse var ooh.from crap '<'user'>' /* strip from-info to email-addr. only */
          user=ooh.from /* set user to sender */
          testad=newad /* set user to test to variable 'testad' */
          writeoptions SIG=0 /* options to mail */
          mailforward QUIET /* if no match, then forward current mail */
          'writefrom "'user'"' /* set from to sender */
          DO Until eof('plist')=1 /* set loop to read users until list ends */
          open('plist','listserv:list','R') /* open userlist for reading */
          newad=readln('plist') /* read users to variable 'newad' */
          writebcc newad ADD /* add names from list to hidden-copy field */
          END
          writeto admin /* set recipient */
          writereplyto '"hyppylista <uimahyppy@meininki.net>"' /* set replyto-address */
          writequeue /* put mail in queue */
          END
          setfolder "incoming" /* return to new mail folder */
          END
          if entries>0 then do /* if there is entries, then send mail */
          mailsendall
          mailmove "deleted"
          setfolder "sent"
          end
          setfolder "uimahyppy" /* set folder to listfolder */
          FolderInfo STEM fi. /* get folderinfo to fi.-variables */
          DO i=0 TO fi.total-1 /* set loop to amount of mails */
          SetMail i /* set current mail */
          mailstatus O /* set status to READ */
          mailmove "sent" /* move mail to sent */
          END
          setfolder "incoming" /* return to new mail folder */
          EXIT /* exit from script */
          verifyuser:
          ADDRESS REXX
          parse arg test .
          open('checklist','listserv:list','R')
          do until eof('checklist')
          checkuser=readln('checklist')
          if upper(checkuser)=upper(test) then do
          close(checklist)
          return 1
          end
          end
          close('checklist')
          ADDRESS YAM
          return 0
          removeuser:
          ADDRESS REXX
          parse arg test .
          open('newlist','listserv:temp','W')
          open('oldlist','listserv:list','R')
          do until eof('oldlist')
          checkuser=readln('oldlist')
          if upper(checkuser)~=upper(test) then writeln('newlist')
          end
          close('newlist')
          close('oldlist')
          delete('listserv:list')
          rename('listserv:temp','listserv:list')
          ADDRESS YAM
          return 0
          checkattachment: /* just for checking attachments */
          if index(ooh.flags,"A") >0 then DO /* is there attachments? */
          mailread /* open mail for reading */
          READINFO STEM att. /* get info about attachments */
          DO o=0 TO att.filename.count-1 /* check attachments */
          paate = substr(att.filename.o,lastpos('.',att.filename.o)+1) /* filetype to variable */
          paate = upper(paate)
          IF paate="PIF" | paate="EXE" | paate="JS" | paate="SYS" | paate="COM" | paate="CPL" paate="BIN" | paate="INI" | paate="BAT" | paate="DLL" | paate="CIH" THEN return 1 /* suspicious filetype found! */
          END /* filetype ok */
          readclose
          END
          return 0 /* return to main routine */
          toirc: /* test routine, msg to irc */
          parse arg irc
          ADDRESS AMIRC.1
          'say /msg Schwartz 'att.filetype.o' 'att.filename.o' 'paate' 'ooh.flags' 'testi
          END
          ADDRESS YAM
          return 0
      
      • Message #106

        It would definitely be helpful if you could tell us at which point the script aborts early. All ARexx scripts I tried recently with the current nighly build run perfectly for me. So far, I (and most probably Jens, tool) am unable to reproduce this issue.

        • Message #107

          I did simple test using irc-routine that is at end of script and it aborts at very beginning, after this line:

          FolderInfo STEM fi.
          

          It sets current folder correctly first then aborts, and it seems that it is not getting any value with FolderInfo

          • Message #108

            Ok, I was able to reproduce your problem running the OS3 build under OS4. In this case the script is aborted when calling FOLDERINFO. The very same script and the OS4 build from the same day perfectly runs the script. So it must be something related to how the OS3 version is built. Unfortunately I cannot build OS3 versions currently, so either Jens must find a solution or you'll have to wait a few days...

            • Message #109

              Thanks.

              Problem started only with this latest version so it is some change done between two latest versions. Hopefully it can be fixed - I need that list running .. :( Btw - for me, version before this latest was perfect. Everything works as they should. I would be very happy with older build without expiry date. :D

              • Message #110

                The next nightly build should fix this issue. Please try it and report back.

                • Message #111

                  Thanks, I will.

                • Message #112

                  Ok, I installed build from last night. Now script goes exactly one line further and then aborts.

                  It seems that it still is not setting that value correctly so I added command to set value of 'fi.total' to 1 to get further in testing.

                  With value in that variable, it goes to this line and aborts:

                  IF upper(ooh.subject) = 'LIITY' THEN DO /* compare subject with 'subscribe' */
                  

                  But without manually added value it aborts right after this line:

                  FolderInfo STEM fi. /* get folderinfo to fi.-variables */
                  
                  • Message #113

                    I just tried several scripts running the OS3 version of YAM2.6dev from April 3rd under OS4, and none of them caused any problems. So the previous bug is definitely fixed.

                    Perhaps you should try to debug your script using the ARexx commands "ts" and "te". ts will start tracing all scripts. Every single script line will be executed after pressing RETURN.

                    Which version of rexxsyslib.library do you have installed? 45.7 should be the latest 68k compile, which is also used for OS4.

                  • Message #114

                    Ouch! I just checked my old OS3.9 installation files and noticed that at that time I "only" had rexxsyslib.library 44.1 installed. I think you have the same one, so the version check of clib2 for V45 causes the problem on pure OS3 systems. Since OS4 has a slightly updated rexxsyslib.library (45.7) it works here.

                    I will investigate further what can be done about this issue.

                    • Message #115

                      Ok, that might be the problem - I have 44.1 Where can I get later version? Aminet does not work properly and search returns nothing.

                    • Message #116

                      You found problem, that is good, find a solution and it is great .D

                    • Message #117

                      It seems that there is no later version available for OS3.9 so I'm stuck .. :(

                    • Message #118

                      Any news on this issue? I need that script - mailing list is now unusable.

                      • Message #119

                        Just use an older version of 2.6 or go back to 2.5 until we have solved this issue. I am sorry, but it takes its time...

                        • Message #120

                          Older version of 2.6? Sure, but don't they stop working after a month? That is why I updated .. previous worked perfectly. :(

                          • Message #121

                            You have been warned! Nightly builds may cause serious havoc or even format your hard drive. If you cannot live with either these bugs or with the timeout then better stick with the stable 2.5 release. Sorry, but it is this way. Anyway, it is still some time until the 4 weeks are over, so there is still time to use a working nightly build of 2.6.

                            • Message #122

                              Sure ... there would be if I had one; I download only when I need, and previous one has timed out, latest one is not working.

                              2.5 release misses lot of good features, but if that is only choise then that is what I have to use.

                              Or then I just abandon Amiga and start using some other system for mailinglist. Stupid.

                              • Message #123

                                According to your first post the nightly build from March 25 was the first one to fail. Well, just go to http://nightly.yam.ch/ and pick the one that is still working for you. At that time YAM was updated almost every day. Shouldn't be too hard to find a working version until we finally fixed that bug.

                                • Message #124

                                  I downloaded 2.5 and it seem to work just ok .. So I'll stick with it for now. Thanks anyway.

                                  • Message #125

                                    If you are still interested in a working YAM2.6 binary together with ARexx then please contact me privately.

                                  • Message #126

                                    From the next nightly build on ARexx support should be working again with OS3.

                                    • Message #128

                                      Ok, now it seems to work properly. Thanks.

                                    • Message #127

                                      Ok, I'll try it and report. Still it looks like 2.5 is enough for my needs.

Attachments

No attachments created.