mailman/sendmail process /var/spool/mail content

Hi
We had an issue with the mailman server which is now back and running, mqueue is empty however /var/spool/mail contains many hundreds of files containing an email that was not posted during the period we had an issue. Is there way to process these with mailman?
Thanks

On 02/05/2016 07:15 AM, ssn@ebi.ac.uk wrote:
So during some period, the MTA was delivering list mail to mboxes in /var/spool/mail instead of to Mailman. Is that correct? That's a bit wierd, but in any case, what is the actual situation now? Are there a bunch of /var/spool/mail/<listname> files, each of which is a mbox with all the messages for that list, or are there a bunch of /var/spool/mail/<listname> maildir directories with individual message files.
It would be fairly easy to create a script to use Mailman's bin/inject command to post the messages or post them directly, but it would depend on how the messages are stored.
I will help with a script, but I would need to know how to find the messages.
Or if you could arrange to put the messages into some hierarchy like:
x/list1/list1message1 x/list1/list1message2 ... x/list2/list1message1 x/list2/list1message2 ...
you could then do something like
for list in ls x
; do
for msg in ls x/$list
; do
/path/to/mailman/bin/inject -l $list $list/$msg
done
done
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
It sounds to me like this is Sendmail's out queue. I don't use Sendmail so don't know how its queues are structured in the filesystem, but the OP makes it sound like many copies of *one* post ("an email").
What system user is listed as the owner of the files? What are the names of the files? Are they readable, related to the lists or other addresses? Or are they UUIDs or hashes or serial numbers?
Check the files for the presence of Mailman-specific headers (List-Post, List-Id, X-Been-There, X-Mailman-Version, etc). If any such header is present, Mailman has already processed the post. However, Mailman should never touch /var/spool/mail.
If it is Sendmail's doing, you would use Sendmail, not Mailman, to process the messages, and you wouldn't just do "sendmail -t < FILE". If it's Sendmail's normal queue, Sendmail has a command to retry (maybe "flush") the queue (although that should happen automatically). If it's some sort of last resort configuration to ensure delivery of the message SOMEWHERE, ANYWHERE, I have no idea.

On 02/05/2016 07:57 PM, Stephen J. Turnbull wrote:
I agree, it's not clear, but /var/spool/mail is normally the directory where MTAs deliver mail for local users absent aliasing to the contrary. I.e. incoming mail for local user 'mark' is added to the mbox at /var/spool/mail/mark or in some cases /var/spool/mail/mark/ might be a maildir with cur/, new/ and tmp/ subdirectories containing individual messages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
I agree, it's not clear,
Oh, I don't mean your interpretation is implausible. I just wanted to make sure my alternative was on the table because he mentioned "hundreds". If they really were all of one post, automatically sending them all could easily result in a loop back to Mailman and a major spam of the users, and possibly exceeding the host's capacity (no matter how you look at it this is very weird behvior for sendmail or Mailman unless the OP misreported the spool directory).

On 02/05/2016 07:15 AM, ssn@ebi.ac.uk wrote:
So during some period, the MTA was delivering list mail to mboxes in /var/spool/mail instead of to Mailman. Is that correct? That's a bit wierd, but in any case, what is the actual situation now? Are there a bunch of /var/spool/mail/<listname> files, each of which is a mbox with all the messages for that list, or are there a bunch of /var/spool/mail/<listname> maildir directories with individual message files.
It would be fairly easy to create a script to use Mailman's bin/inject command to post the messages or post them directly, but it would depend on how the messages are stored.
I will help with a script, but I would need to know how to find the messages.
Or if you could arrange to put the messages into some hierarchy like:
x/list1/list1message1 x/list1/list1message2 ... x/list2/list1message1 x/list2/list1message2 ...
you could then do something like
for list in ls x
; do
for msg in ls x/$list
; do
/path/to/mailman/bin/inject -l $list $list/$msg
done
done
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
It sounds to me like this is Sendmail's out queue. I don't use Sendmail so don't know how its queues are structured in the filesystem, but the OP makes it sound like many copies of *one* post ("an email").
What system user is listed as the owner of the files? What are the names of the files? Are they readable, related to the lists or other addresses? Or are they UUIDs or hashes or serial numbers?
Check the files for the presence of Mailman-specific headers (List-Post, List-Id, X-Been-There, X-Mailman-Version, etc). If any such header is present, Mailman has already processed the post. However, Mailman should never touch /var/spool/mail.
If it is Sendmail's doing, you would use Sendmail, not Mailman, to process the messages, and you wouldn't just do "sendmail -t < FILE". If it's Sendmail's normal queue, Sendmail has a command to retry (maybe "flush") the queue (although that should happen automatically). If it's some sort of last resort configuration to ensure delivery of the message SOMEWHERE, ANYWHERE, I have no idea.

On 02/05/2016 07:57 PM, Stephen J. Turnbull wrote:
I agree, it's not clear, but /var/spool/mail is normally the directory where MTAs deliver mail for local users absent aliasing to the contrary. I.e. incoming mail for local user 'mark' is added to the mbox at /var/spool/mail/mark or in some cases /var/spool/mail/mark/ might be a maildir with cur/, new/ and tmp/ subdirectories containing individual messages.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

Mark Sapiro writes:
I agree, it's not clear,
Oh, I don't mean your interpretation is implausible. I just wanted to make sure my alternative was on the table because he mentioned "hundreds". If they really were all of one post, automatically sending them all could easily result in a loop back to Mailman and a major spam of the users, and possibly exceeding the host's capacity (no matter how you look at it this is very weird behvior for sendmail or Mailman unless the OP misreported the spool directory).
participants (3)
-
Mark Sapiro
-
ssn@ebi.ac.uk
-
Stephen J. Turnbull