views:

53

answers:

0

Hi,

I'm working on an application that lets users interact with their account by sending emails to a specific address. The app is on GAE and I'm writing it in python. Here's my question:

When I receive an email from a user the sender field is text. I want to run a datastore query and match the userID to the sender's email address, but for some reason I can't match the string (sender) to the UserID in the datastore. Here's my code.

class MailHandler (InboundMailHandler):
  def receive(self, message):
    sender = message.sender
    user_account = db.GqlQuery("SELECT * FROM Task WHERE user = :1", sender).fetch(5)

This is returning None for the user account, despite the fact that the sender email address matches the user in the Task table. Any help would be appreciated.