Ver Mensaje Individual
  #2 (permalink)  
Antiguo 17/10/2013, 00:32
Avatar de manyblue
manyblue
 
Fecha de Ingreso: marzo-2008
Mensajes: 329
Antigüedad: 16 años, 1 mes
Puntos: 10
Respuesta: Duda Postfix php.ini

Bueno pues ya que nadie responde, despues de mucho buscar, respondere yo:


1) Tener instalado Apache y PHP en ubuntu
2) Desinstalar sendmail si está instalado
# apt-get remove sendmail
3) Instalar "postfix":
# apt-get install postfix
4) Instalar mailutils
# apt-get install mailutils
5) Ir a php.ini en /etc/php5/apache2/php.ini y editar la seccion [mail function]
dejandola asi:
[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 = [email protected]

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
sendmail_path = /usr/sbin/sendmail -t -i

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =

; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename
mail.add_x_header = On

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
6) reiniciamos apache /etc/init.d/apache2 restart
7) En realidad y mas exactamente la parte de sendmail_path = deberia quedar asi:
sendmail_path = /usr/sbin/sendmail -t -i -f name_from@your_server_name.com
Pero no es completamente necesario.
8) Enviamos un correo de pruebas:
#echo 'this is a test mesage body' | mail -s test_email_header [email protected]

vuala............ si que se envian los correos compruebo mi gmail y hay correo entrante de root

root <root@miservidor>
this is a test mesage body

Nada mas espero haber aportado algo, ya tenemos un servidor de correo saliente, OJO solo saliente SMTP para poder usar la funcion "mail()" de PHP.

Un saludo a todos: Manyblue