Estou movendo um site para outro servidor e estou tendo um problema com o correio do PHP. Mas apenas ao enviar e-mails para o domínio do host, por exemplo, [email protected].
mail($send_to, 'Web contact' ,$message,null,"-r [email protected]");
A única maneira de obter mensagens para enviar é adicionando o sinalizador -r, não parece importar qual endereço de e-mail foi digitado depois do sinalizador.
Esta é uma migração do Centos 5 para o 6 e acredito que o correio esteja usando o Postfix em vez do sendMail.
Existe uma configuração do Postfix que eu possa alterar para deixar de adicionar esse sinalizador a todas as chamadas da função de e-mail?
Além disso, existe uma maneira de forçar o uso do sendMail em vez de usar o Postfix se eu não puder consertar isso?
Eu deveria ter mencionado que eu sei que o e-mail foi roteado internamente como é mostrado no log:
EDITAR
Esta é uma tentativa falhada sem sinalizador
May 14 16:13:12 test sendmail[10244]: t4EFDCLq010244: from=apache, size=169, class=0, nrcpts=1, msgid=<[email protected]>, relay=apache@localhost
May 14 16:13:12 test postfix/smtpd[10245]: connect from localhost[127.0.0.1]
May 14 16:13:12 test postfix/smtpd[10245]: 9EFB3256738: client=localhost[127.0.0.1]
May 14 16:13:12 test postfix/cleanup[10248]: 9EFB3256738: message-id=<[email protected]>
May 14 16:13:12 test sendmail[10244]: t4EFDCLq010244: [email protected], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30169, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 9EFB3256738)
May 14 16:13:12 test postfix/qmgr[10102]: 9EFB3256738: from=<[email protected]>, size=592, nrcpt=1 (queue active)
May 14 16:13:12 test postfix/smtpd[10245]: disconnect from localhost[127.0.0.1]
May 14 16:13:12 test postfix/smtp[10249]: 9EFB3256738: to=<[email protected]>, relay=mail.example.com[748.31.105.444]:25, delay=0.1, delays=0.04/0.01/0.01/0.03, dsn=5.0.0, status=bounced (host mail.example.com[748.31.105.444] said: 550-Verification failed for <[email protected]> 550-No Such User Here" 550 Sender verify failed (in reply to RCPT TO command))
May 14 16:13:12 test postfix/cleanup[10248]: B47B625675D: message-id=<[email protected]>
May 14 16:13:12 test postfix/bounce[10250]: 9EFB3256738: sender non-delivery notification: B47B625675D
May 14 16:13:12 test postfix/qmgr[10102]: B47B625675D: from=<>, size=2524, nrcpt=1 (queue active)
May 14 16:13:12 test postfix/qmgr[10102]: 9EFB3256738: removed
May 14 16:13:12 test postfix/smtp[10249]: B47B625675D: to=<[email protected]>, relay=mail.example.com[748.31.105.444]:25, delay=0.03, delays=0/0/0.01/0.02, dsn=5.0.0, status=bounced (host mail.example.com[748.31.105.444] said: 550 No Such User Here" (in reply to RCPT TO command))
May 14 16:13:12 test postfix/qmgr[10102]: B47B625675D: removed
E isso é com a bandeira
May 14 16:13:23 test sendmail[10251]: t4EFDN45010251: Authentication-Warning: example.com: apache set sender to [email protected] using -r
May 14 16:13:23 test sendmail[10251]: t4EFDN45010251: [email protected], size=169, class=0, nrcpts=1, msgid=<[email protected]>, relay=apache@localhost
May 14 16:13:23 test postfix/smtpd[10245]: connect from localhost[127.0.0.1]
May 14 16:13:23 test postfix/smtpd[10245]: 3B3EF256738: client=localhost[127.0.0.1]
May 14 16:13:23 test postfix/cleanup[10248]: 3B3EF256738: message-id=<[email protected]>
May 14 16:13:23 test postfix/qmgr[10102]: 3B3EF256738: from=<[email protected]>, size=662, nrcpt=1 (queue active)
May 14 16:13:23 test sendmail[10251]: t4EFDN45010251: [email protected], [email protected] (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30169, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Ok: queued as 3B3EF256738)
May 14 16:13:23 test postfix/smtpd[10245]: disconnect from localhost[127.0.0.1]
May 14 16:13:24 test postfix/smtp[10249]: 3B3EF256738: to=<[email protected]>, relay=mail.example.com[748.31.105.444]:25, delay=1.4, delays=0.03/0/0.01/1.3, dsn=2.0.0, status=sent (250 OK id=1Ysup9-0001Rr-Jv)
May 14 16:13:24 test postfix/qmgr[10102]: 3B3EF256738: removed
Os problemas parecem ser que o usuário apache está sendo devolvido pelo Postfix, o ideal é que eu queira que o Postfix envie de qualquer maneira para esse usuário.
Configuração do postfix
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = localhost
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = localhost.$mydomain
mydomain = example.com
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550