+ for (;;) {
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) break;
+ if (r == -1) temp_read();
+ if (ch == '.')
+ substdio_put(&smtpto,".",1);
+ if (flagheader) {
+ if (ch == '\n') { /* header ends */
+ flagheader = 0;
+ if (!flagdobody) posat = 0;
+ } else if (ch == '#') { /* # starting line => VERH ... */
+ flagdobody = 1; /* continues in body and ... */
+ continue; /* character is suppressed. */
+ }
+ }
+ while (ch != '\n') {
+ if (ch == '#' && posat) { /* ... # */
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) perm_partialline();
+ if (r == -1) temp_read();
+ if (ch == '#') { /* ... ## */
+ register char ch1;
+ ch1 = *substdio_peek(&ssin);
+ if (ch1 != 'L' && ch1 != 'H') { /* ... ##x x!=L x!=H */
+ substdio_put(&smtpto,"#",1);
+ continue;
+ }
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) perm_partialline();
+ if (r == -1) temp_read();
+ if (ch == 'L') /* ... ##L */
+ substdio_put(&smtpto,verh.s,posat);
+ else /* ... ##H */
+ substdio_put(&smtpto,verh.s + posat + 1,verh.len - posat - 1);
+ } else {
+ substdio_put(&smtpto,"#",1);
+ if (ch == '\n') break;
+ substdio_put(&smtpto,&ch,1);
+ }
+ } else
+ substdio_put(&smtpto,&ch,1);
+ r = substdio_get(&ssin,&ch,1);
+ if (r == 0) perm_partialline();
+ if (r == -1) temp_read();
+ }
+ substdio_put(&smtpto,"\r\n",2);
+ }
+
+ flagcritical = 1;
+ substdio_put(&smtpto,".\r\n",3);
+ substdio_flush(&smtpto);