Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 May 2002 11:15:03 -0500
From:      "Jack L. Stone" <jackstone@sage-one.net>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Zapping Email Box
Message-ID:  <3.0.5.32.20020515111503.0301aa40@mail.sage-one.net>
In-Reply-To: <20020515155855.GP8958@dan.emsphone.com>
References:  <3.0.5.32.20020515094741.0118be50@mail.sage-one.net> <3.0.5.32.20020515094741.0118be50@mail.sage-one.net>

next in thread | previous in thread | raw e-mail | index | archive | help
At 10:58 AM 5.15.2002 -0500, Dan Nelson wrote:
>In the last episode (May 15), Jack L. Stone said:
>> Running FBSD-4.5 RELEASE with sendmail-8.11.6 and Qpopper
>> 
>> As part of a daily digest mailing at midnight, I have a cron job that
>> copies a mailbox contents to a work file, then a script strips out the
>> extra header "noise" and sends out the nice clean digest to its members. In
>> order to cut off the mail box at precisely midnight, I have been "zapping"
>> the email box to zero it out in order to start another day's collection of
>> emails right after midnight. I use this command to "zap" the email box:
>> #echo > mymailbox
>> 
>> What always worries me is that one of these times, the zap will be made at
>> a time when the box is "active" with mail throughput and I may break or
>> corrupt something. I know I could launch an email client to download the
>> box to empty it, but that adds another possible variable to break the
>> routine and not clean out the box timely.... the cron time is set at
>> exactly 23.59 so there is only that 1 minute to do the zapping or cleanout
>> of the box.
>
>So lock the mailbox while you're messing with it.  The procmail port
>provides a "lockfile" command that will dotlock any arbitrary file,
>with special flags for handling /var/mail/$USERNAME.  I use it in all
>my mail-archiving scripts.  In general, you should lock a mailbox any
>time you read or write to it.
>
>-- 
>	Dan Nelson
>	dnelson@allantgroup.com

Yes, you are right.... the "lock" is the answer, and lack of it is what
concerned me about my method..... but I don't use procmail..... I use Pine...

I could install procmail I suppose, but just for this one thing seems
overkill. Will the procmail launch by a cron launch... or other wise???

.... our website: http://www.sage-one.net/

Best regards,

Jack L. Stone
Server Admin

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3.0.5.32.20020515111503.0301aa40>