mindfuq | 2 Oct 2005 07:10
Picon

Troubles switching from Sendmail to Postfix

When I switched from sendmail to postfix, all my inbound mail bypassed
my procmail scripts and was delivered to the system default
/var/mail/user.. 

The archives indicate that this tends to happen with quota issues, but
I don't believe I have a quota.  At least, there's no mention of a
quota setting in /etc/postfix/main.cf.

Is there anything special I must do to transition to postfix if I want
to deliver mail to procmail?
Patrick Shanahan | 2 Oct 2005 05:42
Picon

Re: Troubles switching from Sendmail to Postfix

* mindfuq <at> verizon.net <mindfuq <at> verizon.net> [10-01-05 22:37]:
> Is there anything special I must do to transition to postfix if I want
> to deliver mail to procmail?

in /etc/postfix/main.cf
  mailbox_command = /usr/bin/procmail
--

-- 
Patrick Shanahan                        Registered Linux User #207535
http://wahoo.no-ip.org                         <at>  http://counter.li.org
HOG # US1244711         Photo Album:  http://wahoo.no-ip.org/gallery2
mindfuq | 2 Oct 2005 23:25
Picon

Error while writing to <mbox file>

Is there an upper limit on how large of a file procmail will work
with?  Here is an excerpt of the log containing an error:

   procmail: Matched "mythtv-users"
   procmail: Match on "()\/[^\.]+"
   procmail: Executing "echo $MATCH | tr '[:upper:]' '[:lower:]'"
   procmail: Assigning "LISTNAME=mythtv-users"
   procmail: Executing " $SED -e "/^Subject:/ s/ *\[$LISTNAME\] */ /I""
   procmail: Locking "mailing_lists/mythtv-users_2005.lock"
   procmail: Assigning "LASTFOLDER=mailing_lists/mythtv-users_2005"
   procmail: Opening "mailing_lists/mythtv-users_2005"
   procmail: Acquiring kernel-lock
   procmail: Error while writing to "mailing_lists/mythtv-users_2005"
   procmail: Truncated file to former size
   procmail: Unlocking "mailing_lists/mythtv-users_2005.lock"

My scripts work fine otherwise.  I don't see anything special about
this mailbox file:

   # ls -l mythtv-users_2005

   -rw-------    148017102 Oct  2 14:06 mythtv-users_2005
Ruud H.G. van Tol | 2 Oct 2005 21:54
Picon

Re: Error while writing to <mbox file>

mindfuq <at> verizon.net:

> Is there an upper limit on how large of a file procmail will work
> with?

Maybe it's a time-out, the error is not specified in the log.

>    procmail: Opening "mailing_lists/mythtv-users_2005"

You could add the month to that, like mythtv-users_2005_07 for July, to
keep the file smaller. Or switch to maildir format.

--

-- 
Grtz, Ruud
Gary Funck | 3 Oct 2005 02:03

RE: Error while writing to <mbox file>


> -----Original Message-----
> From: mindfuq <at> verizon.net
> Sent: Sunday, October 02, 2005 2:25 PM
[...]
>    procmail: Assigning "LASTFOLDER=mailing_lists/mythtv-users_2005"
>    procmail: Opening "mailing_lists/mythtv-users_2005"
>    procmail: Acquiring kernel-lock
>    procmail: Error while writing to "mailing_lists/mythtv-users_2005"
>    procmail: Truncated file to former size
>    procmail: Unlocking "mailing_lists/mythtv-users_2005.lock"
>
> My scripts work fine otherwise.  I don't see anything special about
> this mailbox file:
>
>    # ls -l mythtv-users_2005
>
>    -rw-------    148017102 Oct  2 14:06 mythtv-users_2005

(We've got a user here with a 160Mb inbox, and he experiences
no problems with procmail delivery. Linux/FC4, fyi.)

You might want to check if you've exceeded some locally enforced
file quota.

My reading of the diagnostic above is not necessarily that the
file size was too large, but only that an error occurred while
writing to the mbox file, and the size was put back to the value
before the write was attempted.  Maybe an NFS/samba file system
that dropped out due to network or availability problem?  If you
(Continue reading)

mindfuq | 3 Oct 2005 05:27
Picon

Re: Error while writing to <mbox file>

* Gary Funck <gary <at> intrepid.com> [2005-10-02 22:14]:
> 
> You might want to check if you've exceeded some locally enforced
> file quota.

Delivery is fine for other inboxes; and in fact, it does successfully
deliver to mythtv_2005 *sometimes*.

> My reading of the diagnostic above is not necessarily that the
> file size was too large, but only that an error occurred while
> writing to the mbox file, and the size was put back to the value
> before the write was attempted.  Maybe an NFS/samba file system
> that dropped out due to network or availability problem?  If you
> have access to the system logs, that'd be worth a check.

The file is local.

> Man procmail says the following:
> 
>        Error while writing to "x"
>                               Nonexistent  subdirectory,  no write
> permission,
>                               pipe died or disk full.
> 
> (You might want to double check the ownership on that file.  Interesting,
> that 'ls -l' didn't display the userid/groupid in example from your mail
> message.)

I didn't think anyone would catch that.  I removed userid and group to
protect the innocent :)  I didn't think it was relevent.  It is the
(Continue reading)

tmueller | 3 Oct 2005 05:10

Re: Error while writing to <mbox file>

Excerpt from mindfuq <at> verizon.net:

> Based on Ruud's comment, my best guess at this point is that my
> machine is sluggish with operating on that large of a file, and might
> be causing some sort of timeout.  I will probably try to break it down
> further so it creates a new mythtv inbox every quarter of a year.  I
> might also look into whether procmail has a tunable parameter for
> timing out on OS tasks.

> What's interesting is that I've noticed that it's only failing half
> the time, so that could indicate timing.

I don't think you said how much RAM you have.  Maybe your computer with
procmail is clumsy with files on the order of 140 MB.  I want to make sure
I can read the file with elvis (an enhanced open-source vi clone), and I've
never read any text file beyond the order of 6 MB.  Reading through 6 MB is
smooth with elvis 2.1.4 or newer version in Linux, but navigating through a
text file beyond about 1.5 MB with the DOS port of elvis 2.1.4, running
under DR-DOS 7.03, becomes prohibitively slow and clumsy.  So I assume there
is some point at which reading through a file becomes clumsy and awkward in
the Unixes and quasi-Unixes, though I think the Unixes and quasi-Unixes are
much more efficient than DOS at using large amounts of RAM.  So really huge
files with procmail would make me very nervous.

Tom
Timothy Luoma | 3 Oct 2005 09:00

Re: Error while writing to <mbox file>


FWIW I run into errors if my procmail.log gets more than 49mb large.

I now rotate the procmail log daily, so it's no longer an issue.
tmueller | 3 Oct 2005 10:44

Re: Sorting an already existing mbox file, is it possible?

Thanks for the help (Holger Wahlen and Dallman Ross) , but

  formail -ns procmail -m recipe1.rc <mbox094elv

resulted in everything going to one file (mailsave/therest), just as before.
This mailsave/therest is my default file, so nothing more is written to
mbox094elv.

I looked through the man pages for procmail, procmailrc and procmailex many
times, noticed the "postprocess" part, but nothing worked right.  I even
found and browsed that QuickStart web page, and saved it, but still procmail
insisted on putting everything in one file, according to the Return-Path of
the first message, and prepended '>' to every subsequent line that began with
"From ", in mailsave/therest (mbox094elv was unmolested).  This happens
equally with procmail-3.15.2 and procmail-3.22.  I even tried

cat mbox094elv | formail -ns procmail -m recipe1.rc

formail -ns < mbox094elv procmail -m recipe1.rc

(formail -ns procmail -m recipe1.rc) <mbox094elv

but got the same result, everything into one file, mailsave/therest.

Tom
Ruud H.G. van Tol | 3 Oct 2005 12:18
Picon

Re: Sorting an already existing mbox file, is it possible?

tmueller <at> bluegrass.net schreef:

> prepended '>' to every subsequent line that began with "From "

My test84.rc has two lines:
----------------------------
  DEFAULT = '/dev/null'
  LOG     = "$$ "
----------------------------

Run it on your mbox:

  $ formail -s procmail -m test84.rc < mbox094elv

That should show a line with several PIDs, one PID per message in the
mbox.

If not, browse the mbox-file with 'less'. There should be an empty line
before each message header (before the "From " line). If not, see in
`man formail` the options -Y, -e, -d.

If the mbox-file was changed with a text-editor, maybe even on a
Windows-system, then the format of the mbox-file can be corrupted. That
is often easy to repair.

--

-- 
Grtz, Ruud

Gmane