Renamed option directory to quarantine_directory
This commit is contained in:
@@ -56,7 +56,7 @@ The following configuration options are mandatory in each quarantine section:
|
|||||||
Original e-mails are stored on the filesystem with a unique filename. The filename is available as a
|
Original e-mails are stored on the filesystem with a unique filename. The filename is available as a
|
||||||
template variable used in notifiaction templates.
|
template variable used in notifiaction templates.
|
||||||
The following configuration options are mandatory for this quarantine type:
|
The following configuration options are mandatory for this quarantine type:
|
||||||
* **directory**
|
* **quarantine_directory**
|
||||||
The directory in which quarantined e-mails are stored.
|
The directory in which quarantined e-mails are stored.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -57,12 +57,12 @@ smtp_port = 25
|
|||||||
#
|
#
|
||||||
quarantine_type = file
|
quarantine_type = file
|
||||||
|
|
||||||
# Option: directory
|
# Option: quarantine_directory
|
||||||
# Notes: Set the directory to store quarantined emails.
|
# Notes: Set the directory to store quarantined emails.
|
||||||
# This option is needed by quarantine type 'file'.
|
# This option is needed by quarantine type 'file'.
|
||||||
# Values: [ DIRECTORY ]
|
# Values: [ DIRECTORY ]
|
||||||
#
|
#
|
||||||
directory = /var/lib/pyquarantine/spam
|
quarantine_directory = /var/lib/pyquarantine/spam
|
||||||
|
|
||||||
# Option: action
|
# Option: action
|
||||||
# Notes: Set the milter action to perform if email is processed by this quarantine.
|
# Notes: Set the milter action to perform if email is processed by this quarantine.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/sbin/openrc-run
|
#!/sbin/openrc-run
|
||||||
|
|
||||||
user=${USER:-daemon:nobody}
|
user=${USER:-daemon}
|
||||||
socket="${SOCKET:-}"
|
socket="${SOCKET:-}"
|
||||||
milter_opts="${MILTER_OPTS:-}"
|
milter_opts="${MILTER_OPTS:-}"
|
||||||
|
|
||||||
|
|||||||
@@ -67,12 +67,12 @@ class FileQuarantine(BaseQuarantine):
|
|||||||
super(FileQuarantine, self).__init__(global_config, config, configtest)
|
super(FileQuarantine, self).__init__(global_config, config, configtest)
|
||||||
|
|
||||||
# check if mandatory options are present in config
|
# check if mandatory options are present in config
|
||||||
for option in ["directory"]:
|
for option in ["quarantine_directory"]:
|
||||||
if option not in self.config.keys() and option in self.global_config.keys():
|
if option not in self.config.keys() and option in self.global_config.keys():
|
||||||
self.config[option] = self.global_config[option]
|
self.config[option] = self.global_config[option]
|
||||||
if option not in self.config.keys():
|
if option not in self.config.keys():
|
||||||
raise RuntimeError("mandatory option '{}' not present in config section '{}' or 'global'".format(option, self.name))
|
raise RuntimeError("mandatory option '{}' not present in config section '{}' or 'global'".format(option, self.name))
|
||||||
self.directory = self.config["directory"]
|
self.directory = self.config["quarantine_directory"]
|
||||||
|
|
||||||
# check if quarantine directory exists and is writable
|
# check if quarantine directory exists and is writable
|
||||||
if not os.path.isdir(self.directory) or not os.access(self.directory, os.W_OK):
|
if not os.path.isdir(self.directory) or not os.access(self.directory, os.W_OK):
|
||||||
|
|||||||
Reference in New Issue
Block a user