RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
rapp_email.email_receiver.EmailReceiver Class Reference

Fetches emails from user's email account. More...

Inheritance diagram for rapp_email.email_receiver.EmailReceiver:
Collaboration diagram for rapp_email.email_receiver.EmailReceiver:

Public Member Functions

def __init__
 Constructor. More...
 
def receiveEmailSrvCallback
 The callback to receive specified mails from users email account. More...
 

Private Member Functions

def _connectImap
 Create an IMAP connection to the server. More...
 
def _fetchEmail
 Fetch specified email's data. More...
 
def _initializePath
 Create a temporary path for the user emails. More...
 
def _selectEmails
 Fetch the emails that match the requests criteria. More...
 

Detailed Description

Fetches emails from user's email account.

Definition at line 46 of file email_receiver.py.

Constructor & Destructor Documentation

def rapp_email.email_receiver.EmailReceiver.__init__ (   self)

Constructor.

Definition at line 49 of file email_receiver.py.

Member Function Documentation

def rapp_email.email_receiver.EmailReceiver._connectImap (   self,
  email,
  password,
  server,
  port 
)
private

Create an IMAP connection to the server.

Initiates an IMAP connection according to the user's email and logins to the server using user's credentials

Parameters
email[string] The user's email
password[string] The user's password
server[string] The email server
port[string] The email server's port
Returns
imap [imaplib::IMAP4_SSL] The connection

Definition at line 264 of file email_receiver.py.

def rapp_email.email_receiver.EmailReceiver._fetchEmail (   self,
  imap,
  emailID,
  receivePath,
  emailCounter 
)
private

Fetch specified email's data.

Parameters
imap[imaplib::IMAP4_SSL] The connection
emailID[int] The emails UID
receivePath[string] The absolute path where the contents of the email should be written.
emailCounter[int] The number of emails processed

return mailMsg [rapp_platform_ros_communications::MailMsg] The mail msg to be appended in the service response

Definition at line 113 of file email_receiver.py.

def rapp_email.email_receiver.EmailReceiver._initializePath (   self,
  email 
)
private

Create a temporary path for the user emails.

The path will be placed in ~/rapp_platform_files/emails/{username}{random_string}

Parameters
email[string] The rapp user's email

Definition at line 188 of file email_receiver.py.

def rapp_email.email_receiver.EmailReceiver._selectEmails (   self,
  req,
  imap 
)
private

Fetch the emails that match the requests criteria.

req [rapp_platform_ros_communications::Email::ReceiveEmailSrvRequest] The receive email request

Returns
emails [list<int>] The UIDs of the selected emails

imaplib.IMAP4.error General imaplib error

Definition at line 215 of file email_receiver.py.

def rapp_email.email_receiver.EmailReceiver.receiveEmailSrvCallback (   self,
  req 
)

The callback to receive specified mails from users email account.

req [rapp_platform_ros_communications::Email::ReceiveEmailSrvRequest] The receive email request

res [rapp_platform_ros_communications::Email::ReceiveEmailSrvResponse] The receive email response

Definition at line 59 of file email_receiver.py.


The documentation for this class was generated from the following file: