I have made a patch to put this file in the quota message. 

This patch holds another patch (To: field complete with the email 
address). 
To use this, you must patch vpopmail: 
patch -p0 -i file_holds_this_patch 

and then 
./configure (your configure options here) 
make 
 
you need only the vdelivermail install file, before install backup your 
original vdelivermail file 
from your vpopmail/bin dir

/usr/bin/install -c -s 
vdelivermail /dir_to_vpopmail/vpopmail/bin/vdelivermail 

and put the Date: field in quotawarn.msg file in your domain folder(s) 


i am not a c guru, but i do try my best :) 
i have tested it, works for me 

-----------------------------------------------------------------------------------------
diff -Naur vpopmail-5.2.1-orig/vdelivermail.c vpopmail-
5.2.1/vdelivermail.c
--- vpopmail-5.2.1-orig/vdelivermail.c  Sat May 18 08:25:50 2002
+++ vpopmail-5.2.1/vdelivermail.c       Sat Aug  2 11:27:48 2003
@@ -984,7 +984,10 @@
  */
 int deliver_quota_warning(const char *dir, const char *q)
 {
+ static char *montab[12] = 
{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec
"};
+ static char *daytab[7] = 
{"Sun","Mon","Tue","Wed","Thu","Fri","Sat"};
  time_t tm;
+ struct tm *gmt;
  long unsigned pid;
  long unsigned wrn_msg_sz;
  int write_fd, fdin, fd;
@@ -1022,8 +1025,8 @@

     strcat(strcpy(qname, dir), "/quotawarn");
     time(&tm);
-
-
+    gmt = localtime(&tm);
+
     /* Send only one warning every 24 hours */
     if (stat(qname, &sb) == 0 && ((sb.st_mtime + 86400) > tm))
     {
@@ -1087,6 +1090,10 @@
     /* read the quota message in chunks and write it to the new file */
     if((fs=fopen(quotawarnmsg, "ro")) != NULL) {
         while(fgets(buf, MSG_BUF_SIZE, fs)) {
+            if(strncmp(buf,"To:",3)==0)
+                sprintf(buf,"To: [EMAIL PROTECTED]",getenv("EXT"),getenv("HOST"));
+            if(strncmp(buf,"Date:",5)==0)
+                sprintf(buf,"Date: %3s, %2d %3s %04d %02d:%02d:%02d 
%c%02d%02d\n",daytab[gmt->tm_wday],gmt->tm_mday,montab[gmt-
>tm_mon],gmt->tm_year+1900,gmt->tm_hour,gmt->tm_min,gmt-
>tm_sec,(gmt->tm_gmtoff < 0) ? '-' : '+',abs(gmt->tm_gmtoff / 
3600),abs( (gmt->tm_gmtoff % 3600) / 60 ));
             if ( write(write_fd,buf,strlen(buf)) == -1 ) {
                 close(write_fd);

diff -Naur vpopmail-5.2.1-orig/quotawarn.msg vpopmail-
5.2.1/quotawarn.msg
--- vpopmail-5.2.1-orig/quotawarn.msg   Sun Jan 20 08:08:03 2002
+++ vpopmail-5.2.1/quotawarn.msg        Sat Aug  2 11:34:36 2003
@@ -4,6 +4,7 @@
 Reply-To: [EMAIL PROTECTED]
 To: Valued Customer:;
 Subject: Mail quota warning
+Date:
 Mime-Version: 1.0
 Content-Type: text/plain; charset=iso-8859-1
 Content-Transfer-Encoding: 7bit



Reply via email to