LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2014, 01:14 AM   #1
mikecolley
LQ Newbie
 
Registered: Apr 2014
Location: All Over USA
Distribution: Mint16 Cinnamon
Posts: 29

Rep: Reputation: Disabled
How can I get procmail to delay one users e-Mail 10 seconds?


Similar post (from another board)

Thank You all for LinuxQuestion.org. It is a wonderful resource and I have obtained many answers in the past here. Thank You.

I use procmail. I wrote my own spam filter in procmail (long with many many receipes).

I know this sounds counter-intuitive but I WANT TO INTENTIONALLY DELAY one (and only one) user's incoming e-Mail "larry@..." about 5 or 10 seconds. I want to do this so a dynamic spam filter procmail receipe can have time to get populated. I don't want any other users e-Mail delayed, only "larry".

I don't want procmail processing to stop or exit after the 10 second delay. I want larry's e-Mail to be delayed in the middle of the receipies then proceed through the rest of the procmail receipies after being delayed. I want the 10 second delay to happen in-line in the middle of the long list of procmail receipies. It is important that I don't stop or slow other user's e-Mails through the procmail filter, only "larry's". There may be several e-Mails proceeding through the filter at once (probably all spam) and I don't want to delay them because I use them to dynamically populate a receipe. I already have this dynamic receipe working well.

My procmail is on a shared hosting machine. This domain is a single userID (me) domain and I use multiple e-Mail addresses for myself. I admit I'm not sendmail smart, only kinda familiar with procmail.

How can I get procmail to delay one and only one users e-Mail?

I'm traveling later in the week to a new contract so after a couple of days when I leave I can't respond for a while but I will eventually check back. Thank You all for your help. - Mike
 
Old 11-12-2014, 06:05 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Prolly could look something like:
Code:
:0
* ^To:.*larry.*@@
{
        :0 f
        | sleep 10s

        :0
        doSomethingElse
}
YMMV(VM) as I didn't test it. See 'man procmailrc' for details?
 
Old 11-12-2014, 07:00 PM   #3
mikecolley
LQ Newbie
 
Registered: Apr 2014
Location: All Over USA
Distribution: Mint16 Cinnamon
Posts: 29

Original Poster
Rep: Reputation: Disabled
Hi unSpawn!

Thanks for the reply. I'm trying to figure how it works and I'm not being very successful at figuring it out. I admit to not being able to decypher the code. First I had to look up what the :0 f means and found it means "Treat the action line pipe as a filter". Now if sleep is a filter, I don't know how sleep would have any output and I need a bunch of other receipies to run after this is complete whether it is to larry or not.

I am running a trial on:

Code:
:0 w
* larry@....
* ? sleep 10
{ }
to see if it is successful. I won't know until tomorrow when the spammers wake up.

I'm having trouble understanding two places in your code, 1) why are the brackets needed and 2) how sleep can have an output so the rest of the receipies can be run.

Thanks! - Mike
 
Old 11-13-2014, 05:14 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
To understand procmail run this recipe as unprivileged user with full verbose / debug logging enabled on some test messages you pipe through it?
 
Old 11-14-2014, 01:19 AM   #5
mikecolley
LQ Newbie
 
Registered: Apr 2014
Location: All Over USA
Distribution: Mint16 Cinnamon
Posts: 29

Original Poster
Rep: Reputation: Disabled
Thanks unSpawn

OK, I should have thought of turning debug on for that set of recepies. I would have thought of doing that after a couple months. I will do that. Thanks unSpawn - Mike
 
Old 11-14-2014, 05:27 PM   #6
mikecolley
LQ Newbie
 
Registered: Apr 2014
Location: All Over USA
Distribution: Mint16 Cinnamon
Posts: 29

Original Poster
Rep: Reputation: Disabled
The four liner started with :0 w appears to be working just fine. Thank You All!
 
  


Reply

Tags
procmail


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Postfix / Procmail queue delay messinwu Linux - Server 4 05-30-2014 04:21 PM
rdate server with X seconds of delay theMountain Linux - Server 4 05-20-2014 10:25 AM
Mint 16 64bit and skype -> outgoing audio delay of 10 seconds Thane Linux Mint 1 02-13-2014 01:39 PM
audio delay in vlc for first 22 seconds raphtor Linux From Scratch 0 09-06-2008 10:41 PM
audio has a delay of around 1-2 seconds in games ludeKing Linux - Hardware 2 10-28-2003 08:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:26 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