การเชื่อมต่อ Thunderbird กับ Google Mail (ทั้ง Gmail และ Google Apps)

ในอดีต Thunderbird และ Mail Client อื่นๆสามารถติดต่อกับ Google Mail ได้โดยตั้งค่า Mail Server ให้ถูกต้อง และ username/password ก็สามารถใช้งานได้ แต่ในปัจจุบัน Google หันไปใช้ระบบ OAuth 2.0 ซึ่งการ Authentication หรือการใส่ username/password ต้องทำที่ Google เท่านั้น รวมถึงการทำ 2-Step Verification ด้วย (การใส่ One-Time Password นอกเหนือจาก username/password เป็นต้น) ทำให้ Thunderbird และ Mail Client ที่ยังไม่รองรับ OAuth 2.0 ไม่สามารถใช้งานได้

แต่ทาง Google Mail ยังเปิดให้สามารถใช้งานได้ โดยแบ่งเป็น 2 กรณีคือ ใช้หรือไม่ใช้ 2-Step Verification โดยตรวจสอบได้จาก

0. วิธีตรวจสอบว่าใช้งาน 2-Step Verification หรือไม่ โดยการไปที่ https://myaccount.google.com/security
หากไม่เปิดใช้ 2-Step Verification จะได้หน้าตาอย่างนี้
2559-08-08 09_33_29-Program Manager
หากเปิดใช้ 2-Step Verification จะได้หน้าตาอย่างนี้
2559-08-08 09_34_04-Program Manager

1. ผู้ใช้ที่ไม่ได้เปิดใช้งาน 2-Step Verification ให้ไปที่ https://myaccount.google.com/security#connectedapps
ภายใต้หัวข้อ Allow less secure apps ให้เปิดใช้งาน ดังภาพ
2559-08-08 09_40_49-Program Manager

2. ผู้ใช้ที่เปิดใช้งาน 2-Step Verification ให้ไปที่ https://security.google.com/settings/security/apppasswords
แล้วเลือก Mail และ Windows Computer แล้วคลิก Generate ดังภาพ
2559-08-08 10_03_47-App passwords - Account Settings
จะได้ Password ที่ใช้ครั้งเดียวทิ้ง (ไม่ต้องไปจำ) ดังภาพ
2559-08-08 10_06_10-App passwords - Account Settings
หากวันหลังต้องการเลิกใช้ ก็กดปุ่ม Revoke ภายหลังได้

จากนั้น เปิดให้ Google Account ใช้งาน IMAP ได้ โดยไปที่ https://mail.google.com/mail/u/0/#settings/fwdandpop
แล้วคลิก Enable IMAP ดังภาพ
2559-08-08 10_17_17-Settings - Psu.ac.th Mail
แล้วคลิก Save Change ด้านล่าง

สุดท้าย ที่ Thunderbird ให้ตั้งค่า

Password: สำหรับคนที่ไม่ใช้ 2-Step Verification ให้ใส่ Password ของ Google Account เดิมลงไป ส่วนคนที่ใช้ 2-Step Verification ให้เอา Password ที่ได้มาใหม่ใส่ลงไปแทน
Incoming IMAP เป็น imap.gmail.com และ SSL เป็น SSL/TLS
Outgoing SMTP เป็น smtp.gmail.com และ SSL เป็น SSL/TLS
อย่าลืม ใส่ username ให้มี @gmail.com หรือ @psu.ac.th ในกรณีใช้ PSU GAFE ด้วย
แล้วคลิกปุ่ม Done ดังภาพ

2559-08-08 10_12_15-Mail Account Setup

เท่านี้ก็สามารถใช้งาน Google Mail จาก Thunderbird ได้แล้ว