[srj@adnd.com: Re: [NBLUG/talk] Mail Removal]

Steve Johnson srj at adnd.com
Wed Apr 7 12:12:24 PDT 2004


Forsome reason this didnt seem to go through.. so I wanted to resend it so
you all didnt think I was violating peoples privacy.


----- Forwarded message from Steve Johnson <srj at adnd.com> -----

Date: Wed, 7 Apr 2004 11:31:58 -0700
From: Steve Johnson <srj at adnd.com>
To: "General NBLUG chatter about anything Linux, answers to questions, etc." <talk at nblug.org>
Subject: Re: [NBLUG/talk] Mail Removal
User-Agent: Mutt/1.2.5.1i
In-Reply-To: <Pine.BSO.4.53.0404071021150.23569 at darkstar.alembic.com>; from rjw at alembic.com on Wed, Apr 07, 2004 at 10:56:58AM -0700

Ok, I understand the ethics, but when you wrote a script the f*cked
up 1300+ emails boxes (corrupted them) sometimes you have to throw
ethics out the window. :)

Meanwhile, I wrote the script to take care of this, my please to nblug was
in hopes to no have to re-invent the wheel.

<background>
I wrote a script that locked the spools, attached the bulk announcement to
the bottom of hte users spool, then unlocked the box.. Well there wasa
typo in the header of the text I attached, so users couldnt pop their mail
off the server.   Sooo I have to screw ethics, and write a scrtip to
nuke that paticular message out of the spool.

Funny yhink is mutt didn't mind the farked up header.. imapd didnt
either.. just the pop3 daemon would choke on this.
</background>


On Wed, Apr 07, 2004 at 10:56:58AM -0700, Ron Wickersham wrote:
> On Wed, 7 Apr 2004, Steve Johnson wrote:
> 
> > We have an issue where an e-mail was sent out to about 1300 users, and I
> > need to remove them from their mail spools.  Not sure how I am going to do
> > this, does anyone by chance have a script or know of one that will
> > do this, maybe one where I can give it the subject and the from line and
> > it will go through and remove all e-mail under that criteria out
> > of every box in the mail spool? (/var/mail)  This is on a linux box.
> >
> >
> > Any help would be greatly appreciated.  Thanks.
> >
> > -Steve
> 
> <background>
> there is an ethic of system administrators that goes against digging into
> mail spools of users.  while root has the technical ability to accomplish
> what you ask, privacy concerns without a written policy otherwise make it
> a legal mine trap to do what you ask.   and there may be an impossibility
> to get rid of all the copies if some mailboxes are on other machines that
> are not in your control.  for a discussion of this topic see page 854
> "Boss's mistake #2" in the Green book "Linux Administration Handbook" by
> Evi Nemeth, et. al. (or if you have the previous red or purple editions
> which were titled "Unix System Administration Handbook").  there is some
> expectation that sending an e-mail is something like dropping a letter in
> a post office box...once it's in the box you can't ask a postal employee
> or even the Postmaster to get it back for you.
> </background>
> 
> but on to how to do what you want.  in the regular Unix mail format, all
> the messages in each person's inbox is concatenated into one file, which
> is stored as the user's name.
> 
> there is a blank line separating each message and following the blank line
> is the envelope line that starts with "From" with a space following the
> word From, so it's actually "From ".   (note that this is distinct from the
> message header from line which has a colon and has the form "From:").
> so you can use a regular expression to look for the "From " identifier
> and then look a few lines below for the "Subject:" line that has the
> offending mail's subject line.   then delete from the original "From "
> line to the next occurrence of the "From " identifier.  when you're
> finished there should still be a blank line between the preceeding message
> and the "From " line of the now next message.
> 
> -ron
> 
> --
> /~\  The ASCII Ribbon Campaign
> \ /    No HTML/RTF in email
>  X     No Word docs in email
> / \  Respect for open standards
> 
> 
> _______________________________________________
> talk mailing list
> talk at nblug.org
> http://nblug.org/cgi-bin/mailman/listinfo/talk

-- 
----
      "Knowing others is wisdom, knowing your self is Enlightenment."
                                                   -- Lao-Tzu

----- End forwarded message -----

-- 
----
      "Knowing others is wisdom, knowing your self is Enlightenment."
                                                   -- Lao-Tzu




More information about the talk mailing list