Skip to content

Commit

Permalink
Added default values for relay options. Added option smtp_bounce_emai…
Browse files Browse the repository at this point in the history
…l_override to override the VERP for all sites.

(cherry picked from commit a4e6e1d)
  • Loading branch information
mworrell authored and Arjan Scherpenisse committed Jan 25, 2012
1 parent ab27300 commit 60995db
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/smtp/z_email_server.erl
Expand Up @@ -235,9 +235,9 @@ update_config(State) ->
SmtpRelayOpts =
case SmtpRelay of
true ->
[{relay, z_config:get(smtp_host)},
{port, z_config:get(smtp_port)},
{ssl, z_config:get(smtp_ssl)}]
[{relay, z_config:get(smtp_host, "localhost")},
{port, z_config:get(smtp_port, 25)},
{ssl, z_config:get(smtp_ssl, false)}]
++ case {z_config:get(smtp_username),
z_config:get(smtp_password)} of
{undefined, undefined} ->
Expand Down Expand Up @@ -271,8 +271,13 @@ update_config(State) ->
%% @doc Get the bounce email address. Can be overridden per site in config setting site.bounce_email_override.
bounce_email(MessageId, Context) ->
case m_config:get_value(site, bounce_email_override, Context) of
undefined -> "noreply+"++MessageId;
VERP -> z_convert:to_list(VERP)
undefined ->
case z_config:get(smtp_bounce_email_override) of
undefined -> "noreply+"++MessageId;
VERP -> z_convert:to_list(VERP)
end;
VERP ->
z_convert:to_list(VERP)
end.

reply_email(MessageId, Context) ->
Expand Down

0 comments on commit 60995db

Please sign in to comment.