亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? forward.c

?? 這是新華龍(www.xhl.xom.xn)開(kāi)發(fā)的
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/* Some of the code in this file was originally based on the following file:
 */
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include "global.h"
#include "config.h"
#include "bm.h"
#include "mailbox.h"
#include "smtp.h"
#include "cmdparse.h"
#include "proc.h"
#include "socket.h"
#include "timer.h"
#include "usock.h"
#include "netuser.h"
#include "ax25.h"
#include "netrom.h"
#include "nr4.h"
#include "files.h"

#define ISPROMPT(s)	(strlen(s) > 1 && s[strlen(s)-2] == '>')
static struct timer fwdtimer;

static char *findident(char *str, int n, char *result);
static void sendmsg(struct mbx *m,int msgn);
static char *mbxtime(char *line);
static int fwdinit(struct mbx *m);
static char *fwdanybbs(struct mbx *m);
static int timeok(char *line);
static void fwdtick(void *v);
static int isconnbbs(struct mbx *m);
static void startfwd(int a,void *v1,void *v2);
static int openconn(int argc,char *argv[],void *p);
static int sendmsgtobbs(struct mbx *m,int msgn,char *dest,int bulletin);
static int makecl(struct mbx *m,int msgn,char *dest,char *line,char *subj,int bulletin);
static char *grabtext(char *from,char *to,int marker);

/***************************************************************************
   findident copies the 'n'th alphanumeric sequence from 'str' to result.
   It returns a ptr to result. It returns "\0" for missing identifier etc.
   Uses isalnum macro to decide on alphanumeric/non-alnum status.
*/
static char *
findident(str, n, result)
char *str, *result;
int n;
{
   int count; /* current identifier */
   count = 0;
   *result = '\0';
   while ( (count<n) && (*str!='\0') ) { /* Process alnum or non alnum seq */
      while ( (*str!='\0') && (!isalnum(*str)) ) /* Get rid of ';:.@%"# etc */
         str++;
      if ( (str!='\0') && isalnum(*str) ) { /* this is an alnum seq */
         count++;
         while ( (*str!='\0') && (isalnum(*str) || (*str=='_')) )
            if (count==n)
               *result++ = *str++;
            else str++;
         if (count==n)
            *result = '\0';
         }
      }
   return result;
}
/**************************************************************************/
static void
sendmsg(m,msgn)
struct mbx *m;
int msgn;
{
	char buf[LINELEN], tb[LINELEN], *cp;
	int len, rec = 0;
	long cnt;
	fseek(m->mfile,m->mbox[msgn].start,0);
	cnt = m->mbox[msgn].size;

	/* If the data part of the message starts with "R:" the RFC-822
	 * headers will not be forwarded. Instead we will add an R:
	 * line of our own.
	 */
	for(;;) {
		if(fgets(buf,sizeof(buf),m->mfile) == NULL)
			break;
		cnt -= strlen(buf);
		if(rec == 1) {	/* look at the line following Received: */
		     ++rec;
		     if((cp = strchr(buf,';')) != NULL){
			  strcpy(tb,cp+1); 	/* get the date of receipt */
			  ++rec;
		     }
		}
		/* The first Received: line is the one that we have added */
		if(!rec && htype(buf) == RECEIVED)
		     ++rec;
		if(*buf == '\n') {
		     if(rec == 3 && cnt > 1) {
			  fread(buf,1,2,m->mfile);
			  cnt -= 2;
			  if(strncmp(buf,"R:",2) == 0) {
			       pax25(buf,Mycall);
			       if((cp = strchr(buf,'-')) != NULL)
				    *cp = '\0';	/* remove SSID */
			       fprintf(m->user,"R:%s @%s %s (%s)\nR:",
					mbxtime(tb),buf,Hostname,Version);
			       break;
			  }
		     }
		     /* Start over, forwarding the RFC-822 headers */
		     fseek(m->mfile,m->mbox[msgn].start,0);
		     cnt = m->mbox[msgn].size;
		     rec = 0;
		     break;
		}
	   }
	while(rec != 3) {	/* Forward the RFC-822 headers */
		if(fgets(buf,sizeof(buf),m->mfile) == NULL)
			break;
		cnt -= strlen(buf);
		switch(htype(buf)) {
		case XFORWARD: /* Do not forward the "X-Forwarded-To:" lines */
		case STATUS:   /* Don't forward the "Status:" line either */
		     break;
		default:
		     fputs(buf,m->user);
		}
		if(*buf == '\n')	/* last header line */
			break;
	}
	do {	/* the rest of the message is treated below */
		len = min(cnt,sizeof(buf)-1);
		if(fread(buf,1,len,m->mfile) != len)
			break;
		cnt -= len;
		buf[len] = '\0';
		fputs(buf,m->user);
	} while(cnt);
}

/* Parse a line for date and time in Arpanet format
 * (Day, day Month year hh:mm:ss Zone) and return it in mailbox format
 * (yymmdd/hhmmz)
 */
static char *
mbxtime(line)
char *line;
{
     extern char *Months[];
     static char buf[13];
     char *cp;
     int i, day;
     cp = line;
     while(isspace(*cp))	/* skip initial blanks */
	  ++cp;
     if(*cp == '\0')
	  return NULL;
     if(strlen(cp) < 22)
	  return NULL;
     cp += 5;
     day = atoi(cp);
     if(*(++cp) != ' ')
	  ++cp;
     ++cp;
     for(i=0; i < 12; ++i)
	  if(strnicmp(Months[i],cp,3) == 0)
	       break;
     if(i == 12)
	  return NULL;
     sprintf(buf,"%02d%02d%02d/%02d%02d%c",atoi(cp + 4),i+1,day,atoi(cp + 7),
	     atoi(cp + 10), (strnicmp(cp + 16,"GMT",3) &&
			     strnicmp(cp + 16,"UTC",3)) ? ' ' : 'z');
     return buf;
}
     
static char *
grabtext(from, to, marker)
char *from, *to;
int marker;
{
   while (*from!=marker)
      *to++ = *from++;
   *to = '\0';
   return from+1;
}

/* Makes a command line and returns -1 if the message cannot be sent. */
static int
makecl(m, msgn, dest, line, subj, bulletin)
struct mbx *m;
int msgn;		/* Message number */
char *dest;		/* Destination address to use instead of To: line */
char *line, *subj;	/* Buffers to keep command line and subject */
int bulletin;		/* True if message is in public message area */
{
   char bid[LINELEN], to[LINELEN], atbbs[LINELEN], from[LINELEN],
	buf[LINELEN], *cp;
   if(m->mfile == NULL)
	return -1;
   if(!bulletin && (m->mbox[msgn].status & BM_READ))
	return -1;	/* the message was already read */
   fseek(m->mfile,m->mbox[msgn].start,0);
   *bid = *to = *atbbs = *from = '\0';
   if(subj != NULL)
	*subj = '\0';
   m->stype = bulletin ? 'B' : 'P';	/* default to SB or SP */
   while (fgets(buf,sizeof(buf),m->mfile) != NULL) {
      if (buf[0] == '\n')
         break; /* envelope finished */
      switch (htype(buf)) {
      case TO:
	    /* The following code tries to parse "To: " lines where the
	     * address looks like any of the following: "to@atbbs",
	     * "<to@atbbs>", "<to%atbbs@host>" and with possible spaces
	     * surrounding the '<>' characters.
	     */
	    if((cp = getaddress(buf,0)) == NULL)
		break;
	    strcpy(to,cp);
	    if((cp = strchr(to,'%')) != NULL) { /* look for a '%' */
		 strcpy(atbbs,cp + 1);
		 *cp = '\0';	/* "to" ends at the '%' character */
	    }
	    else {	/* no '%' but maybe a '@'? */
		 if((cp = strchr(to,'@')) != NULL) {
		      strcpy(atbbs,cp + 1);
		      *cp = '\0';	/* "to" ends at the '@' character */
		 }
	    }
	    if(*atbbs != '\0')		/* either '%' or '@' found */
		 /* cut "atbbs" at the first '@' character */
		 for(cp = atbbs; *cp != '\0'; ++cp)
		      if(*cp == '@') {
			   *cp = '\0';
			   break;
		      }
	    /* "to" or "atbbs" should not be more than 6 characters (ALEN).
	     * If "to" is too long, it might simply be because the area name
	     * is longer than 6 characters, but it might also be because
	     * the address on the To: line is in an obscure format that we
	     * failed to parse (eg '!' character notation.)
	     */
	    if(strlen(to) > ALEN) {
		/* Play safe and set "to" and "atbbs" to the area name */
		strcpy(to,m->area);
		strcpy(atbbs,m->area);
      	    }
	    if(*atbbs == '\0')
		strcpy(atbbs,to);
      	    to[ALEN] = '\0';
	    /* Only if the BBS supports "hierarchical routing designators"
	     * is the atbbs field allowd to be longer than 6 characters and
	     * have dots in it.
	     */
	    if((m->sid & MBX_HIER_SID) == 0) {
		 atbbs[ALEN] = '\0';	/* 6 character limit */
		 if((cp = strchr(atbbs,'.')) != NULL)
		      *cp = '\0';	/* cut "atbbs" at first dot */
	    }
            break;
      case MSGID:
	    /* The following code distinguishes between two different types
	     * of Message-IDs: <abcde@callsign.bbs> and <abcde@host.domain>.
	     * The first type is converted to $abcde and the second to
	     * $abcde_host.domain. This preserves compability with BBSes.
	     */
	    if((cp = getname(buf)) == NULL)
		 break;
	    bid[0] = '$';
	    strcpy(&bid[1],cp);
      	    cp = strchr(bid,'@');
	    /* A trailing ".bbs" indicates that the Message-ID was generated
	     * from a BBS style message, and not a RFC-822 message.
	     */
	    if(cp != NULL && stricmp(&bid[strlen(bid) - 4], ".bbs") == 0)
		*cp = '\0';
	    else
		*cp = '_';
	    bid[13] = '\0';	/* BIDs should be no longer than 13 bytes */
      	    break;
      case SUBJECT:
	    if(subj != NULL)
      		(void) grabtext(buf+9, subj, '\n');
            break;
      case FROM:
	    if((cp = getaddress(buf,0)) != NULL) {
		findident(cp, 1, from);		/* cp points to from@domain */
		from[ALEN] = '\0';	/* 6 character limit */
	    }
            break;
      case XFORWARD:
	    if((cp = getaddress(buf,0)) == NULL)
		 break;
	    if(stricmp(m->name,cp) == 0)
		/* This message has already been forwarded, abort */
		return -1;
	    break;
      case BBSTYPE:
	    m->stype = buf[16];
	    break;
      default:
	    break;
      }
   }
   /* Check for an invalid RFC-822 header */
   if((to[0] == '\0' && ((dest != NULL && *dest == '\0') ||
      dest == NULL)) || from[0] == '\0')
	return -1;

   if(line != NULL) {
	if(dest != NULL && *dest != '\0'){
	     /* strip off hierarchical routing designators from the predefined
	      * destination address if they are not supported
	      */
	     if((m->sid & MBX_HIER_SID) == 0 && (cp = strchr(dest,'.')) !=
	       NULL)
		*cp = '\0';
	     sprintf(line, "S%c %s < %s ", m->stype, dest, from);
	}
	else
	     sprintf(line, "S%c %s @ %s < %s ", m->stype, to, atbbs, from);
	if(bulletin & (m->sid & MBX_SID))
	     strcat(line,bid);
	strcat(line,"\n");
   }
   return 0;
}

static int /* 0 = ok, -1 = problem so disc */
sendmsgtobbs(m, msgn, dest, bulletin)
struct mbx *m;
int msgn;
char *dest;		/* Optional destination address to override To: line */
int bulletin;
{
   int result = -1;
   char line[64], subj[256];
   if(makecl(m, msgn, dest, line, subj, bulletin) == -1)
	return 0;	/* do not forward this particular message */
   fputs(line,stdout);		 /* Send mail offer to bbs */
   rip(line);
   fflush(m->user);
   if (fgets(m->line, MBXLINE,m->user) != NULL ) {
      if (m->line[0] == 'O' || m->line[0] == 'o' || (m->sid & MBX_SID) == 0) {
	 /* Got 'OK' or any line if the bbs is unsofisticated */
         printf("%s\n", subj);
	 sendmsg(m,msgn);	/* send the message */
         puts("/EX"); /* was 0x1a */
         fflush(m->user);
      	 /* get F> for a good deliver */
      	 while (fgets(m->line, MBXLINE,m->user) != NULL )
		if (ISPROMPT(m->line)) {
			logmsg(fileno(m->user),"MBOX bbs mail sent: %s ", line);
			if(bulletin)
				m->mbox[msgn].status |= BM_FORWARDED;
			else
				m->mbox[msgn].status |= BM_DELETE;
			m->change = 1;
			result = 0;
			break;
		}
      }
      else { /* OK response not received from bbs */
	   if (m->line[0] == 'N' || m->line[0] == 'n') { /* 'NO' respone */
          	logmsg(fileno(m->user),"MBOX bbs mail refused: %s\n     %s",line,m->line);
		/* Mark refused message as forwarded if it is a bulletin.
		 * The message was probably a duplicate. Non-bulletin
		 * messages are sent without BID, so they cannot be dected
		 * as duplicates. The reason why it was refused is probably
		 * because the address was invalid. Retry later.
		 */
		if(bulletin){
			m->mbox[msgn].status |= BM_FORWARDED;
			m->change = 1;
		}
          }
      	  /* should get a F> here */
          while (fgets(m->line, MBXLINE,m->user) != NULL )
      		if (ISPROMPT(m->line)) {
      			result = 0;
			break;
      		}
      }
   } /* OK or NO here */
   return result;
}

/* This is the main entry point for reverse forwarding. It is also used
 * for normal, "forward", forwarding.
 */
int
dorevfwd(argc,argv,p)
int argc;
char *argv[];
void *p;
{
	char oldarea[64], *cp;
	struct mbx *m;
	int i, bulletin, err = 0;
	m = (struct mbx *)p;
	logmsg(fileno(m->user),"MBOX forwarding mail to: %s ", m->name);
	/* indicate we are doing reverse forwarding, if we are not already
	 * doing normal forwarding.
	 */
	if(m->state != MBX_FORWARD)
		m->state = MBX_REVFWD;
	if(fwdinit(m) != -1) {
		strcpy(oldarea,m->area);
		while(!err && fgets(m->line,MBXLINE,m->tfile) != NULL) {
			if(*m->line == '-')	/* end of record reached */
				break;
			rip(m->line);		/* adds extra null at end */
			cp = strchr(m->line,' '); /* remove trailing blanks */
			if(cp != NULL)
				*cp = '\0';
			if((cp = strchr(m->line,'\t')) != NULL)
				*cp = '\0';
			if(*m->line == '\0' || *m->line == '.')
				continue;
			changearea(m,m->line);
			bulletin = isarea(m->line);	/* public area */
			/* get the optional destination field, cp will point
			 * at null byte if it is missing.

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91色.com| 91在线观看高清| 亚洲午夜三级在线| 亚洲色图欧美激情| 亚洲激情欧美激情| 亚洲综合色网站| 亚洲色图20p| 一区二区三区不卡视频在线观看| 国产精品亲子伦对白| 国产精品久久久久一区二区三区| 久久久久久久久免费| 久久精品夜色噜噜亚洲a∨| 亚洲国产精品一区二区久久| 一区二区三区在线视频观看| 一区二区三区 在线观看视频| 亚洲精品视频自拍| 亚洲已满18点击进入久久| 亚洲国产一区二区三区| 婷婷成人激情在线网| 奇米在线7777在线精品| 国产一区二区h| 成人午夜视频在线| 欧美视频你懂的| 日韩欧美一区在线| 欧美激情一二三区| 亚洲人成亚洲人成在线观看图片| 一区二区三区在线免费| 毛片基地黄久久久久久天堂| 国产麻豆精品在线观看| 91一区一区三区| 欧美一区二区久久| 国产精品久久毛片| 日韩av网站免费在线| 国产乱码精品一区二区三区忘忧草| 国产91精品欧美| 欧美日韩久久不卡| 国产亚洲欧美一区在线观看| 亚洲精品视频在线看| 久久精品99国产国产精| 99re热视频精品| 日韩欧美国产成人一区二区| 一区在线观看视频| 激情综合网av| 在线免费不卡视频| 日本一区二区久久| 天天综合色天天综合色h| 国产91丝袜在线播放| 欧美精品免费视频| 亚洲视频综合在线| 极品销魂美女一区二区三区| 欧美性做爰猛烈叫床潮| 中文字幕巨乱亚洲| 麻豆精品一区二区av白丝在线| 97超碰欧美中文字幕| 精品盗摄一区二区三区| 五月天丁香久久| 99re视频这里只有精品| 久久精品日韩一区二区三区| 丝袜诱惑亚洲看片| 91色在线porny| 国产精品丝袜黑色高跟| 麻豆成人久久精品二区三区红| 在线欧美日韩国产| 亚洲欧美日韩精品久久久久| 丁香一区二区三区| 久久久久久久久久久电影| 日韩avvvv在线播放| 欧美日韩在线观看一区二区| 日韩理论片网站| 成人h精品动漫一区二区三区| 精品美女一区二区| 国内精品嫩模私拍在线| 日韩欧美在线网站| 日本一道高清亚洲日美韩| 国产人伦精品一区二区| 精品一区二区三区香蕉蜜桃| 51久久夜色精品国产麻豆| 天堂av在线一区| 欧美一卡2卡3卡4卡| 另类欧美日韩国产在线| 欧美tk—视频vk| 国产毛片精品视频| 久久久久久久国产精品影院| 黑人精品欧美一区二区蜜桃 | 成人av资源在线| 中文字幕精品在线不卡| aaa欧美日韩| 亚洲视频资源在线| 欧美亚洲国产一区二区三区va| 亚洲国产日韩a在线播放| 欧美嫩在线观看| 久久国产精品区| 国产女人18水真多18精品一级做| 国产69精品久久久久777| 综合中文字幕亚洲| 欧美日韩一区二区在线观看视频| 亚洲国产wwwccc36天堂| 欧美人与z0zoxxxx视频| 久国产精品韩国三级视频| 久久久精品tv| 色呦呦网站一区| 免费在线观看视频一区| 国产亚洲欧洲997久久综合| 99riav一区二区三区| 日本中文字幕不卡| 欧美激情一区二区三区不卡| 欧洲精品一区二区三区在线观看| 日本人妖一区二区| 国产精品免费av| 欧美福利视频导航| 国产99精品国产| 亚洲国产日韩在线一区模特| 精品福利一区二区三区| 色先锋资源久久综合| 精品一区二区综合| 亚洲免费在线观看视频| 日韩欧美的一区二区| 不卡的av中国片| 老司机精品视频在线| 亚洲欧美在线视频| 精品欧美黑人一区二区三区| 色狠狠av一区二区三区| 国产精品自在在线| 午夜精品国产更新| 国产精品成人一区二区艾草 | 久久国产精品色| 亚洲乱码中文字幕综合| 久久久一区二区三区捆绑**| 欧洲精品中文字幕| a亚洲天堂av| 国产精品一区三区| 男女激情视频一区| 亚洲大型综合色站| 中文字幕日韩精品一区 | 欧美猛男男办公室激情| 国产a精品视频| 国产一区二区三区最好精华液| 亚洲精品五月天| 国产精品美女久久久久高潮| 欧美成人性战久久| 欧美情侣在线播放| 欧美三级中文字| 91一区二区三区在线观看| 国产传媒一区在线| 国产一区二区不卡| 国产美女精品一区二区三区| 蜜臀久久99精品久久久久久9| 亚洲一区自拍偷拍| 一级精品视频在线观看宜春院 | 欧美变态口味重另类| 欧美日本一区二区三区| 欧美视频一二三区| 欧美色图第一页| 欧美视频一区二区三区在线观看| jvid福利写真一区二区三区| 国产成人av在线影院| 国产九九视频一区二区三区| 久久不见久久见免费视频1| 激情五月播播久久久精品| 狠狠色丁香久久婷婷综| 国产精品一线二线三线| 国产黄人亚洲片| 成人黄页毛片网站| 99国产精品国产精品久久| 一本大道久久精品懂色aⅴ| 欧美在线观看一区二区| 7777精品伊人久久久大香线蕉完整版| 在线亚洲高清视频| 欧美日韩的一区二区| 91精品国产综合久久久久久漫画| 91精品国产麻豆国产自产在线| 欧美v日韩v国产v| 中文字幕成人在线观看| 一区二区三区欧美| 美腿丝袜一区二区三区| 国产在线精品一区二区夜色| 国产a区久久久| 在线观看免费一区| 日韩欧美国产午夜精品| 国产精品网站导航| 无码av中文一区二区三区桃花岛| 热久久一区二区| 成人app下载| 欧美精选午夜久久久乱码6080| 日韩三级.com| 欧美激情自拍偷拍| 香蕉乱码成人久久天堂爱免费| 精品一区二区三区日韩| 99国产麻豆精品| 日韩一级片在线播放| 国产精品久久久久久久岛一牛影视 | 欧美日韩国产成人在线91| 欧美mv日韩mv国产| 亚洲视频一区二区免费在线观看| 亚洲成人在线免费| 国产成人av电影在线播放| 国产精品国产精品国产专区不蜜| 一区二区三区四区五区视频在线观看| 另类的小说在线视频另类成人小视频在线 | 91精彩视频在线|