How To Setup Exim4 On Debian To Operate Gmail

Why bother configuring an SMTP postal service server on your Linux desktop? Especially if y'all tin transportation as well as have all your emails inside a spider web browser using your Gmail account, or alongside an electronic mail customer such equally Thunderbird.

My reasons are twofold:

  • Some applications running on my desktop need SMTP to live laid up.

    My desktop estimator is used to stage a WordPress blog. For WordPress to transportation email, an SMTP server is required.

  • To redirect local root emails.

    Some programs such equally sudo transportation emails to warning the root user of critical safety events. For instance, later three failed sudo login attempts. But unless these emails are forwarded to an Internet electronic mail concern human relationship that I genuinely monitor, they are useless.

This post is virtually configuring exim4, the default postal service server on Debian wheezy.

I assume that

  • exim4 is already installed
  • You get got a valid Google Gmail account.

Follow the steps below to configure exim4 to transportation all outbound emails to a remote "smarthost", namely the Google Gmail SMTP server. The smarthost volition bring help of forwarding the emails to their lastly destinations.

  1. Reconfigure exim4.

    By default, exim4 is educate for local electronic mail delivery only: no emails to remote domains. You tin reconfigure the application using the dpkg-reconfigure ascendence or edit straight the configuration file (/etc/exim4/update-exim4.conf.conf).

     $ sudo dpkg-reconfigure exim4-config 

  2. Specify exim4 parameters.

    When prompted past times dpkg-reconfigure, run inwards the next values for the respective exim4 parameters.

    Parameters Values
    General type of postal service configuration mail sent past times smarthost; received via SMTP or fetchmail
    System postal service name localhost
    IP addresses to head on for incoming SMTP connections 127.0.0.1
    Note: external connections are refused.
    Other destinations for which postal service is accepted Leave empty.
    Machines to relay postal service for Leave empty.
    IP address or host get upward of the outgoing smarthost smtp.gmail.com::587
    Hide local postal service get upward inwards outgoing mail? No
    Keep number of DNS-queries minimal (Dial-on-Demand)? No
    Delivery method for local mail mbox format inwards /var/mail/
    Split configuration into pocket-size files? No
  3. Provide the Gmail concern human relationship as well as password.

    Append the next to /etc/exim4/passwd.client alongside the proper Gmail concern human relationship as well as password:

     *.google.com:yourAccount@gmail.com:yourPassword 

    This password file contains sensitive concern human relationship information. You should verify its file permissions as well as ownership.

     $ ls -al /etc/exim4/passwd.client -rw-r----- 1 rootage Debian-exim 252 Mar 25 17:24 /etc/exim4/passwd.client 

    If they are dissimilar from the above, purpose the next commands to laid file permissions as well as 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 endeavor for every message, whether frozen or not.

To test, transportation an electronic mail to yourself, as well as cheque your Inbox:

 $ echo exam alone | postal service -s 'Test Subject' myAddress@gmail.com 

If y'all opened upward the email, y'all volition run into that the From address inwards the electronic mail header is the Gmail concern human relationship which y'all configured inwards /etc/exim4/passwd.client.

If y'all sense whatever number alongside exim4, cheque its log file located at /var/log/exim4/mainlog.

Now that an SMTP server is laid up, my next post explains how to redirect local root emails to an Internet electronic mail concern human relationship of your choice.

Berlangganan update artikel terbaru via email:

0 Response to "How To Setup Exim4 On Debian To Operate Gmail"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel