Opencart Email Setup

8 posts / 0 new
Last post
#1 Sat, 10/24/2015 - 01:04
hinhthoi

Opencart Email Setup

Hi,

I have been struggling a few hours but cannot set up email for my opencart (Version 2.x)

I installed webmin and virtualmin in ubuntu VPS.

I can send email through mail() function in php to my gmail account.

I send a test email from my gmail to one of my emails of one of my domains, and i can receive the email in webmin > Server > Read User Mail.

From webmin > Server > Read User Mail, i can also compose and send a test email to my gmail.

I installed opencart 2.x to one of the domain.

After logging into opencart, in the Mail tab of the system setting, detail is here http://forums.vn/opencart-email.png

I have filled in various combinations of my emails, including both my domain email and my gmails, but i didn't received any notification email for contact form. By right, when a user contact throught the contact form, both the site admin and the user should receive notification email.

Could anyone help me with this problem?

Thank you very much.

Sat, 10/24/2015 - 15:04
Diabolico
Diabolico's picture

Did you check mail log to see if there is anything related to your problem?

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sat, 10/24/2015 - 19:25
andreychek

Howdy,

Yeah as Diabolico mentioned, you'd want to take a peek at the email logs located in /var/log/mail.log.

Those will will show any attempt to send emails, along with any errors that are occurring in Postfix.

-Eric

Sat, 10/24/2015 - 19:48
hinhthoi

Hi, here is exactly what i got from the email log (i didn't change anything), after trying one test on the opencart contact form

Oct 24 20:29:05 server1 postfix/pickup[7280]: D388B8B20E3F: uid=1009 from=bestbuy2@bestbuy2.com Oct 24 20:29:05 server1 postfix/cleanup[9741]: D388B8B20E3F: message-id=20151025002905.D388B8B20E3F@server1.domain.com Oct 24 20:29:05 server1 postfix/qmgr[1263]: D388B8B20E3F: from=bestbuy2@bestbuy2.com, size=829, nrcpt=1 (queue active) Oct 24 20:29:06 server1 postfix/smtp[9743]: D388B8B20E3F: host gmail-smtp-in.l.google.com[74.125.198.27] said: 421-4.7.0 [63.142.249.131 15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 https://support.google.com/mail/answer/81126 to review our Bulk Email 421 4.7.0 Senders Guidelines. ge5si16541744obb.82 - gsmtp (in reply to end of DATA command) Oct 24 20:29:36 server1 postfix/smtp[9743]: connect to gmail-smtp-in.l.google.com[2607:f8b0:4003:c0d::1b]:25: Connection timed out Oct 24 20:29:36 server1 postfix/smtp[9743]: D388B8B20E3F: to=pvqcontact@gmail.com, relay=alt1.gmail-smtp-in.l.google.com[173.194.219.27]:25, delay=31, delays=0.07/0.01/30/0.18, dsn=4.7.0, status=deferred (host alt1.gmail-smtp-in.l.google.com[173.194.219.27] said: 421-4.7.0 [63.142.249.131 15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 https://support.google.com/mail/answer/81126 to review our Bulk Email 421 4.7.0 Senders Guidelines. p124si12332151ywf.283 - gsmtp (in reply to end of DATA command))

Sat, 10/24/2015 - 19:57
hinhthoi

I'm very sure that there is no problem with IP address, as i explained at the beginning, i can send email through mail() function in php and through compose mail function inside webmin.

Sat, 10/24/2015 - 22:01
Diabolico
Diabolico's picture

Please could you post the log between < code > and < /code > (without empty space) so its easier to read or use something like pastebin and post a link.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Sat, 10/24/2015 - 23:16
Diabolico
Diabolico's picture

Ok i took time and check your log and here is the problem: Oct 24 20:29:06 server1 postfix/smtp[9743]: D388B8B20E3F: host gmail-smtp-in.l.google.com[74.125.198.27] said: 421-4.7.0 [63.142.249.131 15] Our system has detected an unusual rate of 421-4.7.0 unsolicited mail originating from your IP address. To protect our 421-4.7.0 users from spam, mail sent from your IP address has been temporarily 421-4.7.0 rate limited. Please visit 421-4.7.0 https://support.google.com/mail/answer/81126 to review our Bulk Email 421 4.7.0 Senders Guidelines. ge5si16541744obb.82 - gsmtp (in reply to end of DATA command)

Your IP is temporarily or permanently banned on Google/Gmail as the code "421-4.7.0" is suggesting. Just to know that "temporarily" could be from few hours up to weeks. Google doesnt have any public blacklist and it will never answer to your emails regarding this subject.

This is what you can do:

  1. Check if you have rDNS, SPF and DKIM in place and valid. You must have all 3 or Gmail will never accept your emails and (at least) mark them as spam what will end in banning your IP and/or domain.

  2. Read https://support.google.com/mail/answer/81126 to see if you did all what Google is asking from you

  3. In case of newsletters you must have double opt in and clear and visible unsubscribe option in every newsletter. Special attention on bouncing emails and be sure to remove them from the list. I would suggest to not use self hosted scripts but rather go with external service like ZohoCampaigns or Mailchimp but there are others.

This are only basic things what you need to do but there is more and you should definitely check and make yourself familiar with all the rules. When it comes to Gmail its easy to get yourself permanently banned and then the waiting game to get removed usually is never less than 2-3 months and can go up to a year.

Either way before you sort rDNS, SPF and DKIM do not even try to send emails to anyone especially Gmail.

- I often come to the conclusion that my brain has too many tabs open. -
Failing at desktop publishing & graphic design since 1994.

Thu, 10/29/2015 - 20:39
hinhthoi

Hi Diabolico,

Thank you very much for your great help. After editing the information about sender, reply to, to the file system/library/mail.php to my domain name, it can send email now. I think gmail blocked emails previously because the sender was exactly me@server1.domain.com, after changing to me@MYPERSONALDOMAIN.com then it can go through.

Thank you again.

Topic locked