        LOGICAL br1,br2,br3,br4
        br4=.False.
        br3=.False.
        br2=.False.
        br1=.False.
        CALL enterurl
        REPEAT
          REPEAT
            REPEAT
              CALL login
              IF (wrongimap) THEN
                br1=.True.
                EXIT
              ENDIF
              REPEAT
                CALL showform
              UNTIL (.not.wrongkey)
              CALL enterform
              IF (wrongform) THEN
                br2=.True.
                EXIT
              ENDIF
              CALL startwebmail
            UNTIL (.not.loggedout)
            IF (br2) THEN
              br3=.True.
              EXIT
            ENDIF
            IF (br1) THEN
              br4=.True.
              EXIT
            ENDIF
          UNTIL (.not.expired)
          IF (.not.br4) THEN
            IF (.not.br3) THEN
              CALL send
              STOP
            ENDIF
          ENDIF
          CALL reporterror
          CALL goback
        UNTIL (.False.)
        END
