LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-24-2022, 09:55 AM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Rep: Reputation: 179Reputation: 179
.procmailrc not working


I have the following rule in .procmailrc:
Code:
:0:
* ^From:.*@p.backcountry.com
* ^From:.*@emails.wyndhamhotels.com
* ^From:.*@thermoworks.com
* ^From:.*web@jbcovertlodge.com
* ^From:.*24hourwristbands.com
/user/mfoley/mbox.deleted
Email for these seems to keep getting through. For example, for info@p.backcountry.com the mail header is:
Code:
To: mfoley@novatec-inc.com
Date: Thu, 24 Mar 2022 11:46:41 +0000
Subject: Our Favorite Road Trip Gear
From: "Backcountry" <info@p.backcountry.com>
And procmailrc.log has:
Code:
procmail: [20302] Thu Mar 24 07:46:49 2022
procmail: Assigning "LASTFOLDER=/usr/sbin/sendmail -oi droid"
procmail: Unlocking ".lock"
procmail: Locking "/var/mail/mfoley.lock"
procmail: Assigning "LASTFOLDER=/var/mail/mfoley"   
procmail: Opening "/var/mail/mfoley"
procmail: Acquiring kernel-lock
procmail: Unlocking "/var/mail/mfoley.lock"
procmail: Notified comsat: "mfoley@279108431:/var/mail/mfoley"
From bounces+mfoley=novatec-inc.com@p.backcountry.com  Thu Mar 24 07:46:47 2022
 Subject: Our Favorite Road Trip Gear
  Folder: /var/mail/mfoley                                                36393
Normally in the procmailrc.log I see "Match on" or "No Match on" statements, but nothing like that for backcountry.com, and the messages continue to be delivered to my inbox, /var/mail/foley instead of /user/mfoley/mbox.deleted as specified in the rule.

I have 60 rules in my .procmailrc, most of which work fine. I don't know what I'm doing wrong on this one.

Last edited by mfoley; 03-24-2022 at 09:59 AM.
 
Old 03-24-2022, 11:51 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,170
Blog Entries: 1

Rep: Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038Reputation: 2038
Hi mfoley,

Quote:
I have the following rule in .procmailrc:

:0:
* ^From:.*@p.backcountry.com
* ^From:.*@emails.wyndhamhotels.com
* ^From:.*@thermoworks.com
* ^From:.*web@jbcovertlodge.com
* ^From:.*24hourwristbands.com
/user/mfoley/mbox.deleted
This is not going to happen because procmail uses logical AND to match conditions, so with the above notation all 5 "FROM:" conditions must be met.

You should use the a logical OR (symbol |) if you want your rule to be executed every time you get an email from one of these 5 email addresses:
Code:
:0:
* ^FROM:.*(p.backcountry.com|emails.wyndhamhotels.com|thermoworks.com|web@jbcovertlodge.com|24hourwristbands.com)
/user/mfoley/mbox.deleted

Regards
 
2 members found this post helpful.
Old 03-25-2022, 10:18 PM   #3
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,593

Original Poster
Rep: Reputation: 179Reputation: 179
bathory: Yup! That did it. In fact I do have other rules with "or" conditions, I guess I just forgot how. Not only that, but I asked this question some time ago: https://www.linuxquestions.org/quest...rc-4175609345/, but completely forgot it. If I had searched on "procmailrc or condition" that solution would have turned up. Duh!

Thanks!
 
  


Reply

Tags
procmailrc



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
[SOLVED] .procmailrc rule not working mfoley Linux - General 4 12-28-2020 04:40 PM
.procmailrc MAILDIR=$HOME/Maildir not working? paulclark Linux - Newbie 4 01-28-2009 07:56 AM
procmail not working, .procmailrc file not loading jcai Linux - Server 3 10-03-2008 11:59 AM
procmailrc rule for subject does NOT contain soylentgreen Linux - Server 2 06-05-2008 01:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 04:56 AM.

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