-
Notifications
You must be signed in to change notification settings - Fork 3
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
Conversation
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: lbgracioso <[email protected]>
Signed-off-by: Vinícius Ferrão <[email protected]>
std::optional<std::string> m_hostname {}; | ||
std::optional<std::string> m_domain {}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
std::optional<std::filesystem::path> m_cert_file {}; | ||
std::optional<std::filesystem::path> m_key_file {}; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
//@TODO Check if m_domain is the right key. Maybe a new variable is needed | ||
// here, m_relayhost_domain?. |
There was a problem hiding this comment.
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
.
src/mailsystem/postfix.cpp
Outdated
#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 - - "); | ||
} |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
|
Supersedes #26
Also add some testability, allow merging of the postfix config files instead of overwriting, and integrate the dbus daemon reset code.