Sign inSign up

adite/tmail

By adite

•Updated almost 11 years ago

twisted mail (41M)

Image
0

508

adite/tmail repository overview

⁠adite/tmail


⁠twisted-mail for docker


tescom

SMTP/POP3

⁠IMAGE FROM

alpine

⁠DEFAULT ENVIRONMENT

  • MAIL_NAME : mydomain.com
  • MAIL_PATH : /tmp/mail
  • MAIL_USER : admin
  • MAIL_PASS : admin

⁠USAGE


⁠docker-compose.yaml
tmail:
  image: adite/tmail
  ports:
    - "25:25"
    - "110:110"
  volumes:
    - mail:/tmp/mail
  environment:
    - MAIL_NAME = mydomain.com
    - MAIL_PATH = /tmp/mail
    - MAIL_USER = admin
    - MAIL_PASS = admin
  restart: always
⁠You can pass additional arguments via environment variable MAIL_OPTS :
  MAIL_OPTS = --user = USER_NAME = USER_PASSWORD
⁠Server
$ sudo docker-compose up -d

⁠Client
  • POP3 : Mail_Domain:110
  • USER : User_Name@Mail_Domain
  • PASS : User_Password

⁠TEST

⁠test mail script
$ cat hello_mail.py

 #!/usr/bin/env python  
 # -*- coding:utf-8 -*-
  
 import smtplib
  
 server = smtplib.SMTP('localhost', 25)
 server.set_debuglevel(1)
 server.sendmail('admin@localhost', '[email protected]', 'Hi~! admin!?')
 server.quit()  
$ python ./hello_mail.py
⁠read mail and delete script
$ cat read_mail.py

#!/usr/bin/env python
# -*- coding:utf-8 -*-

import poplib

client = poplib.POP3('localhost', 110)
client.user('[email protected]')
client.pass_('admin')
num_messages = len(client.list()[1])

for i in range(num_messages):
  for j in client.retr(i+1)[1]:
     print(j)

for i in range(num_messages):
  client.dele(i)
$ python ./hello.py

Tag summary

Content type

Image

Digest

Size

39.9 MB

Last updated

almost 11 years ago

docker pull adite/tmail