Changes

Jump to navigation Jump to search

Coral: msmtp detail

5,101 bytes added, 13:45, 12 November 2011
Created page with "<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font..."
<div id="top" style="margin:0;padding: 0px 0px 0px 5px; color: #000; background-color: #FFFFEB; border: 1px solid darkslateblue;"><span id="top" style="margin:0;padding: 0px;font-size:12px">'''''Coral'' :'''&nbsp; [[Coral: msmtp intro|MSMTP]] | [[Coral: msmtp detail|MSMTP - Detail]]</span></div>

{|style="margin-top:5px;"
|-valign="top"
|
<span style="margin-bottom:5px;font-size:25px;color: #31799F;">MSMTP - Detail</span>

The majority of SMTP clients use the Windows registry. These are not suitable for portability. The Uniform Server uses the open source msmtp client. It's flexible, relative easy to set-up, and more importantly it's portable. This page covers the configuration sub-menu which allows you to configure and test the '''msmtp''' client.


While msmtp can be configured to use your ISP’s SMTP server, that again restricts portability. The answer is to create a free account such as Google Mail ('''gmail''') or '''Hotmail''' and configure msmtp to use that.


This combination allows any PHP scripts to send e-mail to your account transparently. MSMTP has been integrated into The Uniform Server. All you need to do is configure the account as explained below.



__TOC__

|
{| cellpadding="0" cellspacing="0" style="margin-left:6px;margin-bottom:5px;padding-left:6px;padding-right:6px;font-size:11px;background-color: #FFFFEB;border: 1px solid darkslateblue;"
|-
|colspan="2" style="font-weight:bold;"| UniServer&nbsp;8-Coral
|-
|&nbsp;||[[Coral: Introduction|Home]]
|-
|&nbsp;||[[Coral: start quick start|Quick Start]]
|-
|&nbsp;||[[Coral: general intro|General]]
|-
|&nbsp;||[[Coral: apache intro|Apache]]
|-
|&nbsp;||[[Coral: mysql intro|MySQL]]
|-
|&nbsp;||[[Coral: php intro|PHP]]
|-
|<span style="font-size: 14px;">»</span>||[[Coral: msmtp intro|MSMTP]]
|-
|&nbsp;||[[Coral: cron intro|CRON]]
|-
|&nbsp;||[[Coral: dtdns intro|DtDNS]]
|-
|&nbsp;||[[Coral: dbbackup intro|Db Backup]]
|-
|&nbsp;||[[Coral: perl intro|Perl]]
|-
|&nbsp;||[[Coral: index main|Main Index]]
|}
|}

==Background==
SMTP (simple mail transport protocol) was originally designed to be an open relay where an SMTP server would accept any e-mail for forwarding. This quickly became abused by spammers. In retaliation, ISP’s restricted open relaying. This means you cannot use the PHP function to directly send e-mail to a user. You either require your own mail server with all the complication that is associated with it, or you use your ISP’s SMTP server. In either situation you are restricted to a local server on a dedicated line.

Free e-mail accounts such as Google Mail remove these chains by allowing you to relay through their servers. However you must login to their servers before this privilege is granted.

'''''[[#top | Top]]'''''
==Upgrade==
This section is useful for users who wish to upgrade when a newer version of MSMTP is released.

Download the latest version (currently msmtp-1.4.24-w32.zip) from [http://sourceforge.net/projects/msmtp/files/ <nowiki>http://sourceforge.net/projects/msmtp/files/</nowiki>]

* Unzip to any folder.
* Copy file: msmtp-1.4.24-w32\msmtp-1.4.24-w32\'''msmtp.exe'''
* To folder: UniServer\'''msmtp'''

That is all there is to an upgrade.

'''''[[#top | Top]]'''''
==How MSMTP client was integrated==

If you are interested in how msmtp integrates into The Uniform Server’s architecture, read on.

There are three requirements for integration:

* Inform PHP where to find the msmtp executable.
* Inform msmtp where to find its configuration file.
* Finally inform msmtp where its log file is to be located.

{|cellpadding="6"
|-valign="top"
|style="background-color:#f0f0f0"|
'''msmtp configuration file:'''

Path and name UniServer\msmtp\msmtprc.ini <br />
Note: File name could have been different
|
&nbsp;
|style="background-color:#f0f0f0"|
log file location:

THe configuration file msmtprc.ini contains the log file path.<br />
This path is specified as an absolute path.<br />
For example: "C:/some_folder/UniServer/msmtp/msmtp.log"<br />
Note: When the servers are moved, this path is automatically updated.
|}
===php.ini configuration===
A single line placed in php.ini configuration file resolves the first two requirements. The line has the following format:

<pre>
sendmail_path = "C:/some_folder/UniServer/msmtp/msmtp.exe --file=C:/some_folder/UniServer/msmtp/msmtprc.ini -t"
</pre>

'''Note:''' Absolute paths with forward slashes are used. The first part instructs PHP where to find the msmtp executable, and the second part instructs msmtp where to find its configuration file.

===Extract from PHP configuration file php.ini===

<pre>
[mail function]
; For Win32 only.
; http://php.net/smtp
;SMTP = localhost
; http://php.net/smtp-port
;smtp_port = 25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@localhost.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
;sendmail_path = "/usr/bin/sendmail.exe -t"

sendmail_path = "C:/UniServer/msmtp/msmtp.exe --file=C:/UniServer/msmtp/msmtprc.ini -t"

</pre>

'''''[[#top | Top]]'''''

----

[[Category: Uniform Server 8-Coral]]

Navigation menu