Θελω να κανω ενα debian να με στελνει κατι log στο email μου.
sudo apt-get install exim4
Μετα δινω
sudo dpkg-reconfigure exim4-config

Διαλεγω mail sent by smarthost : received via SMTP or fetchmail



/etc/exim4/update-exim4.conf.conf

Tωρα μετα απο τον παραπανω wizard ολο το configuration ειναι στο αρχειο /etc/exim4/update-exim4.conf.conf 
Δηλαδη αν δωσω  
sudo nano /etc/exim4/update-exim4.conf.conf 
Εχω το παρακατω (φαίνεται που εχω πατησει , τι)
# /etc/exim4/update-exim4.conf.conf
#
# Edit this file and /etc/mailname by hand and execute update-exim4.conf
# yourself or use 'dpkg-reconfigure exim4-config'
#
# Please note that this is _not_ a dpkg-conffile and that automatic changes
# to this file might happen. The code handling this will honor your local
# changes, so this is usually fine, but will break local schemes that mess
# around with multiple versions of the file.
#
# update-exim4.conf uses this file to determine variable values to generate
# exim configuration macros for the configuration file.
#
# Most settings found in here do have corresponding questions in the
# Debconf configuration, but not all of them.
#
# This is a Debian specific file

dc_eximconfig_configtype='smarthost'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1'
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost='smtp.gmail.com:587'
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname='false'
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

/etc/exim4/passwd.client 

Παω τωρα να ρυθμισω και το αρχειο /etc/exim4/passwd.client που περιεχει τον λογαριασμο απο τον οποιο θα αποστέλλετε.
sudo nano /etc/exim4/passwd.client
Μεσα προσθετω την τελευταία γραμμη με τα στοιχεια μου.
# password file used when the local exim is authenticating to a remote
# host as a client.
#
# see exim4_passwd_client(5) for more documentation
#
# Example:
### target.mail.server.example:login:password
*:myemail@gmail.com:mypassword
Κανω ενα restart το service
sudo /etc/init.d/exim4 restart
Και κανω δοκιμη
echo "This is a test." | mail -s Testing koukos@gmail.com

Αν παρω error μήνυμα στην εκκίνηση,ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken

[ ok ] Starting MTA: exim4.
ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail system possibly broken
Τοτε δινω
sudo rm /var/log/exim4/paniclog
μετα
sudo /etc/init.d/exim4 start
Και ξανακανω δοκιμη
echo "This is a test." | mail -s Testing koukos@gmail.com

Για πλήρη επανεγκατάσταση
sudo su
apt-get remove --purge exim4
rm -Rf /etc/exim4/
apt-get install exim4
apt-get -o DPkg::Options::="--force-confmiss" --reinstall install exim4-config

nano /etc/exim4/passwd.client
*.google.com:karanik.smtp@gmail.com:password
Ξαναδίνω στη κονσόλα
echo 'karanik: karanik.smtp@gmail.com' >> /etc/email-addresses
echo 'karanik@localhost: karanik.smtp@gmail.com' >> /etc/email-addresses
echo 'karanik@E6430: karanik.smtp@gmail.com' >> /etc/email-addresses
update-exim4.conf
invoke-rc.d exim4 restart
exim4 -qff

Monitoring logs
sudo tail /var/log/exim4/mainlog -f
Καθάρισμα ουράς
sudo su
exim -bp | awk '/^ *[0-9]+[mhd]/{print "exim -Mrm " $3}' | bash
Για να δω τί υπάρχει στην ουρά
mailq
ή
exim -bp
Για να δω τι κάνει αυτή τι στιγμή ο exim
exiwhat
Για να δω όλες τις ρυθμίσεις του exim
exim -bP