char text[MAXWORDBUF];
};
+struct AttachedFile {
+ struct AttachedFile *next;
+ char filename[256];
+ };
+
char inkey(void);
void sttybbs(int cmd);
int struncmp(char *lstr, char *rstr, int len);
long now,beg;
char datestr[64];
int cksum = 0;
+ struct AttachedFile *AttachList = NULL;
+ struct AttachedFile *Aptr;
+ char buf[256];
if (mode==2) if (strlen(editor_path)==0) {
printf("*** No editor available, using built-in editor\n");
printf("Hold message\n");
return(2);
}
- if ((b=='f')&&(rc_allow_attachments==1)) {
+ /* if ((b=='f')&&(rc_allow_attachments==1)) { */
+ if (b=='f') {
printf("attach File\n");
if (strlen(boundary)==0) {
sprintf(boundary, "Citadel-Attachment-%ld.%d",
time(NULL), getpid() );
}
- /* FIX FIX now you have to attach the file, stupid */
+ newprompt("Filename: ", buf, 68);
+ if (access(buf, R_OK)==0) {
+ Aptr = (struct AttachedFile *)
+ malloc(sizeof(struct AttachedFile));
+ strcpy(Aptr->filename, buf);
+ Aptr->next = AttachList;
+ AttachList = Aptr;
+ }
+ else {
+ printf("*** Cannot open %s: %s\n",
+ buf, strerror(errno));
+ }
+ goto MECR;
}
goto MECR2;
}
-int alias(char *name) /* process alias and routing info for mail */
- {
- FILE *fp;
- int a,b;
- char aaa[300],bbb[300];
-
- fp=fopen("network/mail.aliases","r");
- if (fp==NULL) return(2);
-GNA: strcpy(aaa,""); strcpy(bbb,"");
- do {
- a=getc(fp);
- if (a==',') a=0;
- if (a>0) { b=strlen(aaa); aaa[b]=a; aaa[b+1]=0; }
- } while(a>0);
- do {
- a=getc(fp);
- if (a==10) a=0;
- if (a>0) { b=strlen(bbb); bbb[b]=a; bbb[b+1]=0; }
- } while(a>0);
- if (a<0) {
- fclose(fp);
- goto DETYPE;
- }
- if (strucmp(name,aaa)) goto GNA;
- fclose(fp);
- strcpy(name,bbb);
- printf("*** Mail is being forwarded to %s\n",name);
-
-DETYPE: /* determine local or remote type, see citadel.h */
- for (a=0; a<strlen(name); ++a) if (name[a]=='!') return(M_INTERNET);
- for (a=0; a<strlen(name); ++a)
- if (name[a]=='@')
- for (b=a; b<strlen(name); ++b)
- if (name[b]=='.') return(M_INTERNET);
- b=0; for (a=0; a<strlen(name); ++a) if (name[a]=='@') ++b;
- if (b>1) {
- printf("Too many @'s in address\n");
- return(M_ERROR);
- }
- if (b==1) {
- for (a=0; a<strlen(name); ++a)
- if (name[a]=='@') strcpy(bbb,&name[a+1]);
- while (bbb[0]==32) strcpy(bbb,&bbb[1]);
- fp = fopen("network/mail.sysinfo","r");
- if (fp==NULL) return(M_ERROR);
-GETSN: do {
- a=getstring(fp,aaa);
- } while ((a>=0)&&(strucmp(aaa,bbb)));
- a=getstring(fp,aaa);
- if (!strncmp(aaa,"use ",4)) {
- strcpy(bbb,&aaa[4]);
- fseek(fp,0L,0);
- goto GETSN;
- }
- fclose(fp);
- if (!strncmp(aaa,"uum",3)) {
- strcpy(bbb,name);
- for (a=0; a<strlen(bbb); ++a) {
- if (bbb[a]=='@') bbb[a]=0;
- if (bbb[a]==' ') bbb[a]='_';
- }
- while(bbb[strlen(bbb)-1]=='_') bbb[strlen(bbb)-1]=0;
- sprintf(name,&aaa[4],bbb);
- return(M_INTERNET);
- }
- if (!strncmp(aaa,"bin",3)) {
- strcpy(aaa,name); strcpy(bbb,name);
- while (aaa[strlen(aaa)-1]!='@') aaa[strlen(aaa)-1]=0;
- aaa[strlen(aaa)-1]=0;
- while (aaa[strlen(aaa)-1]==' ') aaa[strlen(aaa)-1]=0;
- while (bbb[0]!='@') strcpy(bbb,&bbb[1]);
- strcpy(bbb,&bbb[1]);
- while (bbb[0]==' ') strcpy(bbb,&bbb[1]);
- sprintf(name,"%s @%s",aaa,bbb);
- return(M_BINARY);
- }
- return(M_ERROR);
- }
- return(M_LOCAL);
- }
-
-
#ifdef NO_STRERROR
/*
* replacement strerror() for systems that don't have it