-#!/usr/bin/python
+#!/usr/bin/python3
import sys, re
from netaddr import IPAddress, AddrFormatError
if len(sys.argv) != 2:
- print >>sys.stderr, "Usage: %s filename" % sys.argv[0]
+ print("Usage: %s filename" % sys.argv[0], file=sys.stderr)
sys.exit(1)
log = open(sys.argv[1], "a")
- name: install apache
- apt: name=apache2,python-netaddr state=latest
+ apt: name=apache2,python3-netaddr state=latest
- name: enable apache
service: name=apache2 enabled=yes
# apache config
- name: install dovecot
- apt: name=dovecot-imapd,dovecot-lmtpd,dovecot-mysql,dovecot-pop3d,dovecot-sieve,dovecot-managesieved state=latest
+ apt: name=dovecot-imapd,dovecot-lmtpd,dovecot-mysql,dovecot-pop3d,dovecot-sieve,dovecot-managesieved,python3-mysqldb state=latest
- name: enable dovecot
service: name=dovecot enabled=yes
# configuration
-#!/usr/bin/env python2
-from __future__ import print_function
+#!/usr/bin/env python3
+
import os, cgi, MySQLdb, subprocess, time
# settings
-#!/usr/bin/env python2
+#!/usr/bin/env python3
# -*- coding: utf-8 -*-
-from __future__ import print_function
+
import sys, os, random, MySQLdb, subprocess, time, string, argparse
-import urllib, smtplib, email.mime.text, email.utils
+import smtplib, email.mime.text, email.utils
from settings import *
from templates import *