Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement postfix #77

Merged
merged 18 commits into from
Sep 28, 2024
Merged

Implement postfix #77

merged 18 commits into from
Sep 28, 2024

Conversation

arthurmco
Copy link
Collaborator

Supersedes #26

Also add some testability, allow merging of the postfix config files instead of overwriting, and integrate the dbus daemon reset code.

std::optional<std::string> m_hostname {};
std::optional<std::string> m_domain {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think domain is mandatory.

Copy link
Collaborator Author

@arthurmco arthurmco Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but we need to do this to detect when the user did not fill the domain, so we can throw an error

Comment on lines +29 to +30
std::optional<std::filesystem::path> m_cert_file {};
std::optional<std::filesystem::path> m_key_file {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both were optional, but if they didn't exist SMTPS or SMTP over TLS cannot be used.

Copy link
Collaborator Author

@arthurmco arthurmco Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a check. But check the previous comment for the reason I did not delete this

Comment on lines +152 to +153
//@TODO Check if m_domain is the right key. Maybe a new variable is needed
// here, m_relayhost_domain?.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The relayhost is when you need to relay the message to a smart host: https://serverfault.com/questions/325997/what-are-smtp-relays-and-smarthosts

m_domain is the domain that will form the sender: [email protected]; in this case m_domain is example.com.

Comment on lines 169 to 182
#include "cloysterhpc/tmpl/postfix/master.cf.tmpl"
};

std::string masterConf(masterConfInclude);

if (m_profile != Profile::Local) {
masterConf
= cloyster::findAndReplace(masterConf, "{postfix_local_config}",
"#local unix - n n - - ");
} else {
masterConf
= cloyster::findAndReplace(masterConf, "{postfix_local_config}",
"local unix - n n - - ");
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid this can we just change the line that matches local delivery? Why? To avoid adding a whole file as a template, so if anything changes on the RPM package it will not be an issue for us.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use postconf to manipulate this file instead? http://www.postfix.org/postconf.1.html

Copy link
Collaborator Author

@arthurmco arthurmco Sep 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know

In the virtual machine, after the default installation, it gives the following error

[root@cloyster vagrant]# postconf
postconf: fatal: parameter inet_interfaces: no local interface found for ::1

According to the documentation, it should display

the values of main.cf configuration parameters

We use IService to implement the daemon control, so we adapt nfs (that
already used it) and postfix (that has some issues regarding its use)
to make use of them

This will also remove the `systemctl ...` commands
> I think domain is mandatory

> Both were optional, but if they didn't exist SMTPS or SMTP over TLS cannot be used.
Copy link

@arthurmco arthurmco merged commit 80b1159 into master Sep 28, 2024
3 checks passed
@viniciusferrao viniciusferrao deleted the implement_postfix branch January 18, 2025 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants