FreeBSD Bugzilla – Attachment 100637 Details for
Bug 139962
[Patch] mail/vpopmail: fix maildir++ quota with spamassassin
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
vpopmail.diff
vpopmail.diff (text/plain), 4.15 KB, created by
Alex Dupre
on 2009-10-25 16:00:08 UTC
(
hide
)
Description:
vpopmail.diff
Filename:
MIME Type:
Creator:
Alex Dupre
Created:
2009-10-25 16:00:08 UTC
Size:
4.15 KB
patch
obsolete
>Index: files/patch-vdelivermail.c >=================================================================== >RCS file: /home/pcvs/ports/mail/vpopmail/files/patch-vdelivermail.c,v >retrieving revision 1.11 >diff -u -r1.11 patch-vdelivermail.c >--- files/patch-vdelivermail.c 16 Mar 2009 13:51:23 -0000 1.11 >+++ files/patch-vdelivermail.c 25 Oct 2009 09:51:41 -0000 >@@ -1,8 +1,5 @@ >-Add SpamAssassin support. >-Drop the unneeded MAX_ENV_BUFF definition. >- >---- a/vdelivermail.c >-+++ b/vdelivermail.c >+--- vdelivermail.c.orig 2007-11-18 06:15:19.000000000 +0100 >++++ vdelivermail.c 2009-10-25 10:44:40.000000000 +0100 > @@ -74,6 +74,7 @@ > int is_spam(); > #endif >@@ -70,8 +67,23 @@ > return 0; > } > >-@@ -495,6 +513,11 @@ >+@@ -481,8 +499,8 @@ >+ int deliver_to_maildir ( >+ const char *maildir, >+ const char *extra_headers, >+- int read_fd, >+- ssize_t msgsize) >++ int read_fd >++ ) >+ { >+ #ifdef HOST_NAME_MAX >+ char hostname[HOST_NAME_MAX]; >+@@ -493,21 +511,25 @@ >+ char local_file_tmp[FILE_SIZE]; >+ char local_file_new[FILE_SIZE]; > size_t headerlen; >++ struct stat sb; >++ size_t msgsize; > int write_fd; > char quota[80]; > +#ifdef SPAM_JUNKFOLDER >@@ -81,10 +93,40 @@ > +#endif > > headerlen = strlen (extra_headers); >- msgsize += headerlen; >-@@ -557,6 +580,24 @@ >+- msgsize += headerlen; >+ >+ /* Format the email file name */ >+ /* we get the whole hostname, even though we only use 32 chars of it */ >+ gethostname(hostname, sizeof(hostname)); >+ pid = (long unsigned) getpid(); >+ tm = (long unsigned) time((time_t *) NULL); >+- snprintf(local_file_tmp, sizeof(local_file_tmp), "%stmp/%lu.%lu.%.32s,S=%lu", >+- maildir, tm, pid, hostname, (long unsigned) msgsize); >+- snprintf(local_file_new, sizeof(local_file_new), "%snew/%lu.%lu.%.32s,S=%lu", >+- maildir, tm, pid, hostname, (long unsigned) msgsize); >++ snprintf(local_file_tmp, sizeof(local_file_tmp), "%stmp/%lu.%lu.%.32s", >++ maildir, tm, pid, hostname); >+ >+ read_quota_from_maildir (maildir, quota, sizeof(quota)); >+ >+@@ -548,6 +570,9 @@ >+ #endif >+ close (write_fd) == 0 ) { >+ >++ if (stat(local_file_tmp, &sb) == -1) >++ DeleteMail = 1; >++ >+ if(DeleteMail == 1) { >+ if (unlink(local_file_tmp) != 0) { >+ printf("unlink failed %s errno = %d\n", local_file_tmp, errno); >+@@ -556,7 +581,29 @@ >+ return(0); > } > >++ msgsize = sb.st_size; >++ snprintf(local_file_new, sizeof(local_file_new), "%snew/%lu.%lu.%.32s,S=%lu", >++ maildir, tm, pid, hostname, (long unsigned) msgsize); >++ > /* if this succeeds link the file to the new directory */ > +#ifdef SPAM_JUNKFOLDER > + if (MoveMail == 1) { >@@ -107,7 +149,7 @@ > if ( link( local_file_tmp, local_file_new ) == 0 ) { > /* file was successfully delivered, remove temp file */ > if ( unlink(local_file_tmp) != 0 ) { >-@@ -616,6 +657,9 @@ >+@@ -616,6 +663,9 @@ > /* rewind the message */ > lseek(0,0L,SEEK_SET); > >@@ -117,7 +159,16 @@ > /* This is an command */ > if ( *address == '|' ) { > >-@@ -895,9 +939,6 @@ >+@@ -723,7 +773,7 @@ >+ email); >+ } >+ >+- switch (deliver_to_maildir (address, DeliveredTo, 0, message_size)) { >++ switch (deliver_to_maildir (address, DeliveredTo, 0)) { >+ case -1: >+ vexiterr (EXIT_OVERQUOTA, "user is over quota"); >+ break; >+@@ -895,9 +945,6 @@ > */ > void run_command(char *prog) > { >@@ -127,7 +178,16 @@ > int child; > char *(args[4]); > int wstat; >-@@ -1211,19 +1252,22 @@ >+@@ -1183,7 +1230,7 @@ >+ maildir_to_email(newdir), date_header()); >+ } >+ >+- err = deliver_to_maildir (dir, DeliveredTo, read_fd, sb.st_size); >++ err = deliver_to_maildir (dir, DeliveredTo, read_fd); >+ >+ close (read_fd); >+ >+@@ -1211,19 +1258,22 @@ > * * in the email headers for X-Spam-Level: which > * * we put in each spam email > * * >@@ -154,7 +214,7 @@ > > /* check for blank line, end of headers */ > for(k=j,found=0;k<i;++k) { >-@@ -1246,13 +1290,19 @@ >+@@ -1246,13 +1296,19 @@ > } > if ( found == 0 ) { > InHeaders=0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 139962
: 100637