def create(self, objectid, object, tree):
     f = open ('/var/openpanel/conf/staging/SpamAssassin/local.cf','w')
     f.write ("rewrite_header Subject %s \n" % object["subject"])
     f.write ("report_contact %s\n" %object["contact"])
     if object["reportsafe"] == 'off':
         f.write ("report_safe 0\n")
     elif object["reportsafe"] == 'mime':
         f.write ("report_safe 1\n")
     elif object["reportsafe"] == 'plain':
         f.write ("report_safe 2\n")
     f.close ()
     authd.do ("installfile","local.cf","/etc/spamassassin")
     authd.do ('quit')
Example #2
0
 def create(self, objectid, object, tree):
     f = open('/var/openpanel/conf/staging/SpamAssassin/local.cf',
              'w')
     f.write("rewrite_header Subject %s \n" % object["subject"])
     f.write("report_contact %s\n" % object["contact"])
     if object["reportsafe"] == 'off':
         f.write("report_safe 0\n")
     elif object["reportsafe"] == 'mime':
         f.write("report_safe 1\n")
     elif object["reportsafe"] == 'plain':
         f.write("report_safe 2\n")
     f.close()
     authd.do("installfile", "local.cf", "/etc/spamassassin")
     authd.do('quit')
        def create(self, objectid, object, tree):
            model=tree['Storpel']['model']
            storpelid=tree['Storpel']['id']
            f = open(storpelid+'.storpel','w')
            f.write("Model %s\n" % model)
            f.write("Hostname %s\n" % storpelid)
            parentdom = tree['Domain']['id']
            for alias in tree['Domain'].get('Domain:Alias', dict()).keys():
                aliasdom = storpelid.replace(parentdom, alias)
                f.write("Alias %s\n" % aliasdom)
            for user,fields in tree['Storpel'].get('StorpelUser', dict()).items():
                f.write("User %s:%s\n" % (user, fields['password']))
            
            f.close()
            authd.do('installfile', storpelid+".storpel","/etc/storpels")
            authd.do('quit')

            return 'ok!'
Example #4
0
    def create(self, objectid, object, tree):
        model = tree['Storpel']['model']
        storpelid = tree['Storpel']['id']
        f = open(storpelid + '.storpel', 'w')
        f.write("Model %s\n" % model)
        f.write("Hostname %s\n" % storpelid)
        parentdom = tree['Domain']['id']
        for alias in tree['Domain'].get('Domain:Alias', dict()).keys():
            aliasdom = storpelid.replace(parentdom, alias)
            f.write("Alias %s\n" % aliasdom)
        for user, fields in tree['Storpel'].get('StorpelUser', dict()).items():
            f.write("User %s:%s\n" % (user, fields['password']))

        f.close()
        authd.do('installfile', storpelid + ".storpel", "/etc/storpels")
        authd.do('quit')

        return 'ok!'