mail form: pfSense part (pkg)

This commit is contained in:
Thomas NOËL 2012-06-30 00:13:15 +02:00
parent 2f961a9238
commit 9b615b31ba
2 changed files with 65 additions and 10 deletions

View File

@ -8,15 +8,11 @@ LOG_DEBUG = False
TEMPLATE_DEBUG = DEBUG
USE_DEBUG_TOOLBAR = False
#
#
import os
_PROJECT_PATH = os.path.join(os.path.dirname(__file__))
import re
import xml.etree.ElementTree as ET
#
#
#
_PROJECT_PATH = os.path.join(os.path.dirname(__file__))
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
@ -189,7 +185,6 @@ FORCE_SCRIPT_NAME=""
USERBL = '/var/lib/univnautes/userbl'
# parameters from pfSense (/conf/config.xml)
import xml.etree.ElementTree as ET
f = open('/conf/config.xml','r')
root = ET.fromstring(f.read())
f.close()
@ -264,7 +259,8 @@ except:
EMAIL_RCPT = None
try:
EMAIL_SUBJECTS = [ l for l in root.find('installedpackages/univnautestexts/config/email_subjects').text.splitlines() if not re.match('^\s*$', l) ]
subjects = root.find('installedpackages/univnautestexts/config/email_subjects').text.decode('base64').decode('iso-8859-1').splitlines()
EMAIL_SUBJECTS = [ l for l in subjects if not re.match('^\s*$', l) ]
except:
EMAIL_SUBJECTS = (
u"Je ne trouve pas mon établissement dans la liste",

View File

@ -80,8 +80,67 @@
</field>
<field>
<type>listtopic</type>
<name>Local Identity Provider interface [to be done]</name>
<name>Email form configuration (/mail URI)</name>
</field>
<field>
<fielddescr>Recipient</fielddescr>
<fieldname>email_rcpt</fieldname>
<description>Recipient's email address (for example:
univnautes-support@your-domain.tld). If empty, the email form
is disabled.</description>
<default_value></default_value>
<type>input</type>
<size>40</size>
</field>
<field>
<fielddescr>Possible subjects</fielddescr>
<fieldname>email_subjects</fieldname>
<encoding>base64</encoding>
<description>List of possible emails subjects, one per line</description>
<type>textarea</type>
<rows>4</rows>
<cols>70</cols>
</field>
<field>
<fielddescr>Host</fielddescr>
<fieldname>email_host</fieldname>
<description>The SMTP server use for sending email
(for example: smtp.your-domain.tld). If empty, the email form
is disabled.</description>
<default_value></default_value>
<type>input</type>
<size>40</size>
</field>
<field>
<fielddescr>Port</fielddescr>
<fieldname>email_port</fieldname>
<description>Port to use for the SMTP server (default: 587)</description>
<default_value></default_value>
<type>input</type>
<size>5</size>
</field>
<field>
<fielddescr>User</fielddescr>
<fieldname>email_host_user</fieldname>
<description>Username to use for the SMTP server. If empty, UnivNautes won't attempt authentication.</description>
<default_value></default_value>
<type>input</type>
<size>40</size>
</field>
<field>
<fielddescr>Password</fielddescr>
<fieldname>email_host_password</fieldname>
<description>Password associated to the username.</description>
<default_value></default_value>
<type>password</type>
<size>20</size>
</field>
<field>
<fielddescr>Use TLS</fielddescr>
<fieldname>email_use_tls</fieldname>
<description>Whether to use a TLS (secure) connection when talking to the SMTP server.</description>
<type>checkbox</type>
</field>
<field>
<type>listtopic</type>
<name>Mobile/Smartphone interface</name>