Shunze ¾Ç¶é >¹q¸£¸ê°T¾Ç¨t >¦Y³n¤£¦Yµw > ¡m¤À¨É¡nUbuntu³z¹LGmail¨Óµo°e¶l¥ó «¢Åo¡AÁÙ¨S¦³µù¥U©ÎªÌµn¤J¡C½Ð§A[µù¥U|µn¤J]
« ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD » Åã¥Ü¦¨¦C¦L¼Ò¦¡ | ¼W¥[¨ì§Úªº³Ì·R
µoªí·s¥DÃD µoªí¦^ÂÐ
§@ªÌ
¥DÃD
shunze
¤u¤Í§B§B


µù¥U¤é´Á: 2002 04
¨Ó¦Û: ¼é¦Á²×¤î¤§¦a
¤å³¹: 2380

shunze Â÷½u
¡m¤À¨É¡nUbuntu³z¹LGmail¨Óµo°e¶l¥ó¤Þ¥Î¦^ÂÐ ½s¿è/§R°£¤å³¹ ·j´M¥Ñ  µoªíªº¨ä¥L¤å³¹ ¦^³øµ¹ª©¥D IP ¦ì¸m ¦^¦¹­¶³Ì¤W¤è

¦bLinux¤W¬[mail server¤£¬O¥óÃø¨Æ¡A
¦ý¬[¤Fmail server«á¡A¦w¥þ©Ê¤~¬O¤@­Ó­«ÂI¡C
·U¦hªA°È¦b°õ¦æ¡A¬Û¹ïªº­·ÀI¤]´N·U°ª¡C

¦³¨S¦³¿ìªk¤£¦Û¤v¬[³]mail server¡A¦Ó¬O³z¹LGmail¨Óµo°e¶l¥ó©O¡H

¦³ªº¡A
°Ñ¦Ò¥H¤U ³o½g¤å³¹ ªº°µªk¡A¥HUbuntu 14.04¬°Àô¹Ò¡A«ö¹Ï¬I¤u¡A«OÃÒ¦¨¥\¡ã

  • ­º¥ý¡A¥ý¦w¸Ëexim4®M¥ó¡C
    apt-get install exim4


  • µM«á°õ¦æ¥H¤U«ü¥O¡A¶i¦æexim4®M¥óªº³]©w¡C
    dpkg-reconfigure exim4-config

    1. ¦b Mail Server configuration ªº¿ï¾Ü¤W¡A¿ï¾Ü mail sent by smarthost; no local mail



    2. ±µ¤U¨Óªº System mail name¡A«O«ù­ì¥D¾÷¦WºÙ§Y¥i¡C



    3. µM«á¦b IP-address to listen ¤W¡Aºû«ù­ì¨Óªº 127.0.0.1 ; ::1¡AÅýExim4¥u­nºÊÅ¥¥»¾÷ªºmail´N¦n¡C



    4. ±µµÛ¦b Other desinations for which mail is accepted ¤W«O«ùªÅ¥Õ¡C



    5. ©ó Visible domain name for local users ¤¤¡A«O«ù­ì¥D¾÷¦WºÙ§Y¥i¡C



    6. ³Ì«á­«ÂI¨Ó¤F¡A¦b IP address or host name of the outgoing smarthost ³]©wùØ¡A
      ¿é¤Jgmailªºsmpt¦ì§}¸ê°T smtp.gmail.com::587¡A
      ³o¼Ë¤~¯à³z¹Lgmail¨Ó±Hµo¶l¥ó¡C



  • Exim4³]©w¦n«á¡A±µ¤U¨Ó­n³]©wGmailªº¬ÛÃö¸ê°T¡C
    ²Ä¤@¨B¡A¥ý½T»{GmailªºSmtp¦øªA¾¹¦WºÙ¡A¥i¿é¤Jhost smtp.gmail.com«ü¥O¡A
    ¬Ý¬Ý¸ÑªR¥X¨Óªºsmtp.gmail.com¹ê»Ú¹ïÀ³ªº¬O­þ¨Ç¥D¾÷¡C
    host smtp.gmail.com
    smtp.gmail.com is an alias for gmail-smtp-msa.l.google.com.
    gmail-smtp-msa.l.google.com has address 74.125.204.108
    gmail-smtp-msa.l.google.com has address 74.125.204.109
    gmail-smtp-msa.l.google.com has IPv6 address 2404:6800:4008:c04::6d

    °õ¦æ«á¡Aµo²{smtp.gmail.com¹ïÀ³ªº¬O¦h­Ógoogle.comªº¥D¾÷¡A
    §Ú­Ì¥i¥H¦b /etc/exim4/passwd.client ³o­ÓÀɮפ¤¡A±N¥H¤U³o¦æ¥[¤J¡C
    *.google.com:§Aªº±b¸¹@gmail.com:§Aªº±K½X


    ±µµÛ±N¥»¾÷±b¸¹»PGmailÃöÁp°_¨Ó¡A«ü¥O¦p¤U¡C
    echo "$(whoami): §Aªº±b¸¹@gmail.com" | sudo tee -a /etc/email-addresses

    °õ¦æ«á¡A¥¦´N·|¦b /etc/email-addresses Àɮפ¤¡A¼W¥[¤@¤U¦p¤Uªº¹ïÀ³¸ê®Æ¡C
    root: §Aªº±b¸¹@gmail.com


  • ±b¸¹¹ïÀ³§¹¦¨«á¡A­«±ÒExim4ªA°È¡AÅý­è¤~ªº³]©w¥Í®Ä¡C
    service exim4 restart


    µM«á¥i¥H³z¹L¥H¤U«ü¥O¡Aµo­Ó´ú¸Õ¶l¥ó¨Ó¸Õ¸Õ¯à§_¦¨¥\±Hµ¹¦Û¤v¡C
    echo "This is a test mail." | mail -s "test mail" §Aªº±b¸¹@gmail.com


    ¦¨¥\ªº¸Ü¡A§A´N¥i¥H¦bGmail¤¤¦¬¨ì³o­Ó´ú¸Õ«H¡C



    ¥¢±Ñªº¸Ü¡A¥i¥H¥h¬dlogÀÉ /var/log/exim4/mainlog¡A¬Ý¬Ý°ÝÃD¥X¦b­þ¡H³v¨B¥h¸Ñ¨M¡C

  • ­Y§AªºGMail©|¥¼¶}©ñµ¹À³¥Îµ{¨Ó¦s¨ú¨Ï¥Î¡A¾É­P¨t²ÎµLªk³z¹LGmail¨Óµo«H¡A
    ½Ð¥ýµn¤JGmail¡A°±¥Î¨â¨BÆJÅçÃÒ¡A¨Ã¤¹³\¦w¥þ©Ê¸û§CªºÀ³¥Îµ{¦¡¦s¨úÅv­­¡C

    https://myaccount.google.com/?pli=1




    ¶i¦æÅܧó«á¡AUbuntu³z¹LGmail¨Ó±HµoÀ³¸Ó´N¨S¦³°ÝÃD¤F¡C



°Ñ¦Ò¸ê®Æ
¦b Ubuntu 14.04 ®à­±Àô¹Ò¤W­±³]©w Exim4 ¨Ï¥Î Gmail ¨Ó±H«H



♥¶¶¤l¦Ñ±Cªººô©ç¡A½Ð¦hÃö·Ó¡ã

If you don't like something, change it.
If you can't change it, change your attitude.
Don't complain!




2015-05-05, 22:39 shunze ªº­Ó¤H¸ê®Æ §â shunze ¥[¤J¦n¤Í¦Cªí µo°eEmailµ¹ shunze ÂsÄý shunze ªººô¯¸ MSN : shunze@gmail.com
  « ¤W¤@½g¥DÃD ¤U¤@½g¥DÃD »
µoªí·s¥DÃD µoªí¦^ÂÐ
¸õ¨ì:

Powered by: Burning Board 1.1.1 2001 WoltLab GbR