Majordomo digests

toml

Verified User
Joined
Oct 3, 2003
Messages
1,267
Location
Scottsdale, AZ
I had a problem with a mailing list I ran, where the digests would get all messed up and it started creating a digest for every email, even if the digest size was well below the digest threshold. I figured out that the digest script was not deleting all the files in the working directory.

The reason the files weren't being deleted was because the file list was in the order that readdir put them in the array. readdir() does not guarantee that filenames are sorted by name. These changes sort that array so they will be removed in the proper order. The outer foreach loop stops processing when the current message equals the lastmessage received. If the lastmessage received happens to be the first file returned by readdir(), then it would only send that message and exit out of the outer loop and leave all the older messages in the digest staging directory.

If anyone else is having this problem you can use the attached digest.txt, it just needs to be named digest and replace the one in /etc/virtual/majordomo/. The diff looks like this(this also includes the REALLY-TO patch I posted a few years ago:

Code:
<barney:~/Download/majordomo-1.94.5>$diff digest digest.orig
176c176
<     foreach (sort(@files)) {
---
>     foreach (@files) {
295,301c295
<       foreach $file (@processed) {
<         if(unlink($file) != 0) {
<             print STDERR "Failed to unlink $file\n";
<           } else {
<             print STDERR "Removed the file $file\n";
<           }
<       }
---
>       unlink(@processed);
406c400
<               $V{'REALLY-TO'} = $ARGV[0]."@".${whereami};
---
>               $V{'REALLY-TO'} = $ARGV[0];
 

Attachments

Last edited:
Back
Top