我按照这里的步骤进行操作 http://beacon.wharton.upenn.edu/bflad/2010/10/setting-up-gmail-as-sendmail-relay
2个问题 1.如何修改它以便www-data(php + apache)可以通过Gmail中继? 2.为什么验证失败?
// ----------------- sendmail.mc
dnl # SSL Settings
define(`CERT_DIR', `/etc/mail/certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/CAcert.pem')
define(`confSERVER_CERT', `CERT_DIR/mycert.pem')
define(`confSERVER_KEY', `CERT_DIR/mykey.pem')
define(`confCLIENT_CERT', `CERT_DIR/mycert.pem')
define(`confCLIENT_KEY', `CERT_DIR/mykey.pem')
dnl #
dnl # GMAIL FORWARDING
define(`SMART_HOST',`smtp.gmail.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
dnl # define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/auth/client-info.db')dnl
dnl #
dnl # Default Mailer setup
// ---------------- Mail.log
Sep 16 20:44:20 xdgs sendmail[5337]: r8GFEKtQ005337: from=root, size=51, class=0, nrcpts=1, msgid=<201309161514.r8GFEKtQ005337@xdgs.localdomain>, relay=root@localhost
Sep 16 20:44:20 xdgs sm-mta[5338]: STARTTLS=server, relay=xdgs.localdomain [127.0.0.1], version=TLSv1/SSLv3, verify=NO, cipher=DHE-DSS-AES256-SHA, bits=256/256
Sep 16 20:44:20 xdgs sendmail[5337]: STARTTLS=client, relay=[127.0.0.1], version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-DSS-AES256-SHA, bits=256/256
Sep 16 20:44:20 xdgs sm-mta[5338]: r8GFEKbn005338: from=<root@xdgs.localdomain>, size=336, class=0, nrcpts=1, msgid=<201309161514.r8GFEKtQ005337@xdgs.localdomain>, proto=ESMTP, daemon=MTA-v4, relay=xdgs.localdomain [127.0.0.1]
Sep 16 20:44:20 xdgs sendmail[5337]: r8GFEKtQ005337: to=receiver@yahoo.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30051, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r8GFEKbn005338 Message accepted for delivery)
Sep 16 20:44:23 xdgs sm-mta[5340]: STARTTLS=client, relay=smtp.gmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-RC4-SHA, bits=128/128
Sep 16 20:44:26 xdgs sm-mta[5340]: r8GFEKbn005338: to=<reciever@yahoo.com>, ctladdr=<root@xdgs.localdomain> (0/0), delay=00:00:06, xdelay=00:00:06, mailer=relay, pri=120336, relay=smtp.gmail.com [173.194.79.109], dsn=2.0.0, stat=Sent (OK 1379344466 fy4sm31865521pbb.1 - gsmtp)