26 lines
402 B
Python
Executable file
26 lines
402 B
Python
Executable file
#!/usr/bin/python
|
|
from imaplib import IMAP4
|
|
|
|
conn = IMAP4('127.0.0.1', port=4567)
|
|
print("Connected")
|
|
|
|
conn.noop()
|
|
print("NOOP done")
|
|
|
|
conn.login("lx", "plop")
|
|
print("Logged in")
|
|
|
|
print("Testing APPEND (this uses continuation style)")
|
|
conn.append("INBOX", [], None,
|
|
b"""From: alex@adnab.me
|
|
To: lx@deuxfleurs.fr
|
|
Subject: Hello, world!
|
|
|
|
Test
|
|
.
|
|
""")
|
|
print("Append done")
|
|
|
|
conn.logout()
|
|
print("Logged out")
|