AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-237939

Gery's questions

Martin Hope
Gery
Asked: 2016-07-05 19:37:53 +0800 CST

从 ubuntu 到 Zoho 电子邮件地址的联系表

  • 0

为了让我的 Postfix 配置与我的 Zoho 电子邮件帐户一起工作,我需要一些支持。我想要做的是从我在http://www.g3eo.com/#!/page_Contacts的联系表格中向我的 Zoho 电子邮件帐户发送一条消息。为此,我以这种方式在我的 ubuntu 框中配置了 Postfix(基于http://emanuelesantanche.com/configuring-postfix-to-relay-email-through-zoho-mail/):

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) biff = no

append_dot_mydomain = no

readme_directory = no

mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = all

# TLS parameters
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtp_header_checks = pcre:/etc/postfix/smtp_header_checks

myhostname = xxxxxxxxxx
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = xxxxxxxxxx, localhost.com, localhost
relayhost = smtp.zoho.com:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/password
#smtp_sasl_security_options =
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_security_options = noanonymous
smtp_always_send_ehlo = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtpd_relay_restrictions = permit_mynetworks,permit_sasl_authenticated,defer_unauth_destination

在我的网站联系表单中,事情似乎运行良好,您可以通过在“网络”选项卡中打开 Firebug(按 F12)发送消息来测试它。发送电子邮件后,它会在回复选项卡中显示此消息“已发送邮件”。但是,该消息没有到达我在 Zoho 电子邮件帐户中的电子邮件地址。检查后/var/log/mail.log显示:

7 月 4 日 21:46:42 xxxxxxxxxx postfix/qmgr[9100]: D9B2E5E0292: from=, size=549, nrcpt=1 (queue active)

7 月 4 日 21:46:45 xxxxxxxxxx postfix/smtp[27824]: D9B2E5E0292: to=, relay=smtp.zoho.com[165.254.168.48]:587, delay=114224, delays=114222/0.01/2.6/0, dsn =4.0.0, status=deferred (SASL 认证失败;服务器 smtp.zoho.com[165.254.168.48] 说: 535 Authentication Failed)

我了解身份验证问题是因为我的消息可能会进入 Zoho smtp 服务器,所以它被拒绝了,不确定是不是这样。如果有人可以帮助了解这里发生了什么以及如何解决它,我将不胜感激。

我的联系表格使用以下文件: - http://www.g3eo.com/extras/js/forms.js

和http://www.g3eo.com/extras/bin/MailHandler.php(见下文)

  if($_POST['name']!='nope'){
      $messageBody .= '<p>Visitor: ' . $_POST["name"] . '</p>' . "\n";
      $messageBody .= '<br>' . "\n";
  }
  if($_POST['email']!='nope'){
      $messageBody .= '<p>Email Address: ' . $_POST['email'] . '</p>' . "\n";
      $messageBody .= '<br>' . "\n";
  }else{
      $headers = '';
  }
  if($_POST['state']!='nope'){        
      $messageBody .= '<p>State: ' . $_POST['state'] . '</p>' . "\n";
      $messageBody .= '<br>' . "\n";
  }
  if($_POST['phone']!='nope'){        
      $messageBody .= '<p>Phone Number: ' . $_POST['phone'] . '</p>' . "\n";
      $messageBody .= '<br>' . "\n";
  }   
  if($_POST['fax']!='nope'){      
      $messageBody .= '<p>Fax Number: ' . $_POST['fax'] . '</p>' . "\n";
      $messageBody .= '<br>' . "\n";
  }
  if($_POST['message']!='nope'){
      $messageBody .= '<p>Message: ' . $_POST['message'] . '</p>' . "\n";
  }

  if($_POST["stripHTML"] == 'true'){
      $messageBody = strip_tags($messageBody);
  }

  try{
      if(!mail($owner_email, $subject, $messageBody, $headers)){
          throw new Exception('mail failed');
      }else{
          echo 'mail sent';
      }
  }catch(Exception $e){
      echo $e->getMessage() ."\n";
  }

编辑#1:

/etc/postfix/password从更改为 后smtp.zoho.com:587,[smtp.zoho.com]我收到了/var/log/mail.log:

7 月 4 日 23:46:24 xxxxxxxxxx 后缀/拾取 [2926]: 8BC545E0261: uid=33 from= Jul 4 23:46:24 xxxxxxxxxx 后缀/清理[2933]: 8BC545E0261: message-id=<20160705044624.8BC545E0261@xxxxxxxxxx>

7 月 4 日 23:46:24 xxxxxxxxxx postfix/qmgr[2927]: 8BC545E0261: from=, size=588, nrcpt=1 (queue active)

7 月 4 日 23:46:26 xxxxxxxxxx postfix/smtp[2930]: 8BC545E0261: to=, relay=smtp.zoho.com[165.254.168.48]:587, delay=2.1, delays=0.13/0/1.8/0.16, dsn =5.5.1,status=bounced(主机 smtp.zoho.com[165.254.168.48] 说:530 5.5.1 Authentication Required。(回复 MAIL FROM 命令))

7 月 4 日 23:46:27 xxxxxxxxxx 后缀/清理 [2933]: 098835E026E: message-id=<20160705044627.098835E026E@xxxxxxxxxx>

7 月 4 日 23:46:27 xxxxxxxxxx 后缀/退回 [2932]:8BC545E0261:发件人未送达通知:098835E026E

7 月 4 日 23:46:27 xxxxxxxxxx postfix/qmgr[2927]: 098835E026E: from=<>, size=2494, nrcpt=1 (queue active)

7 月 4 日 23:46:27 xxxxxxxxxx 后缀/qmgr[2927]:8BC545E0261:已删除

Jul 4 23:46:27 xxxxxxxxxx postfix/local[2934]: 098835E026E: to=, relay=local, delay=0.09, delays=0.05/0/0/0.04, dsn=2.0.0, status=sent (发送到邮箱)

7 月 4 日 23:46:27 xxxxxxxxxx 后缀/qmgr[2927]:098835E026E:已删除

问题587在这里吗?

ubuntu php postfix html smtp-auth
  • 1 个回答
  • 506 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve