Jump to content
UBot Underground

Comparing a sender's domain with a list of allowed domains


Recommended Posts

Hi,

 

I'm having a bot that connects to predefined mailboxes, checks for unprocessed emails and if any, starts opening them one by one and replying to them. I'd like to insert a condition that would force my bot to reply only to emails that come from predefined domains. Other emails would be deleted.

 

The problem I'm facing is that I scrape sender's email (someone@domain.com), but don't know how to effectively extract only the domain name (domain.com). And then how to compare this domain name with the list of predefined domain names.

 

I'm sure this is really easy task to do and the only reason I'm stuck is that I lack some information/experience. Can anyone of you please share with me the direction I could take? I'd greatly appreciate it.

Link to post
Share on other sites

Use a replace applied to the text/list item/table cell where you store each scraped email, using this regex:   .*@

   and replace with $nothing.  You'll be left with only what you need/want.

  • Like 1
Link to post
Share on other sites

Use a replace applied to the text/list item/table cell where you store each scraped email, using this regex:   .*@

   and replace with $nothing.  You'll be left with only what you need/want.

 

thank you very much, it works like a charm! i knew it would be really easy :)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...