dopetalk

Technology => SMF Forum Code Modifications => Topic started by: Chip on October 26, 2017, 06:21:37 PM

Title: SMTP-SSL (my own tiny packaged mod)
Post by: Chip on October 26, 2017, 06:21:37 PM
by me: to fix ssl:// when selecting SSL-enabled gmail as an alternative SMTP server

also this is an example of how to package a "mod" for SMF

package-info.xml:

Code: [Select]
<?xml version="1.0"?>
<!DOCTYPE package-info SYSTEM "http://www.simplemachines.org/xml/package-info">

<package-info xmlns="http://www.simplemachines.org/xml/package-info" xmlns:smf="http://www.simplemachines.org/">
        <id>MMMMM:smtpssl</id>
        <name>SMTP-SSL</name>
        <version>1.0</version>
        <type>modification</type>
        <install>
                <modification format="xml" type="file">install.xml</modification>
        </install>
        <uninstall>
                <modification reverse="true">install.xml</modification>
        </uninstall>
</package-info>

install.xml:

Code: [Select]
<?xml version="1.0"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">

<modification xmlns="http://www.simplemachines.org/xml/modification" xmlns:smf="http://www.simplemachines.org/">
        <id>MMMMM:smtpssl</id>
        <version>1.0</version>
        <file name="$sourcedir/Subs-Post.php">
                <operation>
                        <search position="replace"><![CDATA[
                // EHLO could be understood to mean encrypted hello...
                if (server_parse('EHLO ' . $modSettings['smtp_host'], $socket, null) == '250')
]]></search>
                        <add><![CDATA[
                // EHLO could be understood to mean encrypted hello...
//              if (server_parse('EHLO ' . $modSettings['smtp_host'], $socket, null) == '250')
                if (server_parse('EHLO ' . 'localhost', $socket, null) == '250')
]]></add>
                </operation>
        </file>
</modification>
SimplePortal 2.3.6 © 2008-2014, SimplePortal