summaryrefslogtreecommitdiff
path: root/contrib/carmel/imapd/imapd.c.patch.old
blob: 16ed2981528504741f03df70d3e1ef105c24a6a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
*** imapd.c	Sun Jul 18 21:48:29 1993
--- imapd.c.new	Sun Jul 18 21:47:53 1993
***************
*** 109,115 ****
--- 109,119 ----
  extern DRIVER bezerkdriver,tenexdriver,imapdriver,newsdriver,nntpdriver,
    dummydriver;
  
+ #ifdef BWC
+ extern DRIVER carmeldriver, carmel2driver;
+ #endif
  
+ 
  /* Function prototypes */
  
  void main  ();
***************
*** 135,140 ****
--- 139,148 ----
  long cstring  ();
  long caddr  ();
  
+ #ifdef BWC
+ char *glyph2richtext();
+ #endif
+ 
  extern char *crypt  ();
  
  /* Main program */
***************
*** 147,152 ****
--- 155,164 ----
    char *s,*t = "OK",*u,*v;
    struct hostent *hst;
    void (*f) () = NIL;
+ #ifdef BWC
+   mail_link (&carmeldriver);
+   mail_link (&carmel2driver);
+ #endif  
    mail_link (&tenexdriver);	/* install the Tenex mail driver */
    mail_link (&bezerkdriver);	/* install the Berkeley mail driver */
    mail_link (&imapdriver);	/* install the IMAP driver */
***************
*** 164,170 ****
--- 176,186 ----
      state = SELECT;		/* enter select state */
      t = "PREAUTH";		/* pre-authorized */
    }
+ #ifdef BWC
+   printf ("* %s %s IMAP2bis Service %sBWC at %s\015\012",t,host,version,cmdbuf);
+ #else
    printf ("* %s %s IMAP2bis Service %s at %s\015\012",t,host,version,cmdbuf);
+ #endif
    fflush (stdout);		/* dump output buffer */
    signal (SIGALRM,clkint);	/* prepare for clock interrupt */
    signal (SIGUSR2,kodint);	/* prepare for Kiss Of Death */
***************
*** 782,788 ****
--- 798,817 ----
    if (body && (s = mail_fetchbody (stream,i,s,&j))) {
  				/* and literal string */
      printf ("{%d}\015\012",j);
+ #ifdef BWC_NOT_WORKING_YET
+     {
+         char *ss;
+         s[j] = '\0';
+         s = glyph2richtext(s);
+         j = strlen(s);
+         ss = rfc822_8bit(s, j, &j);
+         fs_give((void **)&s);
+         while (j -= k) k = fwrite (ss += k,1,j,stdout);
+         fs_give((void **)&ss);
+     }
+ #else    
      while (j -= k) k = fwrite (s += k,1,j,stdout);
+ #endif
      changed_flags (i,f);	/* output changed flags */
    }
    else fputs ("NIL",stdout);	/* can't output anything at all */
***************
*** 983,995 ****
--- 1012,1039 ----
      else {			/* non-multipart body type */
        pstring ((char *) body_types[body->type]);
        putchar (' ');
+ #ifdef BWC
+       if(body->type == TYPETEXT && strcmp(lcase(body->subtype), "x-bwc-glyph") == 0)
+         pstring("plain"); /* Make it plain now, richtext later when fixed */
+       else
+         pstring (body->subtype);
+ #else
        pstring (body->subtype);
+ #endif
        if (param = body->parameter) {
  	fputs (" (",stdout);
  	do {
  	  pstring (param->attribute);
  	  putchar (' ');
+ #ifdef BWC_NOT_WORKING_YET
+           if(strucmp2(param->attribute, "charset") == 0) {
+               pstring("ISO-8859-1");
+           } else {
+     	      pstring (param->value);
+           }
+ #else
  	  pstring (param->value);
+ #endif
  	  if (param = param->next) putchar (' ');
  	} while (param);
  	fputs (") ",stdout);