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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:01:50+00:00 2026-06-05T17:01:50+00:00

I am using imap_xxx to access emails for my website, we need to discard

  • 0

I am using imap_xxx to access emails for my website, we need to discard all emails which are system non-human generated like out of office, autoreply, mail-bounce, error etc. Need to write a code for the same in PHP.

Code pointer would be appreciated.

Thanks

  • 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-05T17:01:51+00:00Added an answer on June 5, 2026 at 5:01 pm

    A few regexes you could apply to the envelope sender (“Return-Path” header) to check for automated senders:

    "^owner-",
    "^request-",
    "-request@",
    "bounce.*@",
    "-confirm@",
    "-errors@",
    "^no[\-]?reply",
    "^donotreply",
    "^postmaster@",
    "^mailer[-_]daemon@",
    "^mailer@",
    "^listserv@",
    "^majordom[o]?@",
    "^mailman@",
    "^nobody@",
    "^bounce",
    "^www(-data)?@",
    "^mdaemon@",
    "^root@",
    "^webmaster@",
    "^news(letter)?@",
    "^administrator@", #role accounts, maybe you want these
    "^support@", 
    

    headers that indicate automated sender if they exist:

     "list-help",
     "list-unsubscribe", 
     "list-subscribe", 
     "list-owner", 
     "list-post", 
     "list-archive", 
     "list-id", 
     "mailing-List",
     "x-facebook-notify",
     "x-mailing-list",
     'x-cron-env',
     'x-autoresponse',
     'x-eBay-mailtracker'
    

    headers that indicate an automated sender if they match a certain regex:

    'x-spam-flag':'yes',
    'x-spam-status':'yes',
    'precedence':'(bulk|list|junk)',
    'x-precedence':'(bulk|list|junk)',
    'x-barracuda-spam-status':'yes',
    'x-dspam-result':'(spam|bl[ao]cklisted)',
    'X-Mailer':'^Mail$',
    'auto-submitted':'auto-replied',
    'X-Auto-Response-Suppress':'(AutoReply|OOF)',
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get emails from Microsoft Exchange server using EWSJ API which
I'm trying to fetch all mail headers from an inbox using imap_headers($imap_resource) which returns
When using IMAP clients to access your email, the Inbox and any other user-created
In my rails application I have a rake task that reads emails using imap.
I am able to read emails in from Microsoft Exchange using an IMAP Client
I need to keep a link tracking for an email message. I am using
I'm using PHP-imap to read emails and there attachments from a IMAP Account. The
I'm looking for an API or library that gives me access to all features
I am using the imap library to access my unread messages on gmail and
The problem, transfer all emails including labels, sent, drafts... from one google apps account

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.