wordpress does not send email

Discussion in 'ISPConfig 3 Priority Support' started by Tom John, Nov 7, 2021.

  1. Tom John

    Tom John Active Member HowtoForge Supporter

    Hi guys,
    i use ubuntu20.04 with ispconfig 3 according to :
    https://www.howtoforge.com/ispconfig-autoinstall-debian-ubuntu/
    there is a wordpress installation and i use cf 7
    when i try to send an email with the form i get an error :
    Code:
    There was an error trying to send your message. Please try again later.
    
    when i look the mail.log i can not see any action when i sending the form.
    Do you have any idea what can be the problem?
    the email address exist on the server
    thanks a lot for your help
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Did you configure your WordPress plugin to send by PHP mail() function or do you send by SMTP? If you can configure it to use smtp, I'll recommend that you try that, preferably configure it to use a username and password of one of your mail accounts in ISPConfig and use port 587 to send the emails in this case. If you want to send without username and password, then localhost in combination with port 25 should be fine.
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    And check website error.log for errors too.
     
  4. Tom John

    Tom John Active Member HowtoForge Supporter

    Hi,
    thanks for your quick reply.
    I just setup SMTP with wp-mail-smtp and i get an error:
    Code:
    SPF
    Action Needed: It doesn't look like the SPF record required by your SMTP server has been added to your domain. Please contact your SMTP server provider for details on how to find the SPF record, and how to add this record to your domain's DNS.
    
    
    even the test email arrive but i get an error mail as well:
    Code:
    <[email protected]>: host gmail-smtp-in.l.google.com[173.194.79.27] said:
       550-5.7.1 [167.86.78.111      18] Our system has detected that this message
       is 550-5.7.1 likely suspicious due to the very low reputation of the
       sending IP 550-5.7.1 address. To best protect our users from spam, the
       message has been 550-5.7.1 blocked. Please visit 550 5.7.1
       https://support.google.com/mail/answer/188131 for more information.
       n14si29395903edx.122 - gsmtp (in reply to end of DATA command)
    
    i understand i need an SPF Record for the domain, i use cloudflare as DNS
    Do i need to setup the SPF Record in ISPConfig as well? or in Cloudflare?
    As well i am not sure where to find the mail error log in ispconfig
    thanks a lot for your kind help
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Set it up in cloudflare only in this case.

    Do you have this domain as email domain in ISPConfig and use a username and password to send via smtp now? If yes, create a dkim key in ispconfig email settings, this will further improve reputation.

    It's in the monitoring module, the menu there is quite long, mail logs are more towards the bottom. but the logs there are not realtime, so if you are logged in on the shell of youzr server, better use tail command to watch the mail log, e.g.:

    tail -f /var/log/mail.log

    to quit the command, press strg + c keys.
     
  6. Tom John

    Tom John Active Member HowtoForge Supporter

    Hi there,
    thanks for your answer.
    now the spf error in the wp-mail-smtp is gone it seems ok but after sending another email i get the same error from google.
    Code:
    This is the mail system at host server4.cl-i.net.
    
    I'm sorry to have to inform you that your message could not
    be delivered to one or more recipients. It's attached below.
    
    For further assistance, please send mail to postmaster.
    
    If you do so, please include this problem report. You can
    delete your own text from the attached returned message.
    
                      The mail system
    
    <[email protected]>: host gmail-smtp-in.l.google.com[173.194.79.27] said:
       550-5.7.1 [167.86.78.111      18] Our system has detected that this message
       is 550-5.7.1 likely suspicious due to the very low reputation of the
       sending IP 550-5.7.1 address. To best protect our users from spam, the
       message has been 550-5.7.1 blocked. Please visit 550 5.7.1
       https://support.google.com/mail/answer/188131 for more information.
       a8si19217632edn.165 - gsmtp (in reply to end of DATA command)
    
    i just created a dkim key in ispconfig for that domain, do i need to copy the key in the cloudflare dns as well?

    When i want to send the contact form i get again the error when i send the form:
    Code:
    There was an error trying to send your message. Please try again later.
    
    the mail.log gives the following info while sending the form:
    Code:
    Nov  7 17:00:49 server4 postfix/cleanup[1965587]: 7BF098201F1: message-id=<[email protected]>
    Nov  7 17:00:49 server4 postfix/qmgr[1946351]: 7BF098201F1: from=<[email protected]>, size=13339, nrcpt=1 (queue active)
    Nov  7 17:00:49 server4 postfix/submission/smtpd[1965585]: disconnect from localhost[127.0.0.1] ehlo=2 starttls=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=8
    Nov  7 17:00:49 server4 postfix/smtp[1965588]: connect to gmail-smtp-in.l.google.com[2a00:1450:4013:c05::1a]:25: Network is unreachable
    Nov  7 17:00:50 server4 postfix/smtp[1965588]: 7BF098201F1: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[173.194.79.27]:25, delay=0.95, delays=0.08/0.02/0.51/0.34, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[173.194.79.27] said: 550-5.7.1 [167.86.78.111      18] Our system has detected that this message is 550-5.7.1 likely suspicious due to the very low reputation of the sending IP 550-5.7.1 address. To best protect our users from spam, the message has been 550-5.7.1 blocked. Please visit 550 5.7.1  https://support.google.com/mail/answer/188131 for more information. w9si24832308edc.302 - gsmtp (in reply to end of DATA command))
    Nov  7 17:00:50 server4 postfix/cleanup[1965587]: 6EDE1821337: message-id=<[email protected]>
    Nov  7 17:00:50 server4 postfix/bounce[1965590]: 7BF098201F1: sender non-delivery notification: 6EDE1821337
    Nov  7 17:00:50 server4 postfix/qmgr[1946351]: 6EDE1821337: from=<>, size=16718, nrcpt=1 (queue active)
    Nov  7 17:00:50 server4 postfix/qmgr[1946351]: 7BF098201F1: removed
    Nov  7 17:00:50 server4 dovecot: lmtp(1965592): Connect from local
    Nov  7 17:00:50 server4 dovecot: lmtp([email protected])<1965592><vQAPHTL4h2EY/h0APhWRKA>: sieve: msgid=<[email protected]>: stored mail into mailbox 'INBOX'
    Nov  7 17:00:50 server4 postfix/lmtp[1965591]: 6EDE1821337: to=<[email protected]>, relay=server4.cl-i.net[private/dovecot-lmtp], delay=0.04, delays=0/0.02/0.01/0.01, dsn=2.0.0, status=sent (250 2.0.0 <[email protected]> vQAPHTL4h2EY/h0APhWRKA Saved)
    Nov  7 17:00:50 server4 dovecot: lmtp(1965592): Disconnect from local: Client has quit the connection (state=READY)
    Nov  7 17:00:50 server4 postfix/qmgr[1946351]: 6EDE1821337: removed
    
    
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    yes. and just as a note, it might be that you have to remove the single quotes within the generated dkim key when you insert it at Cloudflare, some providers require single quotes on long strings, others not.

    and if you have not done that yet, set up a reverse DNS record for your IP address that matches the server hostname. Such a reverse record is normally set up in the GUI of your server hoster or datacenter and not in ISPConfig or Cloudflare.
     
  8. Tom John

    Tom John Active Member HowtoForge Supporter

    thanks for you answer.
    in cloudflare i want to put the name which is "default._domainkey.wp-fit.com" and the target which is the dns record dkim private key which i made with ispconfig
    Code:
    default._domainkey.wp-fit.com. 3600  IN  TXT   "v=DKIM1; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5CAFKKVDaEfuxXKhhZDJV4PrpsADQIvlfd/G24tEoT7Z3Vmo9UpM/+1dXWG6EeM/ls0su3eUv+/NXfsBQSzwHzAdu/iiT1Pu8D1+b5t0USoEYC/NHJckv2mtU8Vt6gtcYQtE0ZfiXzUc""/6VhANIbAATXtt7S43KHuedLBnbpYl+z46bRgiOZ8kG1Vna/SJ7cBHt1hNPlARv/mFndFFCx/QBhP2wuD2ORM+8fWqJRQkG/EHamBaSUICk8XNuwJaZzkAO10YHP1puLtuC75RXIIrgmbbdVOj2VZ6550NIdegrdoiOPYe6KppKmIepO7kKtAr0xm2iv18BcamDan74g""/wIDAQAB"
    
    and i get an error from cloudflare that maximum 63 characters are allowed.
    or did you mean to remove the doble quotes and put as single quotes?
    sorry for bother you again with this matter
     
    Last edited: Nov 7, 2021
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    Put onlöy this in the target of the txt record

    Code:
    v=DKIM1; t=s; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5CAFKKVDaEfuxXKhhZDJV4PrpsADQIvlfd/G24tEoT7Z3Vmo9UpM/+1dXWG6EeM/ls0su3eUv+/NXfsBQSzwHzAdu/iiT1Pu8D1+b5t0USoEYC/NHJckv2mtU8Vt6gtcYQtE0ZfiXzUc/6VhANIbAATXtt7S43KHuedLBnbpYl+z46bRgiOZ8kG1Vna/SJ7cBHt1hNPlARv/mFndFFCx/QBhP2wuD2ORM+8fWqJRQkG/EHamBaSUICk8XNuwJaZzkAO10YHP1puLtuC75RXIIrgmbbdVOj2VZ6550NIdegrdoiOPYe6KppKmIepO7kKtAr0xm2iv18BcamDan74g/wIDAQAB
     
  10. Tom John

    Tom John Active Member HowtoForge Supporter

    its the same problem only 63 characters are allowed
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Just tested in my Cloudflare account and I can add it without issues. Please double check that you create a TXT record
     
  12. Tom John

    Tom John Active Member HowtoForge Supporter

    Yes its working now the problem was i did not choose TXT record.
    Thanks a lot for your patience, i checked with a checker form cloudflare that dkim is working fine.
    however i have the same problem that the email from wp-mail-smtp is blocked from google.
    maybe i should put another domain which is not with google?
    and i get the error that when i send the form but no entry in the mail.log file when i send the form
    Code:
    There was an error trying to send your message. Please try again later.
    
    should i use another form then cf7 maybe?
     
  13. till

    till Super Moderator Staff Member ISPConfig Developer

    Do you mean that the email domain of the FROM address of the email you are sending is a domain that is registered at google as email domain, so google provides the mail service for this domain? Or is just the 'to' address a gmail address?

    I guess the errors is caused by the rejection from google. You might test it by using a different to address for the form which is not hosted at google to see if it works then.

    Generally speaking, if your server has a bad reputation at google and other mail services at the beginning, which is not uncommon and not necessarily a fault in the setup or your fault, then it can take a while until you get mails through.
     
  14. Tom John

    Tom John Active Member HowtoForge Supporter

    It was the email of the FROM address, i tried to send a testmail with wp-mail-smtp to see if smtp is working, with another email address it works well so the test email arrives so this problem is solved.
    However good to understand it can take i while my emails going through to google.

    Now there is only the error left of the form, i already changed the FROM Email to another email which is working. I will use another form builder or check what could be wrong with the form.

    thanks a lot for your help you have a lot of patience with me thanks for that.
    And thanks for your great help i learned a lot today
     

Share This Page