2
votes

im having problems with using php mail() function to send email to google business apps (gmail). Other emails are working fine. I have nginx and postfix installed on Debian.

I have added SPF record
TXT "v=spf1 include:_spf.google.com ~all"

/var/log/mail.log looks like this:

Jan 13 16:58:12 pluto postfix/pickup[26804]: 42FD82169E: uid=33 from=<www-data>  
Jan 13 16:58:12 pluto postfix/cleanup[26826]: 42FD82169E: message-id=<[email protected]>  
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 42FD82169E: from=<www-data@[email protected]>, size=594, nrcpt=1 (queue active)  
Jan 13 16:58:12 pluto postfix/smtp[26828]: 42FD82169E: to=<[email protected]>, relay=aspmx.l.google.com[173.194.78.26]:25, delay=0.23, delays=0.06/0.01/0.06/0.11, dsn=5.7.1, status=bounced (host aspmx.l.google.com[173.194.78.26] said: 550-5.7.1 [83.136.252.16 12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. ey11si9440622wid.49 - gsmtp (in reply to end of DATA command))  
Jan 13 16:58:12 pluto postfix/cleanup[26826]: 768962179F: message-id=<[email protected]>  
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 768962179F: from=, size=3127, nrcpt=1 (queue active)  
Jan 13 16:58:12 pluto postfix/bounce[26829]: 42FD82169E: sender non-delivery notification: 768962179F  
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 42FD82169E: removed  
Jan 13 16:58:12 pluto postfix/smtp[26828]: 768962179F: to=<www-data@[email protected]>, relay=aspmx.l.google.com[173.194.78.26]:25, delay=0.09, delays=0.01/0/0.04/0.04, dsn=5.1.1, status=bounced (host aspmx.l.google.com[173.194.78.26] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1 http://support.google.com/mail/bin/answer.py?answer=6596 l10si41320730wjz.98 - gsmtp (in reply to RCPT TO command))  
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 768962179F: removed


/etc/postfix/main.cf looks like this:

myhostname = mydomain.com  
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)  
biff = no  
append_dot_mydomain = no  
readme_directory = no  
myorigin = /etc/mailname  
mydestination =  
relayhost =  
mynetworks = 127.0.0.0/8 83.136.252.0/22 10.2.0.0/22 [::1]/128 [fe80::]/64  
mailbox_command = procmail -a "$EXTENSION"  
mailbox_size_limit = 0  
recipient_delimiter = +  
inet_interfaces = all  
inet_protocols = ipv4  
milter_protocol = 2  
milter_default_action = accept
2
Please look that you are properly authenticated support.google.com/mail/answer/81126?hl=en#authenticationJérôme Mahuet
www-data@[email protected] doesn't look quite valid indeed.Álvaro González
i think there is something missing in your SPF record, as i guess, your server has it's own postfix server on it at domain mydomain.com, but you don't specify this in the SPF record. maybe you should add the A or MX record too.Raphael Müller

2 Answers

2
votes

Problem was solved by editing /etc/mailname from

[email protected]

to

mydomain.com

0
votes

Have you tried this ? I get it that you're not trying to forward mails, but still ...