LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-05-2019, 04:13 PM   #1
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Rep: Reputation: 28
procmail: not sorting properly and cannot write to file


Running 14.2/x86_64 and using mbox mail storage format. On this new desktop procmail is no longer sorting some incoming messages to the proper folder despite having multiple recipes in ~/.procmailrc. And for some folders the log shows an error writing to it despite all files in ~/mail/ having 666 permissions.

Here's an example for one mail list and what the log shows:
~/.procmailrc
[code]
:0:
* \[GRASS-user\]
spatial-analyses

:0:
* ^List-Id:.*<grass-user\.lists\.osgeo\.org>
spatial-analyses

:0:
* ^(From|Cc|To).*osgeo\.org
spatial-analyses
[\code]

~/procmail/log:
[code]
procmail: Match on "\[GRASS-user\]"
procmail: Locking "spatial-analyses.lock"
procmail: Assigning "LASTFOLDER=spatial-analyses"
procmail: Opening "spatial-analyses"
procmail: Acquiring kernel-lock
procmail: Error while writing to "spatial-analyses"
procmail: Truncated file to former size
[\code]

The file's permissions:
-rw-rw-rw- 1 rshepard users 54142630 Nov 5 14:03 spatial-analyses

As I don't know what other information to provide I'll wait for someone to ask for more.

I want to resolve these issues as soon as possible

Regards,

Rich
 
Old 11-06-2019, 06:22 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
Originally Posted by rshepard View Post
Running 14.2/x86_64 and using mbox mail storage format. On this new desktop procmail is no longer sorting some incoming messages to the proper folder despite having multiple recipes in ~/.procmailrc. And for some folders the log shows an error writing to it despite all files in ~/mail/ having 666 permissions.

Here's an example for one mail list and what the log shows:
~/.procmailrc
[code]
:0:
* \[GRASS-user\]
spatial-analyses

:0:
* ^List-Id:.*<grass-user\.lists\.osgeo\.org>
spatial-analyses

:0:
* ^(From|Cc|To).*osgeo\.org
spatial-analyses
[\code]

~/procmail/log:
[code]
procmail: Match on "\[GRASS-user\]"
procmail: Locking "spatial-analyses.lock"
procmail: Assigning "LASTFOLDER=spatial-analyses"
procmail: Opening "spatial-analyses"
procmail: Acquiring kernel-lock
procmail: Error while writing to "spatial-analyses"
procmail: Truncated file to former size
[\code]

The file's permissions:
-rw-rw-rw- 1 rshepard users 54142630 Nov 5 14:03 spatial-analyses

As I don't know what other information to provide I'll wait for someone to ask for more.

I want to resolve these issues as soon as possible

Regards,

Rich
Without other info, I guess you're running postfix as MTA.
If that's the case, take a look here to see what the problem is and what you can do

BTW, change the spatial-analyses file attributes to just 600 (rw-------) for security reasons.


Regards
 
1 members found this post helpful.
Old 11-06-2019, 01:18 PM   #3
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by bathory View Post
Without other info, I guess you're running postfix as MTA.
If that's the case, take a look here to see what the problem is and what you can do
Well! Yes, I've been using postfix for a couple of decades and never paid attention to the mailbox_size_limit. Sure enough, the messages that won't file properly were to mbox files > 49M.

Thank you very much.

Best regards,

Rich
 
Old 11-06-2019, 04:29 PM   #4
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
I changed mailbox_size_limit to about 9G and the permissions in ~/mail/ to 600. Then I stopped and restarted postfix-3.4.7-x86_64-1. But, all mail list messages are now being placed in spatial-analyses. Here are the recipes in ~/.procmailrc:

# Catch SPAM
:0
* ^X-Spam-Flag: YES
* ^X-Spam-Level: \*\*\*\*\*\*
/dev/null

## Call SpamAssassin
:0fw: spamassassin.lock
* < 256000
| spamassassin

## Flagged as SPAM by spamassassin?
:0
* ^X-Spam-Status: Yes
/dev/null

:0:
* ^Subject: *****SPAM*****
/dev/null

:0:
* ^(To|Cc).*twodogs.us
personal

:0:
* ^TO_.*appl-ecosys.com
$DEFAULT

:0:
* \[GRASS-user\]
spatial-analyses

:0:
* ^List-Id:.*<grass-user\.lists\.osgeo\.org>
spatial-analyses

:0:
* ^(From|Cc|To).*osgeo\.org
spatial-analyses

:0:
* ^(From|Cc|To).*postgresql\.org
database

:0:
* ^(From|Cc|To).*gnucash\.org
accounting

:0:
* ^(From|Cc|To).*jpilot\.org
pda-jpilot

:0:
* ^(From|Cc|To).*lists\.lyx\.org
typesetting

:0:
* ^List-ID:.*<plug.*\.pdxlinux\.org>
* ^(From|Cc|To).*pdxlinux\.org
PLUG

:0:
* ^(From|Cc|To).*tug\.org
typesetting

:0:
* ^List-Id:.*<python-list\.python\.org>
programming

:0:
* \[sqlalchemy\]
programming

:0:
* ^(From|Cc|To).*sqlite\.org
database

:0:
* \[R\]
stats

:0:
* ^(From|Cc|To).*r-project\.org
stats

:0:
* \[R-sig-Geo\]
stats

:0:
* \[Slackbuilds-users\]
slackware

:0:
* ^(From|Cc|To).*slackbuilds\.org
slackware

:0:
* \[slackware\]
slackware

:0:
* ^(From|Cc|To).*mailman\.lug\.org\.uk
slackware

:0:
* ^(From|Cc|To).*@slackware\.com
slackware

:0:
* ^(From|Cc|To).*cups\.org
office

:0:
* \[taskjuggler-users\]
office

:0:
* postfix-users
mailhelp

:0:
* ^(From|Cc|To).*postfix\.org
mailhelp

:0:
* ^(From|Cc|To).*cloud9\.net
mailhelp

Despite my reading the man page and procmail configuration web pages I must still not have the recipes correctly written. I want to learn how to do them correctly.
 
Old 11-07-2019, 03:51 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
But, all mail list messages are now being placed in spatial-analyses. Here are the recipes in ~/.procmailrc:
Enable logging and see what happens with your recipes.
To do so, add in top of .procmailrc the following:
Code:
SHELL=/bin/sh
VERBOSE=on
LOGFILE=/tmp/procmail.log
 
1 members found this post helpful.
Old 11-08-2019, 10:59 AM   #6
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Quote:
Originally Posted by bathory View Post
Enable logging and see what happens with your recipes.
I've been following the log and do not see where the errors occur. Here's one example from today:
[CODE]
From r-help-bounces@r-project.org Fri Nov 8 08:38:42 2019
Subject: Re: [R]
Folder: programming 13895
procmail: [5911] Fri Nov 8 08:48:20 2019
procmail: Assigning "LOGABSTRACT=all"
procmail: Assigning "MAILDIR=/home/rshepard/mail"
procmail: Assigning "DEFAULT=/var/spool/mail/rshepard"
procmail: Assigning "ORGMAIL=/var/spool/mail/rshepard"
procmail: Assigning "LOGFILE=/home/rshepard/procmail/log"
procmail: Opening "/home/rshepard/procmail/log"
procmail: Assigning "COMSAT=no"
procmail: Assigning "COMSAT=no"
procmail: No match on "^X-Spam-Flag: YES"
procmail: Match on "< 256000"
procmail: Locking "spamassassin.lock"
procmail: Executing "spamassassin"
procmail: [5911] Fri Nov 8 08:48:21 2019
procmail: Unlocking "spamassassin.lock"
procmail: No match on "^X-Spam-Status: Yes"
procmail: No match on "^Subject: *****SPAM*****"
procmail: No match on "^(To|Cc).*twodogs.us"
procmail: No match on "(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To).*[^-a-zA-Z0-9_.])?).*appl-ecosys.com"
procmail: No match on "^(From|Cc|To).*postgresql\.org"
procmail: No match on "^(From|Cc|To).*gnucash\.org"
procmail: No match on "^(From|Cc|To).*jpilot\.org"
procmail: No match on "^(From|Cc|To).*lists\.lyx\.org"
procmail: No match on "^List-ID:.*<plug.*\.pdxlinux\.org>"
procmail: No match on "^(From|Cc|To).*tug\.org"
procmail: No match on "^List-Id:.*<python-list\.python\.org>"
procmail: Match on "\[sqlalchemy\]"
procmail: Locking "programming.lock"
procmail: Assigning "LASTFOLDER=programming"
procmail: Opening "programming"
procmail: Acquiring kernel-lock
procmail: Unlocking "programming.lock"
[\CODE]

The maibox_size_limit is huge so that's no longer the reason messages were mis-sorted.

How procmailrc finds a match on sqlalchemy from r-help-bounces escapes me.

Thanks,

Rich
 
Old 11-08-2019, 02:38 PM   #7
Richard Cranium
Senior Member
 
Registered: Apr 2009
Location: McKinney, Texas
Distribution: Slackware64 15.0
Posts: 3,858

Rep: Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225Reputation: 2225
Are you certain that's properly escaped? Otherwise, it'll match on finding any of s, q, l, a, c, h, e, m, or y.
 
Old 11-09-2019, 01:59 AM   #8
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,167
Blog Entries: 1

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Quote:
The maibox_size_limit is huge so that's no longer the reason messages were mis-sorted.

How procmailrc finds a match on sqlalchemy from r-help-bounces escapes me.
The maibox_size_limit has nothing to do with messages being mis-sorted

I don't know either why procmail finds a match with "[sqlalchemy]". Perhaps that string exists in the mail headers.
You may put that recipe last in procmailrc and see what you get.
 
Old 11-09-2019, 08:27 AM   #9
rshepard
Member
 
Registered: Oct 2007
Location: Troutdale, Oregon
Distribution: Slackware
Posts: 435

Original Poster
Rep: Reputation: 28
Bathory/Richard:

I have it fixed now. First, mailbox_size_limit was an issue. The default is 45M and the three folders that were originally not correctly sorted were larger. That was fixed but multiple mis-filings still existed.

Second, I replaced the multiple regex match strings for mail lists by a single recipe and tweaked that until I found one that consistently worked correctly. For some it was ^(From|Cc|To). and for others it was ^List-ID:.*.

mbox-by-mbox they began sorting properly. This morning none were in the wrong folder.

My thanks to both of you.

Regards,

Rich
 
  


Reply

Tags
procmail, slackware 14.2/x86_64



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rapid Listing, alphabetically sorting, dir/files sorting in C ? Xeratul Programming 18 11-24-2014 10:13 AM
Linux bash script: sort command - not sorting properly lulwot Programming 3 04-19-2011 07:28 PM
Problem with mail delivery procmail>cyrus imap (using sendmail,procmail,cyrus,imap) bwana Linux - Software 2 03-24-2005 07:01 PM
procmail mail sorting FLOODS Linux - Networking 1 11-26-2004 09:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration