Could you please tell me what you think of this ? --- vdelivermail.c 2004-03-09 13:38:24.000000000 +0100 +++ vdelivermail.c.new 2004-03-09 13:38:23.000000000 +0100 @@ -89,6 +89,7 @@ void usernotfound(void); int is_loop_match( char *dt, char *address); int deliver_quota_warning(const char *dir, const char *q); +char *get_from(char *fromline);
static char local_file[156]; static char local_file_new[156]; @@ -447,6 +448,17 @@ /* This is a comment, ignore it */ if ( *address == '#' ) return(0); + /* If the sender address is the same as the email, we do not deliver */ + while(fgets(loop_buf, sizeof(loop_buf), stdin) != NULL) { + if (strncmp(loop_buf, "From: ", 6) == 0 && *address == '&') { + char *from; + from = get_from(loop_buf); + if(strncmp(from, ++address, strlen(from) - 1) == 0) { + return(0); + } + } + } + /* check if the email is looping to this user */ if ( is_looping( address ) == 1 ) { printf("message is looping %s\n", address ); @@ -1270,6 +1282,17 @@ return(0); } + +char *get_from( char *fromline) +{ + while(*fromline != '@' && *fromline != 0) ++fromline; + if(*fromline == 0) + return fromline; + while ( *fromline != '<' && *fromline != ' ') --fromline; + ++fromline; + return fromline; +} + int is_loop_match( char *dt, char *address) { char *startdt; > This has already been answered. There is _no_ way to achieve this > without you hacking away, or paying someone else to hack away at > the code to add this sort of functionality. As for the mailing list, > im not sure if there is a echo off type function that the customer > can use to not receive their own posts back from the server. > > Shane