Skip to content

Commit

Permalink
Item12952: More email wizard.
Browse files Browse the repository at this point in the history
Apply the results of the Perl configuration.  Still needs work for
the mailprogram configuration,  but this successfully configured
submission to a local postfix server, and gmail as well.
  • Loading branch information
gac410 committed Aug 30, 2014
1 parent 793f8fa commit c85ac01
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions core/lib/Foswiki/Configure/Wizards/AutoConfigureEmail.pm
Original file line number Diff line number Diff line change
Expand Up @@ -617,9 +617,32 @@ sub _autoconfigPerl {
);
return 0;
}

$use[1] =~ s/^.*\((\d+)\)$/$1/;
$host = "[$host]" if ( $hInfo->{ipv6addr} );
my $cfg = $use[0];

_setConfig( $reporter, '{SMTP}{Debug}', 0 );
_setConfig( $reporter, '{Email}{MailMethod}', $cfg->{method} );
_setConfig( $reporter, '{SMTP}{SENDERHOST}', $hello );
_setConfig( $reporter, '{SMTP}{Username}', $username );
_setConfig( $reporter, '{SMTP}{Password}', $password );
_setConfig( $reporter, '{SMTP}{MAILHOST}', $host . ':' . $use[1] );
_setConfig( $reporter, '{Email}{SSLVerifyServer}', ( $cfg->{verify} || 0 ) )
if ( $cfg->{ssl} );

return 1;
}

sub _setConfig {

#my ($reporter, $setting, $value) = @_;

eval( '$Foswiki::cfg' . $_[1] . ' = ' . '"' . $_[2] . '"' );
$_[0]->CHANGED( $_[1] );
return;
}

# Support routines

sub _diagnoseFailure {
Expand Down

0 comments on commit c85ac01

Please sign in to comment.