Develop a email connector for Ruby - Office365
Budget: $30 – $250 USD
Develop an email connector for monitoring in Ruby, which will be used on Linux systems (CentOS and Ubuntu) capable of being executed via command line.
The script must receive as parameters:
- subject - mandatory - string, containing a string that will be used to search the email box, this search must consider the subject, for example parameter: emails with subject starting with “Signature failure” (^Signature failure .* )
- seconds - mandatory - Relative time in seconds for the search, example: 3600 - retrieve and count emails from the last hour.
- origin - optional - string, if informed, performs the filter together with the subject parameter, example: emails with subject “Test signature” coming from specific email source teste_at_test.com.
- * parameters to connect to mail servers must be obtained via environment variable.
The script must return an integer with the number of occurrences found in the email based on the filters and relative time passed.
Example:
./monitoring-email.rb “^Subscription failed.*” 3600 teste_at_test.com
3
./monitoring-email.rb “^Subscription failure AWS ID xxx.*” 3600 teste_at_test.com
0
The script must have error handling in case of connectivity failure or incorrect parameters. Cases:
- Connectivity failure: Return integer 9999999
- Failed to parse regex: Return integer 9999998
- Parameters passed incorrectly or absence of mandatory parameter: Return formatted string informing how to use the script correctly and an example.
- Other errors: Return integer 9999997
The source of the messages will be an Office 365 email box.
The script must receive as parameters:
- subject - mandatory - string, containing a string that will be used to search the email box, this search must consider the subject, for example parameter: emails with subject starting with “Signature failure” (^Signature failure .* )
- seconds - mandatory - Relative time in seconds for the search, example: 3600 - retrieve and count emails from the last hour.
- origin - optional - string, if informed, performs the filter together with the subject parameter, example: emails with subject “Test signature” coming from specific email source teste_at_test.com.
- * parameters to connect to mail servers must be obtained via environment variable.
The script must return an integer with the number of occurrences found in the email based on the filters and relative time passed.
Example:
./monitoring-email.rb “^Subscription failed.*” 3600 teste_at_test.com
3
./monitoring-email.rb “^Subscription failure AWS ID xxx.*” 3600 teste_at_test.com
0
The script must have error handling in case of connectivity failure or incorrect parameters. Cases:
- Connectivity failure: Return integer 9999999
- Failed to parse regex: Return integer 9999998
- Parameters passed incorrectly or absence of mandatory parameter: Return formatted string informing how to use the script correctly and an example.
- Other errors: Return integer 9999997
The source of the messages will be an Office 365 email box.