for (state = FLD2;;) {
                switch (state = m_getfld2(state, &f, ib)) {
+               case LENERR2:
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        np = mh_xcalloc(1, sizeof(*np));
                        *npp = np;
                                }
                        }
                        continue;
-
+               case FMTERR2:
+                       advise(NULL, "%s is poorly formated", file);
+                       state = FLD2;
+                       continue;
                case BODY2:
                        adios(EX_CONFIG, NULL, "no blank lines are permitted in %s",
                                        file);
                case FILEEOF2:
                        break;
 
+               case IOERR2:
+                       adios(EX_IOERR, NULL, "m_getfld2", "some error happend");
+                       break;
+
                default:
                        adios(EX_CONFIG, NULL, "%s is poorly formatted", file);
                }
 
        */
        for (compnum = 1, state = FLD2;;) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       advise(NULL, "To long field");
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        compnum++;
 
                        ct->c_begin = ftell(in);
                        break;
 
-               case LENERR2:
                case FMTERR2:
+                       advise(NULL, "message format error in component #%d", compnum);
+                       state = FLD2;
+                       continue;
+
                case IOERR2:
-                       adios(EX_DATAERR, NULL, "message format error in component #%d",
-                                       compnum);
+                       adios(EX_IOERR, "m_getfld2", "io error");
 
                default:
                        adios(EX_SOFTWARE, NULL, "getfld() returned %d", state);
 
 
        for (state = FLD2;;) {
                switch (state = m_getfld2(state, &f, fp)) {
+               case LENERR2:
+                       state = FLD2;
+                       /* FALL */
+
                case FLD2:
                        /*
                        ** if it's in a sequence we want,
 
 
                case LENERR2:
                case FMTERR2:
-               case IOERR2:
                        advise(NULL, "format error in message %d", msgnum);
+                       state = FLD2;
+                       continue;
+
+               case IOERR2:
+                       adios(EX_IOERR, "m_getfld2", "io error on message %d", msgnum);
                        /* FALL */
 
                case BODY2:
 
        */
        for (state = FLD2;;) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       advise(NULL, "Header to long");
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        /*
                        ** Check if the value of field contains
                                        }
                                } while ((state = m_getfld2(state, &f, in))
                                                ==BODY2);
+                               if (state != FILEEOF2) {
+                                       adios(EX_IOERR, "m_getfld2", "io error");
+                               }
                        }
 
                        if (prepend || !qbody) {
                        }
                        break;
 
+               case FMTERR2:
+                       advise(NULL, "skeleton is poorly formatted");
+                       continue;
                default:
-                       adios(EX_DATAERR, NULL, "skeleton is poorly formatted");
+                       adios(EX_IOERR, "m_getfld2", "io error");
                }
                break;
        }
 
        */
        for (i = 0, state = FLD2;;) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       advise(NULL, "format error in message");
+                       state = FLD2;
+                       /* FALL */
+
                case FLD2:
                        lp = mh_xstrdup(f.value);
                        for (p = hdrs; p->p_name; p++) {
                case FILEEOF2:
                        break;
 
-               case LENERR2:
                case FMTERR2:
                case IOERR2:
                        advise(NULL, "format error in message");
 
        }
        for (compnum = 1, state = FLD2;; compnum++) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       admonish(NULL, "To long header field in message %d (header %s, #%d)", msg, f.name, compnum);
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        if (mh_strcasecmp(f.name, datesw)==0) {
                                datecomp = mh_xstrdup(f.value);
                case FILEEOF2:
                        break;
 
-               case LENERR2:
                case FMTERR2:
                case IOERR2:
                        admonish(NULL, "format error in message %d (header #%d)", msg, compnum);
 
 
        for (compnum=1, state=FLD2;; compnum++) {
                switch (state = m_getfld2(state, &f, in)) {
+               case LENERR2:
+                       advise(NULL, "field %d contains a to long line", f.name);
+                       state = FLD2;
+                       /* FALL */
                case FLD2:
                        proc_hdr(f.name, f.value);
                        continue;
                case FILEEOF2:
                        break;
 
-               case LENERR2:
                case FMTERR2:
                case IOERR2:
                        adios(EX_DATAERR, NULL, "message format error in component #%d",