แก้ปัญหาการส่งเมล โดยใช้ gmail

การแก้ปัญหาการส่งเมล สำหรับโฮสต์ที่ใช้ dynamic ip โดยใช้ gmail

ปัญหาคือเมลเซิร์ฟเวอร์สาธารณะไม่ยอมรับจดหมายจากเครื่องที่มีไอพีไม่คงที่
จะแก้โดยให้ gmail เป็นผู้ส่งจดหมายให้
สมมุติว่าเราได้ติดตั้ง postfix ไว้แล้ว

ขั้นตอนสำหรับ gmail

  1. สมัครสมาชิก gmail
  2. ไปที่ การตั้งค่า(settings) -> การส่งต่อและ POP/IMAP (Forwarding and POP/IMAP) ->
    การเข้าถึงแบบ IMAP: (IMAP Access:) เลือก ใช้งาน IMAP (Enable IMAP)

เสร็จแล้ว

ขั้นตอนของ postfix

  1. เปิดใช้ relay โดยใช้คำสั่งชุดนี้
    # postconf -e 'relayhost = smtp.gmail.com'
    # postconf -e 'smtp_sasl_auth_enable = yes'
    # postconf -e 'smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd'
    # postconf -e 'smtp_sasl_security_options ='
  2. ตั้งค่ารหัสผ่าน ใช้ชื่อและรหัสผ่านชุดเดียวกับตอนที่สมัคร gmail โดยใช้คำสั่งชุดนี้
    # echo "smtp.gmail.com USER@gmail.com:PASSWORD" >> /etc/postfix/sasl_passwd
    # chown root:root /etc/postfix/sasl_passwd
    # chmod 600 /etc/postfix/sasl_passwd
    # postmap /etc/postfix/sasl_passwd
  3. แล้วก็เริ่ม postfix ใหม่
    # /etc/init.d/postfix restart

เสร็จแล้ว
หลังจากนี้เวลาเซิร์ฟเวอร์เราส่งเมลออก เขาจะใช้กูเกิลในการส่งแทน

อ้างอิง

Re: แก้ปัญหาการส่งเมล โดยใช้ gmail

Gmail นี่สุดยอดของบริการ free mail เลยนะเนี่ย

Re: แก้ปัญหาการส่งเมล โดยใช้ gmail

ผมว่า อ.วิทยา เนี่ยสุดยอดการประยุกต์ใช้งานจริงๆ นะตัวเอง ...

Re: แก้ปัญหาการส่งเมล โดยใช้ gmail

ใครลองใช้แล้วอยากรู้ว่าเวลาคนที่ได้รับนี่จะเห็ From มาจากไหนเหรอครับ มาจาก คนส่ง หรือจาก acc gmail

Re: แก้ปัญหาการส่งเมล โดยใช้ gmail

สามารถตั้งค่าได้ที่ gmail ครับ ว่าจะให้ชื่อผู้ส่งเป็นใคร
ค่าปริยายเป็น จาก gmail ครับ
(แต่ยังไม่เคยตรวจสอบจริง ๆ เหมือนกันนะครับว่าได้ผลหรือเปล่า)

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <pre> <blockquote> <img> <h3> <h4> <h5>
  • Lines and paragraphs break automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.