On Darwin OS such as OSX (current one: 10.8.3) you need to add a specific command and option to the sendmail_path constant if you have downloaded and installed a mamp with a stack.
Indeed you can see the required libraries for PHP, Apache, MySQL in "common/lib" folder. The problem is when you run an external command using these libraries, for example "sendmail". It could be a problem if it gets the stack libraries and not the system ones (different versions, etc).
The "env -i" command clean the Stack environment variables and run "sendmail" with the system libraries.
Hope this helps.
Configurazione di Runtime
Il comportamento di queste funzioni è influenzato dalle impostazioni di php.ini.
| Nome | Default | Modificabile | Storico dei cambiamenti |
|---|---|---|---|
| mail.add_x_header | "0" | PHP_INI_PERDIR | Disponibile dal PHP 5.3.0. |
| mail.log | NULL | PHP_INI_PERDIR | Disponibile dal PHP 5.3.0. |
| SMTP | "localhost" | PHP_INI_ALL | |
| smtp_port | "25" | PHP_INI_ALL | Disponibile dal PHP 4.3.0. |
| sendmail_from | NULL | PHP_INI_ALL | |
| sendmail_path | "/usr/sbin/sendmail -t -i" | PHP_INI_SYSTEM |
Breve descrizione dei parametri di configurazione.
-
mail.add_x_headerbool -
Aggiunge X-PHP-Originating-Script che include l'UID dello script seguito dal nome del file.
-
mail.logstring -
Im percorso verso un file di log che registra tutte le chiamate a mail(). Le voci del log includono il percorso completo dello script, il numero di linea, Rl'indirizzo To e le intestazioni.
-
SMTPstring -
Usato solo con Windows: Nome DNS o indirizzo IP del server SMTP che PHP deve usare per spedire posta elettronica con la funzione mail().
-
smtp_portint -
Usato solo con Windows: Numero della porta del server specificato da SMTP al quale connettersi quando si inviano email usando mail(); il valore predefinito è 25. Disponibile solo a partire da PHP 4.3.0.
-
sendmail_fromstring -
Quale campo "From:" devono avere i messaggi inviati da PHP su Windows. Questa direttiva imposta anche l'intestazione "Return-Path:".
-
sendmail_pathstring -
Dove trovare il programma sendmail, solitamente /usr/sbin/sendmail oppure /usr/lib/sendmail. configure cerca di trovare il file e lo imposta di default, ma se non riesce a localizzarlo, lo si può impostare qui.
I sistemi che non usano sendmail devono impostare questa direttiva al wrapper che i rispettivi sistemi di posta offrono, se esistenti. Per esempio, gli utenti di » Qmail possono normalmente impostarla a /var/qmail/bin/sendmail o /var/qmail/bin/qmail-inject.
qmail-inject non necessita di nessuna opzione al fine di processare correttamente la mail.
Questi parametri funzionano anche su Windows. Se si impostate smtp, smtp_port e sendmail_from saranno ignorate e verrà eseguito il comando indicato.
Under Windows, I found sendmail_from needed to be a valid email address which has been defined on the mail server being addressed.
For linux you can over-ride the default "From" for the outgoing emails by including in php.ini this line:
sendmail_path = "/usr/sbin/sendmail -t -i -f fromMe@blah.com"
The path should work for most linux installations.
Despite what this page says about the "SMTP" and "smtp_port" settings being used only under Windows, all Drupal sites use these settings to send email, regardless of which OS they're running in.
The mail.add_x_header configuration value is set to "On" in the default production php.ini (although the default value of this setting is Off)
