Isnin, 21 April 2014

4800. How to setup exim4 on Debian to use Gmail.

بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ  , الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ , الرَّحْمَنِ الرَّحِيمِ ,  مَالِكِ يَوْمِ الدِّينِ , إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ , اهْدِنَا الصِّرَاطَ المُسْتَقِيمَ  , صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ , غَيْرِ المَغْضُوبِ عَلَيْهِمْ وَلاَ الضَّالِّينَ.


Assalamualaikum w.b.t/السَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُه

Meja www.peceq.blogspot.com  

  • How to setup exim4 on Debian to use Gmail


    Why bother configuring an SMTP mail server on your Linux desktop? Especially if you can send and receive all your emails within a web browser using your Gmail account, or with an email client such as Thunderbird.
    My reasons are twofold:
    • Some applications running on my desktop require SMTP to be set up.My desktop computer is used to stage a WordPress blog. For WordPress to send email, an SMTP server is required.
    • To redirect local root emails.Some programs such as sudo send emails to alert the root user of critical security events. For instance, after 3 failed sudologin attempts. But unless these emails are forwarded to an Internet email account that I actually monitor, they are useless.
    This post is about configuring exim4, the default mail server on Debian wheezy.
    I assume that
    • exim4 is already installed
    • You have a valid Google Gmail account.
    Follow the steps below to configure exim4 to send all outbound emails to a remote "smarthost", namely the Google Gmail SMTP server. The smarthost will take care of forwarding the emails to their final destinations.
    1. Reconfigure exim4.By default, exim4 is set up for local email delivery only: no emails to remote domains. You can reconfigure the application using the dpkg-reconfigure command or edit directly the configuration file (/etc/exim4/update-exim4.conf.conf).
      $ sudo dpkg-reconfigure exim4-config
      

    2. Specify exim4 parameters.When prompted by dpkg-reconfigure, enter the following values for the respective exim4 parameters.
      ParametersValues
      General type of mail configurationmail sent by smarthost; received via SMTP or fetchmail
      System mail namelocalhost
      IP addresses to listen on for incoming SMTP connections127.0.0.1
      Note: external connections are refused.
      Other destinations for which mail is acceptedLeave empty.
      Machines to relay mail forLeave empty.
      IP address or host name of the outgoing smarthostsmtp.gmail.com::587
      Hide local mail name in outgoing mail?No
      Keep number of DNS-queries minimal (Dial-on-Demand)?No
      Delivery method for local mailmbox format in /var/mail/
      Split configuration into small files?No
    3. Provide the Gmail account and password.Append the following to /etc/exim4/passwd.client with the proper Gmail account and password:
      *.google.com:yourAccount@gmail.com:yourPassword
      
      This password file contains sensitive account information. You should verify its file permissions and ownership.
      $ ls -al /etc/exim4/passwd.client
      -rw-r----- 1 root Debian-exim 252 Mar 25 17:24 /etc/exim4/passwd.client
      
      If they are different from the above, use the following commands to set file permissions and ownership.
      $ sudo chown root:Debian-exim /etc/exim4/passwd.client
      $ sudo chmod 640 /etc/exim4/passwd.client
      
    4. Reload exim4.
      $ sudo update-exim4.conf
      $ invoke-rc.d exim4 restart
      [ ok ] Stopping MTA for restart: exim4_listener.
      [ ok ] Restarting MTA: exim4.
      $ exim4 -qff
      
      The -qff parameter forces a delivery attempt for every message, whether frozen or not.
    To test, send an email to yourself, and check your Inbox:
    $ echo test only | mail -s 'Test Subject' myAddress@gmail.com
    
    If you open the email, you will see that the From address in the email header is the Gmail account which you configured in/etc/exim4/passwd.client.
    If you experience any issue with exim4, check its log file located at/var/log/exim4/mainlog.
    Now that an SMTP server is set up, my next post explains how to redirect local root emails to an Internet email account of your choice.

    s3v3n

    s3v3n
    copyright©
IP
<h2 class="MsoNormal" dir="RTL" style="background-color: white; border-bottom-color: transparent; border-bottom-style: solid; border-bottom-width: 1px; color: #333333; direction: rtl; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-weight: bolder; margin: 0in 27pt 0in 0in; padding: 0px; position: relative; text-align: right; unicode-bidi: embed;">
<b><span lang="AR" style="font-family: 'Times New Roman', serif; font-size: large;">بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ&nbsp;&nbsp;,&nbsp;الْحَمْدُ لِلَّهِ رَبِّ الْعَالَمِينَ , الرَّحْمَنِ الرَّحِيمِ ,&nbsp;&nbsp;مَالِكِ يَوْمِ الدِّينِ , إِيَّاكَ نَعْبُدُ وَإِيَّاكَ نَسْتَعِينُ , اهْدِنَا الصِّرَاطَ المُسْتَقِيمَ&nbsp;&nbsp;, صِرَاطَ الَّذِينَ أَنْعَمْتَ عَلَيْهِمْ , غَيْرِ المَغْضُوبِ عَلَيْهِمْ وَلاَ الضَّالِّينَ.</span></b></h2>
<h2>
<span style="font-size: large;"><br style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19px;" /><b style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19px;"><span style="color: black; font-family: 'Times New Roman', serif;">Assalamualaikum w.b.t/</span></b><b style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19px;"><span lang="AR" style="font-family: 'Times New Roman', serif;">ا</span></b><b style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 19px;"><span style="color: black; font-family: 'Times New Roman', serif;">لسَّلاَمُ عَلَيْكُمْ وَرَحْمَةُ اللهِ وَبَرَكَاتُه</span></b></span></h2>
<div class="MsoNormal" style="background-color: white; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px; margin: 0px; outline: none; padding: 0px;">
<b><span style="color: black; font-family: 'Times New Roman', serif; font-size: 12pt;"></span></b></div>
<span style="background-color: #fafafa; color: #333333; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;">Meja&nbsp;</span><b style="background-color: white; font-family: 'Helvetica Neue Light', HelveticaNeue-Light, 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 14px; line-height: 19px;"><a href="http://www.peceq.blogspot.com/" style="color: blue; display: inline; outline: none; text-decoration: none;">www.peceq.blogspot.com</a><span style="color: blue;">&nbsp;&nbsp;</span>.&nbsp;</b><br />
<ul style="background-position: 0px 10px; background-repeat: no-repeat no-repeat; border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-width: 1px; color: #666666; font-family: Tahoma, Arial, Verdana; height: 800px; line-height: 1.2em; list-style-image: initial; list-style-position: initial; margin: 0px; overflow: auto; padding: 0.25em 17px; text-align: -webkit-auto; width: auto;">
<li style="border-bottom-color: rgb(221, 221, 221); border-bottom-style: solid; border-bottom-width: 1px; list-style-image: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjST1jQkSHW4i9rK8LagVekc5RZFuI1iBCss1ciiXlqEtI7gLtUwi2dqCgq-sPBkfN7xZfDf3HPm3k1YkeA_Ls-cNzfYzgbXg61vpFhwIBkfin2AYHeQgajBg9d6IGhna2m0J6N1uiQkkc/s320/arrow-grey.gif); margin: 0px 0px 5px; padding: 0.7em 0px;"><div class="item-content">
<br />
<div class="post-body entry-content" style="color: #333333; line-height: 18px;">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div style="font-size: 12px; text-align: justify;">
<span class="data-post"><span id="advenueINTEXT" name="advenueINTEXT" style="background-color: white;"><br /></span></span></div>
<div style="font-size: 12px; text-align: justify;">
<span class="data-post"><span id="advenueINTEXT" name="advenueINTEXT" style="background-color: white;">Sumber:&nbsp;()&nbsp;</span></span><br />
<span class="data-post"><span name="advenueINTEXT" style="background-color: white;"><br /></span></span></div>
</div>
</div>
<span style="background-color: white;"><span style="font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 18px;">Blogger Home.&nbsp;</span></span><br />
<div style="text-align: center;">
<span style="background-color: white;">s3v3n</span></div>
<div style="text-align: center;">
<span style="background-color: white;"><embed height="200" src="http://flash-clocks.com/free-flash-clocks-blog-topics/free-flash-clock-190.swf" type="application/x-shockwave-flash" width="200" wmode="transparent"></embed><br /></span></div>
<div style="text-align: center;">
<span style="background-color: white;">s3v3n</span></div>
<div style="text-align: center;">
<i style="background-color: white;">copyright©</i></div>
</div>
</li>
</ul>
<div style="text-align: center;">
<a href="http://www.wieistmeineip.de/cometo/?en" style="background-color: white; color: magenta; font-family: Arimo; font-size: 14px; line-height: 1.4; text-align: -webkit-auto; text-decoration: none;"><img alt="IP" border="0" src="http://www.wieistmeineip.de/ip-address/" height="125" style="border: none; position: relative;" width="125" /></a><br />
<div style="text-align: left;">
<br /></div>
</div>
<div class="sidebar section" id="sidebar-right-1" style="background-color: #fafafa; color: white; font-family: Arimo; font-size: 14px; margin: 0px 15px; text-align: -webkit-auto;">
<div class="widget HTML" id="HTML19" style="line-height: 1.4; margin: 30px 0px; min-height: 0px; position: relative;">
<div class="clear" style="clear: both;">
</div>
<span class="widget-item-control" style="float: right; height: 20px; margin-top: -20px; position: relative; z-index: 10;"></span></div>
</div>
</div>

Tiada ulasan: