Struct mpot_http::postfix::PostfixConfiguration
source · pub struct PostfixConfiguration {
pub user: Cow<'static, str>,
pub group: Option<Cow<'static, str>>,
pub binary_path: PathBuf,
pub process_limit: Option<u64>,
pub map_output_path: Option<PathBuf>,
pub transport_name: Option<Cow<'static, str>>,
}
Expand description
Settings for generating postfix configuration.
See the struct methods for details.
Fields§
§user: Cow<'static, str>
The UNIX username under which the mailpot process who processed incoming mail is launched.
group: Option<Cow<'static, str>>
The UNIX group under which the mailpot process who processed incoming mail is launched.
binary_path: PathBuf
The absolute path of the mailpot
binary.
process_limit: Option<u64>
The maximum number of mailpot
processes to launch. Default is 1
.
map_output_path: Option<PathBuf>
The directory in which the map files are saved.
Default is data_path
from Configuration
.
transport_name: Option<Cow<'static, str>>
The name of the Postfix service name to use.
Default is mailpot
.
A Postfix service is a daemon managed by the postfix process.
Each entry in the master.cf
configuration file defines a single
service.
The master.cf
file is documented in master(5)
:
https://www.postfix.org/master.5.html.
Implementations§
source§impl PostfixConfiguration
impl PostfixConfiguration
sourcepub fn generate_master_cf_entry(
&self,
config: &Configuration,
config_path: &Path
) -> String
pub fn generate_master_cf_entry( &self, config: &Configuration, config_path: &Path ) -> String
Generate service line entry for Postfix’s master.cf
file.
sourcepub fn generate_maps(
&self,
lists: &[(DbVal<MailingList>, Option<DbVal<PostPolicy>>)]
) -> String
pub fn generate_maps( &self, lists: &[(DbVal<MailingList>, Option<DbVal<PostPolicy>>)] ) -> String
Generate transport_maps
and local_recipient_maps
for Postfix.
The output must be saved in a plain text file.
To make Postfix be able to read them, the postmap
application must be
executed with the path to the map file as its sole argument.
postmap
is usually distributed along with the other Postfix binaries.
sourcepub fn save_master_cf_entry(
&self,
config: &Configuration,
config_path: &Path,
master_cf_path: Option<&Path>
) -> Result<(), Error>
pub fn save_master_cf_entry( &self, config: &Configuration, config_path: &Path, master_cf_path: Option<&Path> ) -> Result<(), Error>
Save service to Postfix’s master.cf
file.
If you wish to do it manually, get the text output from
PostfixConfiguration::generate_master_cf_entry
and manually append it to the master.cf
file.
If master_cf_path
is None
, the location of the file is assumed to be
/etc/postfix/master.cf
.
sourcepub fn save_maps(&self, config: &Configuration) -> Result<(), Error>
pub fn save_maps(&self, config: &Configuration) -> Result<(), Error>
Generate transport_maps
and local_recipient_maps
for Postfix.
To succeed the user the command is running under must have write and
read access to postfix_data_directory
and the postmap
binary
must be discoverable in your PATH
environment variable.
postmap
is usually distributed along with the other Postfix binaries.
Trait Implementations§
source§impl Clone for PostfixConfiguration
impl Clone for PostfixConfiguration
source§fn clone(&self) -> PostfixConfiguration
fn clone(&self) -> PostfixConfiguration
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more