Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8975495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:53:50+00:00 2026-06-15T18:53:50+00:00

I have never used procmail before but I believe (from my R&D) that it

  • 0

I have never used procmail before but I believe (from my R&D) that it is likely my best choice to crack my riddle. Our system receives an email, out of which I need 3 values, which are:

  1. either a 4-digit or 5-digit integer from the SUBJECT line. (we will refer to as “N”)

  2. email alias from REPLY-TO line (we will refer to as “R”)

  3. determine the type of email it is, by which I mean to say a “case” or a “project”. (we will refer to as “T”) This value would be parsed out of the SUBJECT line.

If any one could help me with that recipe, I would be most appreciative.

The next thing I need to do is:

  1. send these 3 values to a Python script (can I do this directly from procmail? pipe? something else?)
  2. delete the email messages

I need to accept these emails from only 4 domain names, such as:

(@sjobeck.com|@cases.example.com|@messages.example.com|@bounces.example.com)

Last, is to pipe these 3 values in to the second script, and some advice as to the best syntax to do so. Any advice here is most appreciative. Would this be something like this:

this-recipe $N $T $R | second-script.py

Or exactly how would that look? Or is this not a procmail issue and a Python issue? (if it is, that’s fine, I’ll handle it over there.)

Thanks so much!

Jason

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:53:52+00:00Added an answer on June 15, 2026 at 6:53 pm

    Procmail can extract those values, or you can just pass the whole message to Python on stdin.

    Assuming you want the final digits and you require there to be 4 or 5, something like this:

    R=`formail -zxReply-to: | sed 's/.*<//;s/>.*//'`
    :0
    * ^From:.*@(helpicantfindgoogle\.com|searchengineshateme\.net|disabled\.org)\>
    * ^Subject:(.*[^0-9])?\/[0-9][0-9][0-9][0-9][0-9]?$
    | scriptname.py --reply-to "$R" --number "$MATCH"
    

    This illustrates two different techniques for extracting a header value; the Reply-To header is extracted by invoking formail (this will extract just the email terminus, as per your comment; if you mean something else by “alias” then please define it properly) while the trailing 4- or 5-number integer from the Subject is grabbed my matching it in the condition with the special operator \/.

    Update: Added an additional condition to only process email where the From: header indicates a sender in one of the domains helpicantfindgoogle.com, searchengineshateme.net, or disabled.org.

    As implied by the pipe action, your script will be able to read the triggering message on its standard input, but if you don’t need it, just don’t read standard input.

    If delivery is successful, Procmail will stop processing when this recipe finishes. Thus you should not need to explicitly discard a matching message. (If you want to keep going, use :0c instead of just :0.)

    As an efficiency tweak (if you receive a lot of email, and only a small fraction of it needs to be passed to this script, for example) you might want to refactor to only extract the Reply-To: when the conditions match.

    :0
    * ^From:.*@(helpicantfindgoogle.com|searchengineshateme\.net|disabled\.org)\>
    * ^Subject:(.*[^0-9])?\/[0-9][0-9][0-9][0-9][0-9]?$
    {
      R=`formail -zxReply-To: | sed 's/.*<//;s/>.*//'`
      :0
      | scriptname.py --reply-to "$R" --number "$MATCH"
    }
    

    The block (the stuff between { and }) will only be entered when both the conditions are met. The extraction of the number from the Subject: header into $MATCH works as before; if the From: condition matched and the Subject: condition matched, the extracted number will be in $MATCH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have never used CRON or anything like that, rails etc.. before, but I
I have never used Try-catch in my code before, but now I need to
Just trying to understand that - I have never used it before. How is
G'day, I have never really used excel formulas before but need to convert a
I frequently use the STL containers but have never used the STL algorithms that
I have never used CRON before but I want to use CRON in order
I've never used java from the terminal before, and I certainly have never coded
I have never used Informix before and I'm trying to write a query that
I have never used Heroku before, but our client wants us to use it.
I have never used a lightbox before, but recently started thinking about using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.