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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vqmaillocal.c

?? 相當優秀的 UNIX 進程管理工具
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* * $Id: vqmaillocal.c,v 1.3 2003/12/17 03:39:50 tomcollins Exp $ * Copyright (C) 2002 Inter7 Internet Technologies, Inc. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA *//* include files */#include <unistd.h>#include <stdlib.h>#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/wait.h>#include <fcntl.h>#include <dirent.h>#include <errno.h>#include <time.h>#include <signal.h>#include "config.h"#include "vpopmail.h"#include "vauth.h"/* Globals */#define AUTH_SIZE 300char TheUser[AUTH_SIZE];char TheHomeDir[AUTH_SIZE];char TheLocal[AUTH_SIZE];char TheDash[AUTH_SIZE];char TheExt[AUTH_SIZE];char TheSender[AUTH_SIZE];char TheDefaultDelivery[AUTH_SIZE];char TheUserFull[AUTH_SIZE];char TheDomain[AUTH_SIZE];char TheDir[AUTH_SIZE];char CurrentDir[AUTH_SIZE];char DeliveredTo[AUTH_SIZE];struct vqpasswd *vpw;off_t message_size = 0;char bounce[AUTH_SIZE];int CurrentQuotaSizeFd;#ifdef QMAIL_EXTchar TheUserExt[AUTH_SIZE]; /* the User with '-' and following chars out if any */#endif#define FILE_SIZE 156char hostname[FILE_SIZE];char loop_buf[FILE_SIZE];#define MSG_BUF_SIZE 5000char msgbuf[MSG_BUF_SIZE];#define BUFF_SIZE 300int fdm;static char *binqqargs[4];/* Forward declarations */int process_valias(void);int is_delete(char *deliverto);int is_bounce(char *deliverto);void get_arguments(int argc, char **argv);off_t get_message_size();int deliver_mail(char *address, char *quota);int user_over_quota(char *address, char *quota);int check_forward_deliver(char *dir);off_t count_dir(char *dir_name);int is_looping( char *address );void run_command(char *prog);void checkuser(void);void usernotfound(void);static char local_file[156];static char local_file_new[156];/*  * The email message comes in on file descriptor 0 - stanard in * The user to deliver the email to is in the EXT environment variable * The domain to deliver the email to is in the HOST environment variable */int main(int argc, char **argv){    /* get the arguments to the program and setup things */    get_arguments(argc, argv);#ifdef VALIAS    /* process valiases if configured */    if ( process_valias() == 1 ) {        printf("vdelivermail: valiases processed\n");        vexit(0);    }#endif    /* get the user from vpopmail database */    if ((vpw=vauth_getpw(TheUser, TheDomain)) != NULL ) {        checkuser();    } #ifdef QMAIL_EXT    /* try and find user that matches the QmailEXT address if: no user found, */    /* and the QmailEXT address is different, meaning there was an extension */    else if ( strncmp(TheUser, TheUserExt, AUTH_SIZE) != 0 ) {        /* get the user from vpopmail database */        if ((vpw=vauth_getpw(TheUserExt, TheDomain)) != NULL ) {	    checkuser();        }	else {	    usernotfound();	}    }#endif    else {        if ( verrori != 0 ) {            vexit(111);        }        usernotfound();    }     /* exit successfully and have qmail delete the email */    return(vexit(0));            }/*  * Get the command line arguments and the environment variables. * Force addresses to be lower case and set the default domain */void get_arguments(int argc, char **argv){#ifdef QMAIL_EXT  int i;#endif    if (argc != 10) {        printf("vqmaillocal: wrong number of parameters\n");         vexit(0);    }    strncpy(TheHomeDir, argv[3], sizeof(TheHomeDir));     strncpy(TheUser, argv[6], sizeof(TheHomeDir));     strncpy(TheDomain, argv[7], sizeof(TheHomeDir));     printf("%s,%s,%s\n", TheHomeDir, TheUser, TheDomain);    chdir(TheHomeDir);    lowerit(TheUser);    lowerit(TheDomain);    strncpy(TheUserFull, TheUser, AUTH_SIZE);#ifdef QMAIL_EXT     /* delete the '-' and following chars if any and store in TheUserExt */    for(i = 0; TheUser[i] != 0; i++) {        if (TheUser[i] == '-' ) {            break;        }        TheUserExt[i] = TheUser[i];    }    TheUserExt[i] = 0;#endif}#ifdef VALIAS/*  * Process any valiases for this user@domain *  * This will look up any valiases in vpopmail and * deliver the email to the entries * * Return 1 if aliases found * Return 0 if no aliases found  */int process_valias(void){ int found = 0; char *tmpstr;    /* Get the first alias for this user@domain */    tmpstr = valias_select( TheUser, TheDomain );    /* tmpstr will be NULL if there are no more aliases */    while (tmpstr != NULL ) {        /* We found one */        found = 1;        /* deliver the mail */        deliver_mail(tmpstr, "NOQUOTA");        /* Get the next alias for this user@domain */        tmpstr = valias_select_next();    }#ifdef QMAIL_EXT     /* try and find alias that matches the QmailEXT address      * if: no alias found,      * and the QmailEXT address is different, meaning there was an extension      */    if ( (!found) && ( strncmp(TheUser, TheUserExt, AUTH_SIZE) != 0 )  ) {        /* Get the first alias for this user@domain */        tmpstr = valias_select( TheUserExt, TheDomain );        /* tmpstr will be NULL if there are no more aliases */        while (tmpstr != NULL ) {            /* We found one */            found = 1;            /* deliver the mail */            deliver_mail(tmpstr, "NOQUOTA");            /* Get the next alias for this user@domain */            tmpstr = valias_select_next();        }     }	#endif    /* Return whether we found an alias or not */    return(found);}#endif/* If the .qmail-default file has bounce all in it * Then return 1 * otherwise return 0 */int is_bounce(char *deliverto){    if ( strcmp( deliverto, BOUNCE_ALL ) == 0 ) return(1);    return(0);}/* If the .qmail-default file has delete all in it * Then return 1 * otherwise return 0 */int is_delete(char *deliverto){    if ( strcmp( deliverto, DELETE_ALL ) == 0 ) return(1);    return(0);}/* * Assumes the current working directory is user/Maildir * * We go off to look at cur and tmp dirs *  * return size of files * */ssize_t check_quota(char *maildir){ ssize_t mail_size = 0; char tmpbuf[156];    snprintf(tmpbuf, 156, "%s.current_size", maildir);    if ((CurrentQuotaSizeFd=open(tmpbuf,O_CREAT|O_RDWR,S_IWUSR|S_IRUSR))==-1){       return(mail_size);    }    read(CurrentQuotaSizeFd, tmpbuf, 100);    mail_size = (off_t)atoi(tmpbuf);    return(mail_size);}off_t recalc_quota(char *dir_name){ off_t mail_size = 0; char tmpbuf[100];        getcwd(CurrentDir, AUTH_SIZE);	mail_size = count_dir(dir_name);        chdir(CurrentDir);	snprintf(tmpbuf, 100, "%d\n", (int)mail_size);	lseek(CurrentQuotaSizeFd, 0L, SEEK_SET);	write(CurrentQuotaSizeFd, tmpbuf, strlen(tmpbuf));	return(mail_size);}void update_quota(off_t new_size){ char tmpbuf[100];	snprintf(tmpbuf, 100, "%d\n", (int)new_size);	lseek(CurrentQuotaSizeFd, 0L, SEEK_SET);	write(CurrentQuotaSizeFd, tmpbuf, strlen(tmpbuf));	close(CurrentQuotaSizeFd);}off_t count_dir(char *dir_name){ DIR *mydir; struct dirent *mydirent; struct stat statbuf; off_t file_size = 0; char *tmpstr;    if ( dir_name == NULL ) return(0);    if (chdir(dir_name) == -1) {        return(0);    }	if ( (mydir = opendir(".")) == NULL )  {            return(0);        }	while( (mydirent=readdir(mydir)) != NULL ) {		if ( strcmp( mydirent->d_name, "..") == 0 ) continue;		if ( strcmp( mydirent->d_name, ".") == 0 ) continue;		if ( (tmpstr=strstr(mydirent->d_name, ",S="))!=NULL) {			tmpstr += 3;			file_size += atoi(tmpstr);		} else if (stat(mydirent->d_name,&statbuf)==0 && 		           (statbuf.st_mode & S_IFDIR) ) {			file_size +=  count_dir(mydirent->d_name);		}	}	closedir(mydir);	if ( dir_name != NULL && strcmp(dir_name, ".." )!=0 && 	                         strcmp(dir_name, "." )!=0) {		chdir("..");	}	return(file_size);}long unsigned qmail_inject_open(char *address){ int pim[2]; long unsigned pid; static char *in_address;        in_address = malloc(strlen(address)+1);        strcpy( in_address, address);         /* skip over an & sign if there */        if (*in_address == '&') ++in_address;        if ( pipe(pim) == -1) return(-1);        switch(pid=vfork()){        case -1:                close(pim[0]);                close(pim[1]);                return(-1);        case 0:                close(pim[1]);                if (vfd_move(0,pim[0]) == -1 ) _exit(-1);                binqqargs[0] = QMAILINJECT;                binqqargs[1] = in_address;                execv(*binqqargs, binqqargs);        }        fdm = pim[1];        close(pim[0]);        free(in_address);        return(pid);}/*  * Deliver an email to an address * Return 0 on success * Return less than zero on failure *  * -1 = user is over quota * -2 and below are system failures * -3 mail is looping  */int deliver_mail(char *address, char *quota){ time_t tm; off_t file_count; long unsigned pid; int write_fd; int inject = 0;    /* check if the email is looping to this user */    if ( is_looping( address ) == 1 ) {        printf("message is looping %s\n", address );        return(-3);    }    /* This is a directory/Maildir location */    if ( *address == '/' ) {        /* if the user has a quota set */        if ( strncmp(quota, "NOQUOTA", 2) != 0 ) {            /* If the message is greater than 1000 bytes and             * the user is over thier quota, return it back             * to the sender. We allow messages less than 1000 bytes             * to go through. This is so system admins can send a             * user over quota message              */            if (user_over_quota(address, quota)==1 && message_size>1000 ) {                printf("user is over quota\n");                return(-1);            }        }        /* Format the email file name */        gethostname(hostname,sizeof(hostname));        pid=getpid();        time (&tm);        snprintf(local_file, 156, "%stmp/%lu.%lu.%s,S=%lu",            address,(long unsigned)tm,(long unsigned)pid,            hostname, (long unsigned)message_size);        snprintf(local_file_new, 156, "%snew/%lu.%lu.%s,S=%lu",            address,(long unsigned)tm,(long unsigned)pid,hostname, 		(long unsigned)message_size);        /* open the new email file */        if ((write_fd=open(local_file,O_CREAT|O_RDWR,S_IRUSR|S_IWUSR))== -1) {            printf("can not open new email file errno=%d file=%s\n",                 errno, local_file);            return(-2);        }        if ( strcmp( address, bounce) == 0 ) {            snprintf(DeliveredTo, AUTH_SIZE,                 "%s%s", getenv("RPLINE"), getenv("DTLINE"));        } else {            snprintf(DeliveredTo, AUTH_SIZE,                 "%sDelivered-To: %s\n", getenv("RPLINE"),                 maildir_to_email(address));        }    /* This is an command */    } else if ( *address == '|' ) { 	/* run the command */ 	run_command(address);	return(0);    /* must be an email address */    } else {       char *dtline;       char *tstr;	qmail_inject_open(address);	write_fd = fdm;        inject = 1;	/* use the DTLINE variable, but skip past the dash in          * domain-user@domain 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久久亚洲综合| 国产成人综合精品三级| 国产午夜精品久久久久久久| 日韩视频免费观看高清在线视频| 国产精品美女久久久久aⅴ| 欧美不卡一区二区| 精品国产精品网麻豆系列| 日韩一级免费观看| 日韩免费观看高清完整版在线观看| 欧美日韩国产乱码电影| 欧美日韩精品欧美日韩精品一| 欧美日韩一区二区在线观看视频| 欧美羞羞免费网站| 在线不卡欧美精品一区二区三区| 678五月天丁香亚洲综合网| 欧美一区二区在线不卡| 精品精品国产高清a毛片牛牛 | 欧美成人免费网站| 亚洲欧美影音先锋| 综合激情成人伊人| 亚洲一区在线视频观看| 喷白浆一区二区| 国产一区视频在线看| 成人av资源在线| 欧洲生活片亚洲生活在线观看| 欧美日韩在线直播| 久久综合国产精品| 一区二区三区美女视频| 久久精品国产77777蜜臀| 国产电影一区二区三区| 欧美专区日韩专区| 久久免费视频一区| 亚洲精品欧美二区三区中文字幕| 香蕉影视欧美成人| 丁香婷婷综合五月| 欧美一级一区二区| 亚洲天堂av一区| 久久av资源网| 色香蕉久久蜜桃| 久久久久久久网| 亚洲国产婷婷综合在线精品| 国产最新精品免费| 欧美日韩aaa| ㊣最新国产の精品bt伙计久久| 丝袜美腿成人在线| 97久久超碰国产精品电影| 欧美一区二区三区爱爱| 亚洲图片激情小说| 国产精品一区2区| 欧美一卡二卡三卡四卡| 亚洲欧美另类图片小说| 国产一区二区精品久久| 在线播放一区二区三区| 一区二区三区日韩| 成人一区二区在线观看| 精品久久久久久久久久久久包黑料 | 亚洲激情在线播放| 成人免费毛片app| 久久久久久一二三区| 日韩精品免费视频人成| 欧洲一区在线电影| 中文字幕在线不卡国产视频| 国产精品99久久久久久似苏梦涵| 欧美一级久久久| 水蜜桃久久夜色精品一区的特点| 91精品福利视频| 亚洲人成小说网站色在线| 国产jizzjizz一区二区| 久久在线免费观看| 国产自产2019最新不卡| 精品国产一二三| 久久精品72免费观看| 日韩视频在线永久播放| 免费av成人在线| 日韩欧美激情四射| 麻豆精品一区二区av白丝在线| 欧美老肥妇做.爰bbww| 婷婷开心激情综合| 欧美一区二区性放荡片| 六月婷婷色综合| 精品1区2区在线观看| 精品制服美女丁香| 久久精品在线免费观看| 国产91对白在线观看九色| 中文字幕免费不卡| 色偷偷88欧美精品久久久| 亚洲乱码国产乱码精品精的特点 | av不卡免费在线观看| 日本一区二区三区在线不卡 | 91国偷自产一区二区使用方法| |精品福利一区二区三区| 91视频你懂的| 一区二区高清视频在线观看| 色婷婷av一区二区三区软件 | 欧美一级爆毛片| 国产精品资源在线看| 中文字幕制服丝袜成人av| 色综合色综合色综合色综合色综合 | 国产一区视频网站| 国产精品电影院| 欧美日韩国产首页| 韩国一区二区三区| 一区精品在线播放| 91麻豆精品国产自产在线 | 精品久久久久久亚洲综合网 | 亚洲天堂精品视频| 日韩欧美中文字幕制服| 成人开心网精品视频| 亚洲成av人片www| 久久精品亚洲精品国产欧美kt∨ | 欧美日韩精品一区二区三区四区| 免费人成黄页网站在线一区二区| 国产欧美一区二区三区鸳鸯浴| 色视频一区二区| 国产美女一区二区| 亚洲午夜在线电影| 国产精品久久久久一区| 91精品婷婷国产综合久久性色| 粉嫩蜜臀av国产精品网站| 午夜久久电影网| 国产精品福利av| 精品久久久久久久久久久久久久久| 一本久久精品一区二区| 国产伦精品一区二区三区视频青涩| 一区二区国产视频| 中文字幕不卡在线播放| 制服丝袜亚洲网站| 在线视频欧美区| 成人免费视频播放| 国产在线精品一区二区夜色 | 精品中文字幕一区二区| 天天综合色天天综合| 亚洲精品成a人| 国产精品全国免费观看高清 | 欧美日韩激情一区二区三区| 成人app在线| 国产黑丝在线一区二区三区| 美女一区二区视频| 亚洲不卡av一区二区三区| 亚洲欧美视频在线观看视频| 国产欧美一区二区精品性色超碰| 日韩欧美你懂的| 日韩久久久精品| 欧美一区二区免费观在线| 欧美精三区欧美精三区| 欧美午夜在线一二页| 欧美亚洲综合另类| 91九色最新地址| 色欧美片视频在线观看| 国产福利一区二区三区| 亚洲一区在线播放| 亚洲综合自拍偷拍| 一区二区三区四区在线免费观看 | 精品一区二区在线视频| 日韩av一二三| 美脚の诱脚舐め脚责91| 麻豆成人91精品二区三区| 日韩国产精品91| 男人的天堂亚洲一区| 蜜桃视频免费观看一区| 久久99国产精品久久| 国内精品国产成人| 国产成人免费视频网站| 成人激情黄色小说| 91丝袜高跟美女视频| 欧美影视一区二区三区| 7777精品伊人久久久大香线蕉经典版下载| 91在线码无精品| 欧美精品乱码久久久久久按摩 | 高清国产一区二区| 91免费观看视频| 欧美人xxxx| 久久只精品国产| 日韩伦理av电影| 三级久久三级久久| 国产乱码精品一区二区三区忘忧草| 国产成人精品免费| 欧美综合久久久| 26uuu亚洲综合色| 综合网在线视频| 丝瓜av网站精品一区二区| 国产精品综合视频| 在线欧美日韩国产| 2017欧美狠狠色| 一区二区三区久久久| 久久国产福利国产秒拍| jiyouzz国产精品久久| 日韩亚洲国产中文字幕欧美| 国产喷白浆一区二区三区| 一区二区三区中文免费| 精品一区二区三区香蕉蜜桃| 99亚偷拍自图区亚洲| 欧美一激情一区二区三区| 亚洲欧美一区二区在线观看| 麻豆91精品91久久久的内涵| 99视频国产精品| 欧美精品一区二区在线播放 | 日韩一区二区免费高清| 一区在线播放视频| 国产一区二区三区四区五区入口|