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

Add mailfrom and smtpserver parameters #37

Merged
merged 4 commits into from Sep 14, 2016
Merged

Add mailfrom and smtpserver parameters #37

merged 4 commits into from Sep 14, 2016

Conversation

ghost
Copy link

@ghost ghost commented Sep 12, 2016

(MODULES-3860) Add mailfrom and smtpserver parameters representing
the mrepo mailfrom and smtp-server configuration settings.

(MODULES-3860) Add `mailfrom` and `smtpserver` parameters representing
the mrepo `mailfrom` and `smtp-server` configuration settings.
# validate email addresses based on regex found in `is_email_address`
# in newer stdlib versions. If metadata.json updated to require
# *4.12.0* or newer, the `validate_re` calls can be replaced by
# `validate_email_address`.
Copy link
Member

Choose a reason for hiding this comment

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

@jearls Thanks for your PR! I'd be OK with updating the dependency on stdlib to 4.12.0

Johnson Earls added 2 commits September 14, 2016 18:19
Modernize `mailto` parameter to use `undef` instead of the string
literal `'UNSET'`.  Change `mailfrom` and `smtpserver` to conform.
Use `validate_email_address` to validate `mailto` and `mailfrom`
parameters.
@@ -121,6 +128,13 @@
validate_bool($rhn)
validate_hash($descriptions)

if $mailto != undef {
Copy link
Member

@petems petems Sep 14, 2016

Choose a reason for hiding this comment

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

This can be simplified as if $mailto

if $mailto != undef {
validate_email_address($mailto)
}
if $mailfrom != undef {
Copy link
Member

Choose a reason for hiding this comment

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

Same here (if $mailfrom)

mailto = <%= mailto %>
<% if @mailto -%>
mailto = <%= @mailto %>
<% if @mailfrom -%>
Copy link
Member

Choose a reason for hiding this comment

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

Some indentation wonkiness here?

<% if @mailfrom -%>
to
<% if @mailfrom -%>

Copy link
Author

@ghost ghost Sep 14, 2016

Choose a reason for hiding this comment

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

The indented <%   if @mailfrom -%> is to indicate that that is inside the surrounding <% if @mailto -%> block. The mailfrom and smtp-server parameters only make sense if mailto is set.

I could indent the <% itself, but I'd have to transform it to   <%-, and that also looks strange when the parameters inside that if block are not themselves indented.

Copy link
Member

Choose a reason for hiding this comment

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

mailto = <%= mailto %>
<% if @mailto -%>
mailto = <%= @mailto %>
<% if @mailfrom -%>
Copy link
Member

Choose a reason for hiding this comment

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

@alexjfisher alexjfisher merged commit 31afd44 into voxpupuli:master Sep 14, 2016
@alexjfisher
Copy link
Member

@jearls Thanks!

@petems
Copy link
Member

petems commented Sep 14, 2016

@jearls Thanks for your contribution! 👍

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