<div dir="ltr">Hi! <div>Ok, I thought the scripts had run away... </div><div><br></div><div>But, hey thanks! </div></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><div>--</div>Lucas Tanure <br>+55 (19) 988176559<br>
</div></div>
<br><br><div class="gmail_quote">On Sat, May 3, 2014 at 9:27 AM, Greg Freemyer <span dir="ltr"><<a href="mailto:greg.freemyer@gmail.com" target="_blank">greg.freemyer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>Eudyptula apparently has at least one human in the loop. He/she may have taken a couple days off.<br><br><div class="gmail_quote"><div><div class="h5">On May 3, 2014 6:10:14 AM EDT, Lucas Tanure <<a href="mailto:tanure@linux.com" target="_blank">tanure@linux.com</a>> wrote:</div>
</div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
<div dir="ltr">Hi, <div><br></div><div>I sent my task two over two days ago and didn't receive the task 03.</div><div>I already sent 6 times the task 02 answer, but I got nothing instead. </div><div>I used mutt, and a python script.</div>
<div>The first time that I sent was two days ago. </div><div><br></div><div>Has Eudyptula Challenge died ? </div><div>Is down for a few days ?</div><div><br></div><div><br></div><div>Thanks a Lot. </div><div><div><br>
--</div>Lucas Tanure <br></div><div><br></div><div><br></div><div>The Python script</div><div><br></div><div><div>tanure@archNote email $ cat sender.py </div><div>#!/usr/bin/python3</div><div>from smtplib import SMTP</div>
<div>from itertools import chain</div><div>from errno import ECONNREFUSED</div><div>from mimetypes import guess_type</div><div>from subprocess import Popen, PIPE</div><div>from email.mime.base import MIMEBase</div><div>from email.mime.text import MIMEText</div>
<div>from socket import error as SocketError</div><div>from email.mime.multipart import MIMEMultipart</div><div>from os.path import abspath, basename, expanduser</div><div>import getpass</div><div><br></div><div># Define ID</div>
<div>id_eudyptula = '[404ba4c8fd16]'</div><div><br></div><div># Define email addresses to use</div><div>addr_to = '<a href="mailto:little@eudyptula-challenge.org" target="_blank">little@eudyptula-challenge.org</a>'</div>
<div>addr_from = '<a href="mailto:tanure@linux.com" target="_blank">tanure@linux.com</a>'</div><div><br></div><div># Define SMTP email server details</div><div>smtp_server = SMTP("<a href="http://smtp.gmail.com" target="_blank">smtp.gmail.com</a>",587)</div>
<div>smtp_user = '<a href="mailto:ltanure@gmail.com" target="_blank">ltanure@gmail.com</a>'</div><div>smtp_pass = getpass.getpass()</div><div><br></div><div><br></div><div>def get_mimetype(filename):</div><div>
content_type, encoding = guess_type(filename)</div>
<div> if content_type is None or encoding is not None:</div><div> content_type = "application/octet-stream"</div><div> return content_type.split("/", 1)</div><div><br></div><div><br></div>
<div>def mimify_file(filename):</div><div> filename = abspath(expanduser(filename))</div><div> basefilename = basename(filename)</div><div><br></div><div> msg = MIMEBase(*get_mimetype(filename))</div><div> msg.set_payload(open(filename, "r").read())</div>
<div> msg.add_header("Content-Disposition", "attachment", filename=basefilename)</div><div> #encode_base64(msg)</div><div> return msg</div><div><br></div><div><br></div><div>def send_email(subject, text, files):</div>
<div> # Prepare Message</div><div> msg = MIMEMultipart()</div><div> msg.preamble = subject</div><div> msg.add_header("From", addr_from)</div><div> msg.add_header("Subject", id_eudyptula + ' ' + subject)</div>
<div> msg.add_header("To",addr_to)</div><div><br></div><div> # Attach the main text</div><div> msg.attach(MIMEText(text))</div><div><br></div><div> # Attach any files</div><div> [msg.attach(mimify_file(filename)) for filename in files]</div>
<div><br></div><div> # Contact local SMTP server and send Message</div><div> try:</div><div> smtp_server.ehlo()</div><div> smtp_server.starttls()</div><div> smtp_server.ehlo()</div><div> smtp_server.login(smtp_user, smtp_pass)</div>
<div> smtp_server.sendmail(addr_from, addr_to, msg.as_string())</div><div> smtp_server.quit()</div><div> except SocketError as e:</div><div> print(e)</div><div><br></div><div><br></div><div>if __name__ == "__main__":</div>
<div> text = open('text','r').read()</div><div> send_email("Task 02 of the Eudyptula Challenge",text,['.config','dmesg'])</div></div><div><br></div><div><div><div dir="ltr">
<br><br></div></div>
</div></div>
<p style="margin-top:2.5em;margin-bottom:1em;border-bottom:1px solid #000"></p></div></div><pre><hr><br>Kernelnewbies mailing list<br><a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><span class="HOEnZb"><font color="#888888"><br></font></span></pre>
</blockquote>
</div><span class="HOEnZb"><font color="#888888"><br>
-- <br>
Sent from my Android phone with K-9 Mail. Please excuse my brevity.</font></span></div></blockquote></div><br></div>