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 7964497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T05:54:19+00:00 2026-06-04T05:54:19+00:00

On the shared-host where my website is, I have an e-mail forwarder that sends

  • 0

On the shared-host where my website is, I have an e-mail forwarder that sends messages to my phone as a text message. Recently, however, it’s been getting a bit out of hand.

I am hoping that, using the “User Level Filtering” in cPanel, I can setup a RegEx-based filter to only forward e-mails to my phone between the hours of 07:00:00 and 22:00:00.

This filter would match the following e-mail header, which typically occurs 2-3 lines into the message source:

Received: by 99.99.99.99 with SMTP id XyXyXyXyXyXyXy;
        Tue, 15 May 2012 01:22:33

… and this is how I am hoping it’d work:

Received: by (ANY IP) with (ANYTHING) id (ANYTHING);
        (Sun|Mon|Tue|Wed|Thu|Fri|Sat), (ANY DATE/MONTH/YEAR) (RegEx magic to match time?)

When the match succeeds (e.g. If the time is between 07:00:00 and 22:00:00) the message would then be sent to my phone, otherwise it would do nothing. (This has nothing to do with the RegEx itself, of course.)

I’m quite a Regular Expressions n00b, but have devised the following (non-working) RegEx, and have no idea how close or far away I am from it working:

\bReceived: by (.*) with [a-Z] id (.*)(Sun|Mon|Tue|Weds|Thu|Fri|Sat),(.*)[0-2][2-7]:[0-2][0-9]:[0-2][0-9]\bsi

Any thoughts, suggestions or creative solutions? I have been told by my hosting service that RegEx in cPanel needs to be in PERL format.

  • 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-04T05:54:20+00:00Added an answer on June 4, 2026 at 5:54 am

    Amended version of Eugene’s regex;

    /\bReceived: by .*?;\s*(?:Sun|Mon|Tue|Weds|Thu|Fri|Sat),\s*\d+\s+\w+\s+\d+\s+(?:0[789]|1\d|2[01]):\d\d:\d\d\b/
    

    This version uses non-capturing grouping, and restricts the acceptable time to 07:00:00 to 21:59:59. It assumes the time format is valid – in theory it would pass a time of 10:99:99, but I’m assuming you won’t see those.

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

Sidebar

Related Questions

I have a Joomla 1.0 website running on a shared host which I don't
I have recently deployed an app to a shared host (webfaction), and for no
If I have a website hosted on a shared server (e.g. Just Host), but
I have a personal website with a MediaWiki installation on a shared host. The
I have a site that dynamically loads website contents based on domain host name,
I have a script on a shared host that uses suPHP. I need unbuffered
I have access to a shared web host. The website installed there uses exec()
I have a Drupal site built on a shared host and I'm finding that
I plan to move a site from a shared host to AWS. For that
I have a Drupal site on a shared web host, and it's getting 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.