home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / Fax / AVMN199D.LHA / avminstall / rexx / handlefax.avm < prev    next >
Encoding:
Text File  |  1995-08-19  |  16.4 KB  |  658 lines

  1. /* TITLE: avm:rexx/handlefax.avm */
  2. /* we want results! Otherwise, we wouldn't get anything from RESULT */
  3. options results
  4.  
  5. /* Need to make sure that stdtail.avm is also included */
  6. signal on halt
  7. signal on novalue
  8. signal on syntax
  9. signal on break_c
  10.  
  11. /* needed for some of the functions we use */
  12. call addlib("rexxsupport.library", 0, -30, 0)
  13.  
  14. /* a higher than normal priority since calls are important to us :) */
  15. call pragma('priority', 1)
  16.  
  17. /* ensure that commands are directed to the correct server */
  18. parse arg servername .
  19. address value servername
  20.  
  21.  
  22. parse arg servername mailbox .
  23. if symbol('mailbox') ~= 'VAR' | mailbox = '' then mailbox = 'manual'
  24. options failat 50
  25.  
  26. 'turnoffvoicemode'
  27.  
  28. 'assumemode' 'Unknown'
  29.  
  30. 'setserial' '19200' '8' 'N' '1' '7Wire'
  31. a_=rc
  32. if 0 then nop
  33.  
  34. isTrapFax:
  35. faxprogram = upper(getclip('AVMFaxProgram'))
  36. if faxprogram = 'TRAPFAX' then do
  37.  
  38. call showDebugger('Starting TrapFax reception.')
  39. call time('r')
  40. /*----------------------------------------*/
  41. address rexx 'setuptfax.avm'
  42. /*----------------------------------------*/
  43.  
  44. 'writeline' 'ATA'
  45.  
  46. address command "trapfax:tfaxdoor getty"
  47. faxResult = rc
  48. call showDebugger('TrapFax reception ' || time('e'))
  49.  
  50. isGPFax:
  51. end; else if faxprogram = 'GPFAX' then do
  52.  
  53. call showDebugger('Starting GPFax reception.')
  54. call time('r')
  55.  
  56. address rexx_gpfax 'listen'
  57. address rexx_gpfax 'recfax'
  58. faxresult = rc
  59. address rexx_gpfax 'unlisten'
  60. call showDebugger('GPFax result is' faxresult)
  61. call showDebugger('GPFax done ' || time('e'))
  62.  
  63. isEFax:
  64. end; else if faxprogram = 'EFAX' then do
  65. /* create a unique filename */
  66. efaxFileName = makeUniqueFile()
  67. call time('r')
  68. address command 'avm:gnu/efax -p' servername '-r' voiceFile(mailbox, efaxFileName)
  69. faxResult = rc
  70. efaxLength = time('e')
  71.  
  72. end
  73.  
  74. doneRecFax:
  75. 'delay' 2
  76. a_=rc
  77. if 0 then nop
  78. else if a_=12 then signal stdabort
  79. else if a_=14 then signal stderror
  80. else if a_=16 then signal stderror
  81.  
  82. 'writeline' 'AT+FCLASS=0'
  83.  
  84. 'readline' '2'
  85. a_=rc
  86. if a_=0 then value=result
  87. if 0 then nop
  88. else if a_=12 then signal stdabort
  89. else if a_=14 then signal stderror
  90. else if a_=16 then signal stderror
  91.  
  92. 'readline' '2'
  93. a_=rc
  94. if a_=0 then value=result
  95. if 0 then nop
  96. else if a_=12 then signal stdabort
  97. else if a_=14 then signal stderror
  98. else if a_=16 then signal stderror
  99.  
  100. createLog:
  101. handle = makeUniqueFile()
  102. call initLogEntry()
  103.  
  104. log.comment = ''
  105. log.type = 'Fax tried'
  106. if faxprogram = 'GPFAX' then do
  107.   if faxresult <= 5 then signal gotfaxgpfax
  108. end; else if faxprogram = 'TRAPFAX' then do
  109.   call open('cfaxlstfl', 'trapfax:trapfax.log', 'r')
  110.   call open('cfaxnrfl', 'trapfax:incoming/trapfax.sequence', 'r')
  111.   cfaxnr = readln('cfaxnrfl')
  112.   cnewfaxnr = right(cfaxnr, 4, '0')
  113.  
  114.   do forever
  115.     cfax = readln('cfaxlstfl')
  116.     cfaxlsnr = right(left(cfax, 6), 4)
  117.     if cfaxlsnr = cfaxnr | eof('cfaxlstfl') then break
  118.   end
  119.   call close('cfaxlstfl'); call close('cfaxnrfl')
  120.   langGerKey = right(left(cfax, 21), 1)
  121.   if left(cfax, 1) ~= 'E' & left(cfax, 1) ~= 'F' then signal gotfaxtrapfax
  122. end; else if faxprogram = 'EFAX' then do
  123.  
  124. if exists(voiceFile(mailbox, efaxFileName) || '.001') then signal gotfaxefax
  125. end
  126.  
  127. signal finished
  128.  
  129. gotfaxgpfax:
  130. address rexx_gpfax 'reportlog' 1
  131. faxfilename = result
  132. log.filename = result
  133.  
  134. address rexx_gpfax 'reportlog' 6
  135. log.length = result
  136. address rexx_gpfax 'reportlog' 2
  137. log.comment = result 'page(s) received.'
  138.  
  139. address rexx_gpfax 'reportlog' 4
  140. log.returnnumber = result
  141. log.type = 'fax'
  142. signal finished
  143.  
  144. gotfaxtrapfax:
  145. if langGerKey ='E' then faxfilename = 'trapfax:incoming/Empfangen-' || cfaxnr || '.FAX'
  146. else faxfilename = 'trapfax:incoming/In-' || cfaxnr || '.FAX'
  147. log.filename = faxfilename;myvar = right(left(cfax, 54), 5)
  148. myvar = (left(myvar, 2)*60) + (right(myvar, 2))
  149. log.length = myvar
  150. myvar = right(left(cfax, 47), 2); myvar = strip(myvar, 'L')
  151. log.comment = myvar 'page(s)'
  152. myvar = right(left(cfax, 45), 22)
  153. myvar = strip(myvar, 'T')
  154. log.returnnumber = myvar; log.type = 'fax'
  155. signal finished
  156.  
  157. gotfaxefax:
  158. log.filename = efaxFileName
  159. faxfilename = efaxFileName
  160. log.type = 'fax'
  161. log.length = efaxLength
  162. base = voiceFile(mailbox, efaxFileName) || '.'
  163. do i = 1 to 999
  164.   if ~exists(base || right(i, 3, '0')) then break
  165. end
  166. log.comment = i - 1 'pg'; if (i > 2) then log.comment = log.comment || 's'
  167.  
  168. log.returnNumber = getclip(upper(servername || '.faxid'))
  169. signal finished
  170.  
  171. finished:
  172. log.origMailbox = mailbox
  173. call saveLogEntry(mailbox, handle)
  174.  
  175. call loadMailbox(mailbox)
  176. if upper(log.type) = 'FAX' & mailbox.autofaxforwardb = 1 & mailbox.autofaxforwardscript ~= "" then do
  177.   handle = makeUniqueFile()
  178.   call initLogEntry(); log.origmailbox = mailbox
  179.   log.filename = voiceFile(mailbox, faxfilename); log.type = 'fax'
  180.   log.returnsendfunc = mailbox.autofaxforwardscript; log.returninterval = 5
  181.   log.returnretry = 3; log.returnnumber = mailbox.autofaxforward
  182.   call saveLogEntry('Outgoing', handle)
  183. end
  184.  
  185. exit
  186.  
  187. /* TITLE: avm:rexx/simplestdtail.avm */
  188. /* This is the standard tail */
  189. exit
  190.  
  191. exit
  192.  
  193. mailboxDir: procedure
  194.     parse arg mailbox
  195.  
  196.     return 'avmmbox:' || mailbox || '/'
  197.  
  198. logFile: procedure
  199.     parse arg mailbox, magiccookie
  200.  
  201.     return 'avmmbox:' || mailbox || '/logs/' || magiccookie
  202.  
  203. voiceFile: procedure
  204.     parse arg mailbox, magiccookie
  205.  
  206.         if (verify(magiccookie, '/:', 'M') = 0) then
  207.           return 'avmmbox:' || mailbox || '/voices/' || magiccookie
  208.         else
  209.           return magiccookie
  210.  
  211. makeUniqueFile: procedure
  212.     if arg() ~= 0 then do
  213.         rc = "makeUniqueFile: bad args"
  214.         signal error
  215.     end
  216.     return address() || '.' || date('i') || '.' || time('s') || '.' || random(1, 999, time('s'))
  217.  
  218. convertToDate: procedure
  219.     if arg() ~= 1 then do
  220.         rc = "convertToDate: bad args"
  221.         signal error
  222.     end
  223.     parse arg timeInC
  224.  
  225.     actualTime = (timeInC - (2922)*86400) // (86400)
  226.     actualDate = (timeInC - actualTime - 2922*86400) % 86400
  227.  
  228.     return actualDate /* returning it in 'internal' format */
  229.  
  230. convertToTime: procedure
  231.     if arg() ~= 1 then do
  232.         rc = "convertToTime: bad args"
  233.         signal error
  234.     end
  235.     parse arg timeInC
  236.     
  237.     actualTime = (timeInC - (2922)*86400) // (86400)
  238.  
  239.     return actualTime
  240.  
  241. cTime: procedure
  242.     /* 2922 = 8*365 + 2 */
  243.     /* 86400 = 24*60*60 */
  244.     return (date('i')+2922)*86400 + time('s')
  245.  
  246. /* this returns a handle that you must use after initializing log. */
  247. initLogEntry: procedure expose log.
  248.     if arg() ~= 0 then do
  249.         rc = "initLogEntry: bad args"
  250.         signal error
  251.     end
  252.     
  253.     drop log.
  254.         log. = ''
  255.  
  256.         acidname = getclip(address() || 'CIDNAME')
  257.         acidnumber = getclip(address() || 'CIDNUMBER')
  258.  
  259.     /* 2922 = 8*365 + 2 */
  260.     /* 86400 = 24*60*60 */
  261.     log.time = (date('i')+2922)*86400 + time('s')
  262.     log.cidname = acidname
  263.     log.cidnumber = acidnumber
  264.  
  265.     return
  266.  
  267. loadLogEntry: procedure expose log.
  268.     if arg() ~= 2 then do
  269.         rc = "loadLogEntry: bad args"
  270.         signal error
  271.     end
  272.     parse arg mailbox, handle
  273.  
  274.         drop log.
  275.         log. = ''
  276.  
  277.     if ~exists(mailboxDir(mailbox)) then do
  278.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  279.         return
  280.     end
  281.  
  282.     opened = open(handle, logFile(mailbox, handle), 'r')
  283.         if opened then do
  284.         call showDebugger('Loading entry' logFile(mailbox, handle))
  285.         do while ~eof(handle)
  286.             line = readln(handle)
  287.             parse upper var line variable '=' value
  288.             log.variable = value
  289.         end
  290.         call close(handle)
  291.     end; else call showDebugger('Could not load' logFile(mailbox, handle))
  292.     return
  293.  
  294. /* pass a handle here */
  295. saveLogEntry: procedure expose log.
  296.     if arg() ~= 2 then do
  297.         rc = "saveLogEntry: bad args"
  298.         signal error
  299.     end
  300.     parse arg mailbox, handle
  301.  
  302.     if ~exists(mailboxDir(mailbox)) then do
  303.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  304.         return
  305.     end
  306.  
  307.     opened = open(handle, logFile(mailbox, handle), 'w')
  308.  
  309.     if opened then do
  310.         call showDebugger('Saving entry' logFile(mailbox, handle))
  311.         call writeln(handle, 'TYPE=' || log.type)
  312.         call writeln(handle, 'TIME=' || log.time)
  313.         call writeln(handle, 'LENGTH=' || log.length)
  314.  
  315.         call writeln(handle, 'ORIGMAILBOX=' || log.origmailbox)
  316.  
  317.         call writeln(handle, 'CIDNAME=' || log.cidname)
  318.         call writeln(handle, 'CIDNUMBER=' || log.cidnumber)
  319.  
  320.         call writeln(handle, 'COMMENT=' || log.comment)
  321.  
  322.         call writeln(handle, 'FILENAME=' || log.filename)
  323.         call writeln(handle, 'ALTFILENAME=' || log.altfilename)
  324.  
  325.         call writeln(handle, 'RETURNNUMBER=' || log.returnnumber)
  326.         call writeln(handle, 'RETURNSENDFUNC=' || log.returnsendfunc)
  327.         call writeln(handle, 'RETURNSTATUS=' || log.returnstatus)
  328.  
  329.         call writeln(handle, 'RETURNRETRY=' || log.returnretry)
  330.         call writeln(handle, 'RETURNINTERVAL=' || log.returninterval)
  331.  
  332.         call close(handle)
  333.         address rexx 'broadcast' 'addtomailbox' mailbox handle
  334.     end; else call showDebugger('Could not save' logFile(mailbox, handle))
  335.  
  336.     return
  337.  
  338. /* pass a handle here */
  339. updateLogEntry: procedure expose log.
  340.     if arg() ~= 2 then do
  341.         rc = "updateLogEntry: bad args"
  342.         signal error
  343.     end
  344.     parse arg mailbox, handle
  345.  
  346.     if ~exists(mailboxDir(mailbox)) then do
  347.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  348.         return
  349.     end
  350.  
  351.     if ~exists(logFile(mailbox, handle)) then do
  352.         call showDebugger('Unable to update non-existent' logFile(mailbox, handle))
  353.         return
  354.     end
  355.     opened = open(handle, logFile(mailbox, handle), 'w')
  356.  
  357.     if opened then do
  358.         call showDebugger('Updating entry' logFile(mailbox, handle))
  359.         call writeln(handle, 'TYPE=' || log.type)
  360.         call writeln(handle, 'TIME=' || log.time)
  361.         call writeln(handle, 'LENGTH=' || log.length)
  362.  
  363.         call writeln(handle, 'ORIGMAILBOX=' || log.origmailbox)
  364.  
  365.         call writeln(handle, 'CIDNAME=' || log.cidname)
  366.         call writeln(handle, 'CIDNUMBER=' || log.cidnumber)
  367.  
  368.         call writeln(handle, 'COMMENT=' || log.comment)
  369.  
  370.         call writeln(handle, 'FILENAME=' || log.filename)
  371.         call writeln(handle, 'ALTFILENAME=' || log.altfilename)
  372.  
  373.         call writeln(handle, 'RETURNNUMBER=' || log.returnnumber)
  374.         call writeln(handle, 'RETURNSENDFUNC=' || log.returnsendfunc)
  375.         call writeln(handle, 'RETURNSTATUS=' || log.returnstatus)
  376.  
  377.         call writeln(handle, 'RETURNRETRY=' || log.returnretry)
  378.         call writeln(handle, 'RETURNINTERVAL=' || log.returninterval)
  379.  
  380.         call close(handle)
  381.         address rexx 'broadcast' 'refreshmailboxentry' mailbox handle
  382.     end; else call showDebugger('Could not update' logFile(mailbox, handle))
  383.  
  384.     return
  385.  
  386.  
  387.  
  388. showDebugger: procedure
  389.     if arg() ~= 1 then do
  390.         say "showDebugger: ERROR"
  391.         exit 20
  392.     end
  393.  
  394.     parse arg debuggerInfo
  395.     
  396.     firstLine = sourceline(1)
  397.     parse var firstLine '/*' 'TITLE:' title '*/'
  398.     if showlist('p', 'AVMLOGGER') then
  399.         address 'AVMLOGGER' 'add' title ':' debuggerInfo
  400.     else
  401.         say title ':' debuggerInfo
  402.  
  403.     return 
  404.  
  405. /*-----------------------------------------------------------------------*/
  406. /*                         signal processing                             */
  407.  
  408. arexxerror:
  409. error:
  410.     call showDebugger("Error" rc "at line" sigl)
  411.     exit 20
  412.  
  413. break_c:
  414. halt:
  415.     call showDebugger("Halt/Break_C at line" sigl)
  416.     exit 20
  417.  
  418. novalue:
  419.     call showDebugger("No value at line" sigl)
  420.     exit 20
  421.  
  422. syntax:
  423.     call showDebugger("Syntax error" rc "at line" sigl)
  424.     exit 20
  425.  
  426. /* TITLE: avm:rexx/stdplayvoice.avm */
  427. stdPlayXX:
  428. procedure
  429. parse arg ret
  430.  
  431. rs.normal = 0
  432. rs.keydetected = 1
  433. rs.quietdetected = 2
  434. rs.silencedetected = 3
  435. rs.faxdetected = 4
  436. rs.datadetected = 5
  437. rs.busydetected = 8
  438. rs.timedout = 10
  439. rs.signaldetected = 12
  440. rs.overflow = 14
  441. rs.error = 16
  442. /* CB 0000 */
  443.  
  444. select
  445.   when ret=rs.faxdetected then signal stdfax
  446.   when ret=rs.datadetected then signal stddata
  447.   when ret=rs.busydetected then signal stdbusy
  448.   when ret=rs.signaldetected then signal stdabort
  449.   when ret=rs.overflow then signal stderror
  450.   when ret=rs.error then signal stderror
  451.   otherwise nop
  452. end
  453. return
  454.  
  455.  
  456. aapresentmenu:
  457. /* TITLE: avm:rexx/presentmenu.avm */
  458. procedure expose pmRetries pmTimesAround
  459. parse arg filename, valid, retries
  460. timesaround = retries
  461. pmTimesAround = timesaround
  462. pmRetries = retries
  463.  
  464. rs.normal = 0
  465. rs.keydetected = 1
  466. rs.quietdetected = 2
  467. rs.silencedetected = 3
  468. rs.faxdetected = 4
  469. rs.datadetected = 5
  470. rs.busydetected = 8
  471. rs.timedout = 10
  472. rs.signaldetected = 12
  473. rs.overflow = 14
  474. rs.error = 16
  475. /* CB 0000 */
  476.  
  477. aapresentmenuloop:
  478. 'playvoice' filename
  479. a_=rc
  480. if 0 then nop
  481. else if a_=4 then do;return rs.faxdetected;end
  482. else if a_=5 then do;return rs.datadetected;end
  483. else if a_=8 then do;return rs.busydetected;end
  484. else if a_=12 then do;return rs.signaldetected;end
  485. else if a_=14 then do;return rs.error;end
  486. else if a_=16 then do;return rs.error;end
  487.  
  488. 'readnkeys' '1' '5'
  489. a_=rc
  490. if a_=0 then value=result
  491. if 0 then nop
  492. else if a_=0 then signal aapresentmenuvalue
  493. else if a_=4 then do;return rs.faxdetected;end
  494. else if a_=5 then do;return rs.datadetected;end
  495. else if a_=8 then do;return rs.busydetected;end
  496. else if a_=10 then signal aapresentmenutimeout
  497. else if a_=12 then do;return rs.signaldetected;end
  498. else if a_=14 then do;return rs.error;end
  499. else if a_=16 then do;return rs.error;end
  500. return rs.error
  501.  
  502. aapresentmenutimeout:
  503. 'flushphonebuffer'
  504.  
  505. 'playvoice' 'avm:voices/TimedOut'
  506. a_=rc
  507. if 0 then nop
  508. else if a_=4 then do;return rs.faxdetected;end
  509. else if a_=5 then do;return rs.datadetected;end
  510. else if a_=8 then do;return rs.busydetected;end
  511. else if a_=12 then do;return rs.signaldetected;end
  512. else if a_=14 then do;return rs.error;end
  513. else if a_=16 then do;return rs.error;end
  514.  
  515. timesaround = timesaround - 1; pmTimesAround = timesaround
  516. if timesaround <= 0 then return rs.timedout
  517. signal aapresentmenuloop
  518.  
  519. aapresentmenuvalue:
  520. if pos(value, valid) = 0 then signal aainvalid
  521. return '=' || value
  522.  
  523. aainvalid:
  524. 'flushphonebuffer'
  525.  
  526. 'playvoice' 'avm:voices/BadChoice'
  527. a_=rc
  528. if 0 then nop
  529. else if a_=4 then do;return rs.faxdetected;end
  530. else if a_=5 then do;return rs.datadetected;end
  531. else if a_=8 then do;return rs.busydetected;end
  532. else if a_=12 then do;return rs.signaldetected;end
  533. else if a_=14 then do;return rs.error;end
  534. else if a_=16 then do;return rs.error;end
  535.  
  536. timesaround = timesaround - 1; pmTimesAround = timesaround
  537. if timesaround <= 0 then return rs.timedout
  538. signal aapresentmenuloop
  539.  
  540.  
  541. stdabort:
  542. exit
  543.  
  544. stdbusy:
  545. exit
  546.  
  547. stderror:
  548. exit
  549.  
  550. stdtimedout:
  551. exit
  552.  
  553. stdfaxinstruct:
  554. 'playvoice' 'avm:voices/FaxStarting'
  555. a_=rc
  556. if 0 then nop
  557. else if a_=1 then do;call checkifabort;end
  558. else if a_=8 then signal stdbusy
  559. else if a_=12 then signal stdabort
  560.  
  561. stdfax:
  562. faxscript = getclip(address() || 'FAXSCRIPT')
  563. if faxscript = '' then faxscript = 'handlefax'
  564. if symbol('mailbox') = 'VAR' then address rexx faxscript address() mailbox
  565. else address rexx faxscript address() 'anonymous'
  566. exit
  567.  
  568. stddatainstruct:
  569. 'playvoice' 'avm:voices/DataStarting'
  570. a_=rc
  571. if 0 then nop
  572. else if a_=1 then do;call checkifabort;end
  573. else if a_=8 then signal stdbusy
  574. else if a_=12 then signal stdabort
  575.  
  576. stddata:
  577. datascript = getclip(address() || 'DATASCRIPT')
  578. if datascript = '' then datascript = 'handledata'
  579. if symbol('mailbox') = 'VAR' then address rexx datascript address() mailbox
  580. else address rexx datascript address()
  581. exit
  582.  
  583. checkifabort:
  584. 'readnkeys' '1' '3'
  585. a_=rc
  586. if a_=0 then value=result
  587. if 0 then nop
  588. else if a_=0 then do;if value = '*' then signal stdabort;end
  589. else if a_=8 then signal stdbusy
  590. else if a_=12 then signal stdabort
  591. else if a_=14 then signal stderror
  592. else if a_=16 then signal stderror
  593. return
  594.  
  595.  
  596. exit
  597.  
  598. /* this requires logfunctions.avm */
  599.  
  600. loadMailbox: procedure expose mailbox.
  601.     if arg() ~= 1 then do
  602.         rc = "loadMailbox: bad args"
  603.         signal error
  604.     end
  605.  
  606.         mailbox. = ''
  607.     parse arg mailbox
  608.  
  609.     handle = 'mailboxconfig'
  610.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'r')
  611.     if opened then do
  612.         do while ~eof(handle)
  613.             line = readln(handle)
  614.             parse upper var line variable '=' value
  615.             mailbox.variable = value
  616.         end
  617.         call close(handle)
  618.     end
  619.     return
  620.  
  621. /* pass a handle here */
  622. saveMailbox: procedure expose mailbox.
  623.     if arg() ~= 1 then do
  624.         rc = "saveMailbox: bad args"
  625.         signal error
  626.     end
  627.     parse arg mailbox
  628.  
  629.     handle = 'mailboxconfig'
  630.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'w')
  631.  
  632.     if opened then do
  633.         call writeln(handle, 'PASSWORD=' || mailbox.password)
  634.  
  635.         call writeln(handle, 'AUTOFAXFORWARDB=' || mailbox.autofaxforwardb)
  636.         call writeln(handle, 'AUTOFAXFORWARD=' || mailbox.autofaxforward)
  637.         call writeln(handle, 'AUTOFAXFORWARDSCRIPT=' || mailbox.autofaxforwardscript)
  638.  
  639.         call writeln(handle, 'AUTOFORWARDB=' || mailbox.autoforwardb)
  640.         call writeln(handle, 'AUTOFORWARDONDEMAND=' || mailbox.autoforwardondemand)
  641.         call writeln(handle, 'AUTOFORWARD=' || mailbox.autoforward)
  642.         call writeln(handle, 'AUTOFORWARDSCRIPT=' || mailbox.autoforwardscript)
  643.  
  644.         call writeln(handle, 'AUTOPAGEB=' || mailbox.autopageb)
  645.         call writeln(handle, 'AUTOPAGEONDEMAND=' || mailbox.autopageondemand)
  646.         call writeln(handle, 'AUTOPAGE=' || mailbox.autopage)
  647.         call writeln(handle, 'AUTOPAGESCRIPT=' || mailbox.autopagescript)
  648.  
  649.         call writeln(handle, 'AUTOALERTB=' || mailbox.autoalertb)
  650.         call writeln(handle, 'AUTOALERTONDEMAND=' || mailbox.autoalertondemand)
  651.         call writeln(handle, 'AUTOALERTSCRIPT=' || mailbox.autoalertscript)
  652.  
  653.         call close(handle)
  654.     end
  655.  
  656.     return
  657.  
  658.