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

  • Home
  • SEARCH
  • 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 8688867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:29:15+00:00 2026-06-12T23:29:15+00:00

I am really unsure as to where I should be posting this, but if

  • 0

I am really unsure as to where I should be posting this, but if this is the wrong place could someone direct me where to I could get an answer? I want to be able to send commands to my email address, and have the commands parsed and executed when the message is sent. I.e. I send an email and it contains this:

  public class sentThruEmail {
      public static void main(String[] args) {
          System.out.println("Hello");
      }
  }

I would want to configure my program to recognize when a new email comes from a sent address, to open it, compile it (in this case compile the java) and then execute it on the machine that the program is running on.
How can I go about figuring out how to do this? Any help would be wonderful, thanks!

EDIT: Or maybe the first step would be how to recognize an email was received from an address at all? In Java, how could I go about that: recognizing that an email was received and outputting something to the screen to alert the fact.

  • 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-12T23:29:16+00:00Added an answer on June 12, 2026 at 11:29 pm

    There are several parts of this to consider:

    Security

    As others mention, there are security risks to consider, here. If that worries you (and it should!), you may want to consider some of the following:

    • Digitally signing these “command” emails, and verifying that signature before looking at the email
      • PGP is a popular choice for this
    • Running your program (which reads the emails) in a “sandbox” environment, such as being chroot‘ed or in a jail
    • Only run a very limited set of commands – perhaps just ones you invent.

    Getting Mail

    If you still want to do this, given the security issues, you will need your program to read mail.

    You probably want to use IMAP for this, or POP.

    Parsing

    Once you have the mail, you need to parse the contents.
    You could just compile it directly if you are only sending code.
    You could also send the code as an attachment with a certain MIME type to identify it. That way you could still send a ‘normal’ email (perhaps with commentary about what this code is for), but your program would be able to cleanly separate out the code.

    Responding

    How will you communicate results back? Or do you care?

    You may want to send a reply email (use SMTP), or update a webpage. A webpage is nice since if you are running the web server locally, you can just write a file directly.

    Examples

    • The standard “confirmation email” system has a lot of similarity to what you describe. Someone sends an email to an automated system, it reads it, does some processing, and replies. Search around for those systems and I’m sure you’ll get started.

    • I created the Exquisite Corpse Emailer project, which does much of what you describe (but in Perl). It only accepts a very small set of limited commands, but it listens to an email address on IMAP, parses the text, updates a database as a result, etc.

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

Sidebar

Related Questions

I'm doing some coursework for uni, I really should know this but I am
Really simple but just not getting it. I want to reference a view by
I'm doing my best to learn DDD, but I'm unsure about some really basic
I am posting this as I am unsure the exact technology and approach to
Really stupid question, sorry, but I can't find it on google (I'm sure it's
Really simple problem: I want to split a connection string into its keyword /
Really ripping my hair out on this one. I have a JAAS Authentication Provider
Really quick jQuery question... I have this function: $(document).ready(function() { $('a#show1').click(function() { $('.item1').toggle(1000); return
Really wish i was God, then I would understand what this means: The element
Really simple question: From within GWT I want to forward the user away from

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.