# Email Filtering

**URL:** https://community.linx.software/community/t/email-filtering/407
**Category:** How To
**Created:** [April 24, 2019, 10:26am UTC](https://community.linx.software/community/t/email-filtering/407 "2019-04-24T10:26:41Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ronan](https://community.linx.software/community/user_avatar/community.linx.software/ronan/32/433_2.png) [@ronan](https://community.linx.software/community/u/ronan)
#### Post date: [April 24, 2019, 10:26am UTC](https://community.linx.software/community/t/email-filtering/407/1 "2019-04-24T10:26:41Z")

</div>

The Linx _Email_ plugin contains two functions which are _ReadEmail_ and _SendEmail_ respectively. By using the _ReadEmail_ function, you are able to “poll” your target Mail Box and filter out the mail box items by making use of a number of filters that need to be configured by using Regular Expressions.

Before you begin you must configure your Linx Email plugins to connect to your desired email client, more instructions can be found [here](https://community.linx.software/t/email-plugin-configuration/406/2).

Once you have your _ReadEmail_ function connection properties configured and are working, you can start to add filters in the bottom section of the _ReadEmail_ properties.  
 ![image](https://community.linx.software/uploads/default/original/1X/0db0b989b233733dfc3473aa7dc5c7e86ee1c872.png)

What do each of these fields mean?

**Filter body -** Information to look for in the _body_ of the emails.

**Filter from -** Information to look for in the _from field_ of the emails (the display name of the sender’s address).

**Filter from address -** Information to look for in the _from address fields_ of the emails.

**Filter subject -** Information to look for in the _subject line_ of the emails.

**Filter to -** Information to look for in the _to field_ of the emails.

**Filter option:**

- **And:** Use the above combination of filters and bind them with an AND operator, meaning all the conditions set must be true for the filter to succeed
- **Or:** Return mail items that match any one of the configured filters.

Due to there being a varying number of ways filters can be effective, Linx has taken the position not to limit the filtering with internal rules but rather make use of Regular Expressions. There are a number of “flavours” of regular expressions that can be used to filter the information that you want. In the below section are commonly used expressions that can assist you in retrieving your desired emails.

Regular Expressions:

**Filter body**

- Find emails containing either of two words (Replace the values enclosed with # with your words to search for): "\b(?:" +#MyFirstWord# + "|" + #MySecondWord# + ")[\b](file://b)"
- Using Linx types:  
 ![image](https://community.linx.software/uploads/default/original/1X/829e3acdfa919c2807d42282aa90de209adb8865.png)

**Filter from address**

- Find emails that have been sent from particular domains i.e. @domainname.com: \[1\][+@(?:(?:[a-zA-Z0-9-]+.)?[a-zA-Z]+.)?(#domainname1#|#domainname2#).com$](mailto:+@(?:(?:[a-zA-Z0-9-]+.)?%5ba-zA-Z%5d+.)?(#domainname1#|#domainname2)
- Using Linx Outputs:  
 ![image](https://community.linx.software/uploads/default/original/1X/5cde674934bcf51835b06cb26ce0e75eee67fcd2.png)

Emails from a certain person (company):

- Find email from “Weatherspoon Inc” = \bWeatherspoon\sInc\b

There numerous ways in which to create regex expressions but the above just demonstrates how to use the most basic ones in terms of Linx and filtering. More RegEx tutorials can be found [here](https://regexone.com/).

* * *

1. a-zA-Z0-9\_.±
