I gang

Script for fetching mails

I need a script that connects to mail servers via POP3, POP3s, IMAP or IMAPs and fetches emails without deleting them. The script shall check for each mail if a pattern can be found within the mail body defined by the mail subject. If not an error shall be written to a logfile. If one error occurs during a fetch the status is BAD, otherwise OK.

The script shall take the following arguments: [url removed, login to view] [url removed, login to view] [url removed, login to view] [url removed, login to view]

[url removed, login to view]:

<mailserver>

<ID>MAILSERVER-POP3-PLAIN</ID> # Any (String)

<PROTOCOL>POP3</PROTOCOL> # POP3 or IMAP

<SSL>NO</SSL> # YES OR NO

<HOST>[url removed, login to view]</HOST> # FQDN or IP

<PORT>110</PORT> # PORT (INT)

<USERNAME>TESTUSER</USERNAME> # Any (String)

<PASSWORD>TESTPASS</PASSWORD> # Any (String)

</mailserver>

[url removed, login to view]:

<tests>

<case>

<ID>CHECK ONE</ID> # Any (String)

<SUBJECT>Subject 123</SUBJECT> # Any (String), full match

<PATTERN>ABC</PATTERN> # Any (String), within mail body

</case>

<case>

<ID>CHECK TWO</ID> # Any (String)

<SUBJECT>Subject 456</SUBJECT> # Any (String), full match

<PATTERN>DEF</PATTERN> # Any (String), within mail body

</case>

</tests>

[url removed, login to view] (Format and possible cases):

YYYY-MM-DD HH:MM:SS MAILSERVER-ID TEST-CASE-ID OK # If pattern for subject can be found in body

YYYY-MM-DD HH:MM:SS MAILSERVER-ID TEST-CASE-ID ERROR # If pattern for subject can not be found in body

YYYY-MM-DD HH:MM:SS MAILSERVER-ID CONNECT-ERROR # Mailserver can not be reached

YYYY-MM-DD HH:MM:SS MAILSERVER-ID TIMEOUT # While fetching a mail an timeout occured

[url removed, login to view]

OK # BAD

The script can be in perl, php, python or bash.

The source code has to be very lean and well documented.

Please state in your private message which language you want to use and add a sample script of yours as reference.

The chosen service provider has to be able to issue a valid invoice (including local tax id OR vat code in case of a company). Additional projects to follow.

Best regards,

Sebastian

Færdigheder: Perl, PHP, Python, Shell Script, XML

Se mere: fetch imap, perl script fetching mails, xml use case, test cases python, string pattern match, string pattern, string match, provider pattern, pattern string, match string, c string pattern, c# provider pattern, c for int, abc company, abc 11, valid id, log for company, ABC, test case, take tests, ssl issue, service tax, python perl, Mailserver, mails

Om arbejdsgiveren:
( 53 bedømmelser ) Fentange, Germany

Projekt-ID: #935079