MEWBIES@:  Facebook  Twitter  G+  YouTube  DeviantArt  Forum  Wall
 SHARE:
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌           -   HOW TO SEND E-MAIL THROUGH SHELL USING EXIM4    -         █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ Bleepty e-mail thing- what a hassle, many hours later I finally have it    ▐▌
 █ working. I only set this up so that the server logs, notices, etc would be ▐▌
 █ auto e-mailed to me. So this tutorial is basic and will have your e-mail   ▐▌
 █ up and sending :). This is how I did it for my Debian.                     ▐▌
 █                                                                            ▐▌
 █ Some notes about the method in this tutorial:                              ▐▌
 █ A. Your password will be saved in a configuration file in plain text, tho  ▐▌
 █ after we'll set it to not world readable. I recommend setting up a test    ▐▌
 █ pop3 account first, such as free gmail as done here.                       ▐▌
 █                                                                            ▐▌
 █ B. The e-mail account you use for the mail program will be accessible to   ▐▌
 █ all users to send from. In the mail sender source will be their user name. ▐▌
 █ Though you can configure this differently - not covered here.              ▐▌
 █                                                                            ▐▌
 █ CONFIGURING OF EXIM4:                                                      ▐▌
 █ DONE- TESTING:                                                             ▐▌
 █ CHECK MAIL IN BOX:                                                         ▐▌
 █ ROOT'S EMAIL FORWARDED TO ANOTHER ACCOUNT:                                 ▐▌
 █ SET PERMS ON FILES:                                                        ▐▌
 █ EXIM4 AUTO RUN AFTER REBOOT:                                               ▐▌
 █ EXIM4 AUTO BCC ALL OUTGOING MAIL:                                          ▐▌
 █ LOG ROTATE:                                                                ▐▌
 █ MAIL NOTES:                                                                ▐▌
 █ TROUBLE SHOOTING:                                                          ▐▌
 █    MY NOTES OF ISSUES TO SOLVE:                                            ▐▌
 █                                                                            ▐▌
 █ CONFIGURING OF EXIM4:                                                      ▐▌
 █ ````````````````````                                                       ▐▌
 █ Set up free gmail account, skip this step if you don't want to:            ▐▌
 █ 1. Sign up to gmail if you don't have one HERE, or adjust/guess the        ▐▌
 █ settings in the configuration section for your own e-mail account. Enable  ▐▌
 █ pop3 settings in your e-mail account- gmail- top right click on settings.  ▐▌
 █                                                                            ▐▌
 █ My preference: Set up gmail in your own local e-mail client to test all    ▐▌
 █ works fine.                                                                ▐▌
 █ I setup and used my new gmail account up in my Window's e-mail client The  ▐▌
 █ Bat! with these POP3 settings, from HERE:                                  ▐▌
 █ Incoming mail (POP3, IMAP or HTTP) server: pop.gmail.com                   ▐▌
 █ Incoming: Connection: Secure to dedicated port (TLS) Port: 995             ▐▌
 █ Outgoing mail (SMTP): smtp.gmail.com                                       ▐▌
 █ Outgoing: Connection: Secure to dedicated port (TLS) Port: 465             ▐▌
 █ Outgoing: Click Authentication, select only 'Perform SMTP Authentication   ▐▌
 █ (RFC 2554)'                                                                ▐▌
 █                                                                            ▐▌
 █ Note: Use outgoing port 465 for TLS. In our mail server on Debian we will  ▐▌
 █ use port 587 for SSL.                                                      ▐▌
 █                                                                            ▐▌
 █ 2. Back to your shell. Cmds are in bold.                                   ▐▌
 █ hostname                                                                   ▐▌
 █ If the reply is similar to:                                                ▐▌
 █ Xu53dx.yourserver.com                                                      ▐▌
 █ Remove the first part 'Xu53dx'.                                            ▐▌
 █ Precede your hostname with smtp, for example: smtp.yourserver.com          ▐▌
 █ Make a note of this, we'll use it in the configuration in step 5.          ▐▌
 █                                                                            ▐▌
 █ 3. View if you have the mail programs exim4 and mutt, and ssl installed:   ▐▌
 █ dpkg -l | grep -E 'exim|mutt|openssl|ssl-cert'                             ▐▌
 █ If you do output will be similar to:                                       ▐▌
 █ exim4              4.69-9           metapackage to ease Exim MTA (v4)      ▐▌
 █ exim4-base         4.69-9           support files for all Exim MTA (v4)    ▐▌
 █ exim4-config       4.69-9           configuration for the Exim MTA (v4)    ▐▌
 █ exim4-daemon-light 4.69-9           lightweight Exim MTA (v4) daemon       ▐▌
 █ mutt               1.5.18-6         text-based mailreader supporting MIME, ▐▌
 █ openssl            0.9.8g-15+lenny6 Secure Socket Layer (SSL) binary and   ▐▌
 █ openssl-blacklist  0.4.2            list of blacklisted OpenSSL RSA keys   ▐▌
 █ sa-exim            4.2.1-11         Use spamAssassin at SMTP time with the ▐▌
 █ ssl-cert           1.0.23           simple debconf wrapper for OpenSSL     ▐▌
 █                                                                            ▐▌
 █ Notes:                                                                     ▐▌
 █ A. mutt is used to mail attachments                                        ▐▌
 █ B. exim4-daemon-light will do the job, you don't need exim4-daemon-heavy   ▐▌
 █ for gmail.                                                                 ▐▌
 █                                                                            ▐▌
 █ 3. Install the programs, remove those on the list below if you have them:  ▐▌
 █ su                                                                         ▐▌
 █ aptitude update                                                            ▐▌
 █ aptitude install exim4 exim4-base exim4-config mutt openssl ssl-cert       ▐▌
 █                                                                            ▐▌
 █ 4. Mine was already installed, so I can't recall if there are prompts, if  ▐▌
 █ there are say yes or select the default answers.                           ▐▌
 █                                                                            ▐▌
 █ 5. After installing is complete we need to configure exim.                 ▐▌
 █ dpkg-reconfigure exim4-config                                              ▐▌
 █ The Package configuration will launch. To navigate in this window use your ▐▌
 █ arrow keys to select/highlight your answer and then hit your enter key. If ▐▌
 █ you make a mistake or want to change something later, just run it again.   ▐▌
 █                                                                            ▐▌
 █ These are the settings to select:                                          ▐▌
 █ Select: 'Choose mail sent by smarthost; received via SMTP or fetchmail'    ▐▌
 █ Type in your host name: smtp.youserver.com then select OK, hit enter.      ▐▌
 █ IP-addresses to listen on for incoming SMTP connections:  127.0.0.1        ▐▌
 █ Other destinations for which mail is accepted: 'Leave blank'               ▐▌
 █ Machines to relay mail for: 'Leave blank'                                  ▐▌
 █ IP address or host name of the outgoing smarthost: smtp.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 mail: mbox format in /var/mail/                  ▐▌
 █ Split configuration into small files?: No                                  ▐▌
 █                                                                            ▐▌
 █ Finished with package configuration, you'll see output similar to:         ▐▌
 █ Stopping MTA for restart: exim4_listener.                                  ▐▌                             
 █ Restarting MTA: exim4.                                                     ▐▌
 █                                                                            ▐▌
 █ 6. Create a self signed SSL cert:                                          ▐▌
 █ /usr/share/doc/exim4-base/examples/./exim-gencert                          ▐▌
 █ Output will prompt you with a few questions, here is my example reply:     ▐▌
 █ Country Code (2 letters) [US]:RU                                           ▐▌
 █ State or Province Name (full name) []:mewbies town                         ▐▌
 █ Locality Name (eg, city) []:mewbies town                                   ▐▌
 █ Organization Name (eg, company; recommended) []:mewbies                    ▐▌
 █ Organizational Unit Name (eg, section) []:mewbies                          ▐▌
 █ Server name (eg. ssl.domain.tld; required!!!) []: ssl.yourserver.com       ▐▌
 █ Email Address []:your@gmail.com                                            ▐▌
 █                                                                            ▐▌
 █ 7. Create a new file to enable TLS:                                        ▐▌
 █ pico /etc/exim4/exim4.conf.localmacros                                     ▐▌
 █ paste in:                                                                  ▐▌
 █ MAIN_TLS_ENABLE = true                                                     ▐▌
 █                                                                            ▐▌
 █ 8. Now to enter the settings for your gmail account:                       ▐▌
 █ pico /etc/exim4/exim4.conf.template                                        ▐▌
 █ A. Search for (Ctrl+w): .ifdef DCconfig_smarthost DCconfig_satellite       ▐▌
 █ Add this at the beginning of the settings, after this line                 ▐▌
 █ '# here so that mail to relay_domains is handled separately':              ▐▌
send_via_gmail:
   driver = manualroute
   domains = ! +local_domains
   transport = gmail_smtp
   route_list = * smtp.gmail.com
 █                                                                            ▐▌
 █ B. Search for (including the colon): smarthost:                            ▐▌
 █ You should find one just below where you entered your new settings in      ▐▌
 █ step A.                                                                    ▐▌
 █ You need to comment out (precede lines with a # so that they are not read) ▐▌
 █ any sections that that define 'smarthost:' settings (not                   ▐▌
 █ hub_user_smarthost: or remote_smtp_smarthost:).                            ▐▌
 █ This is how mine is after commenting the lines out:                        ▐▌
 █ #smarthost:                                                                ▐▌
 █ #  debug_print = "R: smarthost for $local_part@$domain"                    ▐▌
 █ #  driver = manualroute                                                    ▐▌
 █ #  domains = ! +local_domains                                              ▐▌
 █ #  transport = remote_smtp_smarthost                                       ▐▌
 █ #  route_list = * DCsmarthost byname                                       ▐▌
 █ #  host_find_failed = defer                                                ▐▌
 █ #  same_domain_copy_routing = yes                                          ▐▌
 █ #  no_more                                                                 ▐▌
 █                                                                            ▐▌
 █ .endif                                                                     ▐▌
 █                                                                            ▐▌
 █ C. Search for: # transport/30_exim4-config_remote_smtp_smarthost           ▐▌
 █ (you'll find it twice back to back), add this at the end of the section    ▐▌
 █ just after .endif:                                                         ▐▌
gmail_smtp:
   driver = smtp
   port = 587
   hosts_require_auth = $host_address
   hosts_require_tls = $host_address
 █                                                                            ▐▌
 █ D. Search for: begin authenticators                                        ▐▌
 █ add this below it, changing only user@gmail.com and gmail_password to be   ▐▌
 █ your own:                                                                  ▐▌
gmail_login:
   driver = plaintext
   public_name = LOGIN
   client_send = : user@gmail.com : gmail_password
 █                                                                            ▐▌
 █ E. Search for any 'un-commented': public_name = LOGIN                      ▐▌
 █ Mine had one in the example section toward the end of the file.            ▐▌
 █ Comment out the entire section for it, from login: to .endif, for example: ▐▌
 █ #login:                                                                    ▐▌
 █ #  driver = plaintext                                                      ▐▌
 █ #  public_name = LOGIN                                                     ▐▌
 █ <snip>                                                                     ▐▌
 █ #                ; ${sg{PASSWDLINE}{\\N([^:]+:)(.*)\\N}{\\$2}}"            ▐▌
 █ #.endif                                                                    ▐▌
 █                                                                            ▐▌
 █ F. Done, save changes.                                                     ▐▌
 █                                                                            ▐▌
 █ 9. Load changes to exim4 configuration file:                               ▐▌
 █ update-exim4.conf                                                          ▐▌
 █ If no reply - all went well.                                               ▐▌
 █                                                                            ▐▌
 █ If the output contained an error, examine it for the reason, then search   ▐▌
 █ for that "reason" in the file. For example if your error stated:           ▐▌
 █ "client_send" option set for the second time                               ▐▌
 █ search file for client_send and comment that section out, and reload file. ▐▌
 █                                                                            ▐▌
 █ 10. Restart the exim4 server:                                              ▐▌
 █ /etc/init.d/exim4 restart                                                  ▐▌
 █ Output:                                                                    ▐▌
 █ Stopping MTA for restart: exim4_listener.                                  ▐▌
 █ Restarting MTA: exim4.                                                     ▐▌
 █                                                                            ▐▌
 █ If the output contains:                                                    ▐▌
 █ ALERT: exim paniclog /var/log/exim4/paniclog has non-zero size, mail       ▐▌
 █ system possibly broken failed!                                             ▐▌
 █ Then view the file, it could just be the errors from earlier if you had    ▐▌
 █ any when you loaded the changes:                                           ▐▌
 █ pico /var/log/exim4/paniclog                                               ▐▌
 █ If it is the same error that you have fixed already, you can remove        ▐▌
 █ everything in that file so you don't keep getting an old solved alert.     ▐▌
 █                                                                            ▐▌
 █ 11. Done :) Time to test sending an e-mail to one of your own existing     ▐▌
 █ accounts that you can check:                                               ▐▌
 █ If you are root still:                                                     ▐▌
 █ exit                                                                       ▐▌
 █ Enter these lines, hitting enter key after each line including the '.'     ▐▌
 █ which ends the message body section:                                       ▐▌
 █ mail -s Test01 to-addr youremail@yourown.com                               ▐▌
 █ This is a test send.                                                       ▐▌
 █ .                                                                          ▐▌
 █ CC: leave blank or enter address to test it on                             ▐▌
 █                                                                            ▐▌
 █ Now go check your e-mail/s of the account you sent the mail to.            ▐▌
 █ It should be there :) It will be addressed to the e-mail you sent it to    ▐▌
 █ and to to-addr@yourserver.com                                              ▐▌
 █ (to send just to your recipient: mail -s Test01 youremail@yourown.com )    ▐▌
 █ To view what happened:                                                     ▐▌
 █ tail -20 /var/log/exim4/mainlog                                            ▐▌
 █                                                                            ▐▌
 █ 12. To check if you have mail on your shell:                               ▐▌
 █ mail                                                                       ▐▌
 █ Enter the number of the mail msg you want to read, for example:            ▐▌
 █ 1                                                                          ▐▌
 █ q will leave msg 1, hit enter for next msg                                 ▐▌
 █ To delete message 1-10 for example:                                        ▐▌
 █ d 1-10                                                                     ▐▌
 █ Hit enter again to read next, or to quit, type in: quit                    ▐▌
 █                                                                            ▐▌
 █ 13. To have root's e-mail sent to another account:                         ▐▌ 
 █  pico /etc/aliases                                                         ▐▌    
 █  The last line where it has:                                               ▐▌    
 █  root: admnin1                                                             ▐▌    
 █  Change to your user name, for example:                                    ▐▌    
 █  root: mewbies                                                             ▐▌    
 █  Or you could assign an e-mail:                                            ▐▌    
 █  root: youremail@whatever.com                                              ▐▌    
 █  Or both:                                                                  ▐▌    
 █  root: mewbies, youremail@whatever.com                                     ▐▌    
 █                                                                            ▐▌
 █ 14. Set permissions on files so they aren't world readable:                ▐▌
 █ su                                                                         ▐▌
 █ chmod 640 /etc/exim4/exim4.conf.localmacros                                ▐▌
 █ chmod 640 /etc/exim4/exim4.conf.template                                   ▐▌
 █ chmod 640 /etc/exim4/sa-exim.conf                                          ▐▌
 █ chmod 640 /etc/exim4/system_filter.exim                                    ▐▌
 █ chmod 640 /etc/exim4/update-exim4.conf.conf                                ▐▌
 █                                                                            ▐▌
 █ Test users mail is still working OK. If you get an error and feel it is    ▐▌
 █ because of the permission settings, try setting back the permissions- all  ▐▌
 █ were previously chmod 644.                                                 ▐▌
 █                                                                            ▐▌
 █ 15. Exim auto run after reboot:                                            ▐▌
 █ To have exim4 auto run after rebooting the machine you'll need to either:  ▐▌
 █ Manually add it to the sysv-rc-conf list; shows what will be started on    ▐▌
 █ reboot:                                                                    ▐▌
 █ sysv-rc-conf                                                               ▐▌
 █ If you don't have sysv-rc-conf: aptitude install sysv-rc-conf              ▐▌
 █ Navigate using arrow key, use space key to toggle an item on [X] or off [ ]▐▌
 █ For exim4 it probably has this:                                            ▐▌
 █  exim4       [ ]     [ ]     [ ]     [ ]     [ ]    [ ]     [ ]     [ ]    ▐▌
 █ Toggle on 2-5 so that it is:                                               ▐▌
 █  exim4       [ ]     [X]     [X]     [X]     [X]    [ ]     [ ]     [ ]    ▐▌
 █ To quit and save your changes to sysv-rc-conf: q                           ▐▌
 █                                                                            ▐▌
 █ Or you can simply issue that with a cmd:                                   ▐▌
 █ sysv-rc-conf exim4 on                                                      ▐▌
 █ Which will toggle on 2-5.                                                  ▐▌
 █ To remove it from the start up list: sysv-rc-conf exim4 off                ▐▌
 █ To view the list: sysv-rc-conf --list                                      ▐▌
 █                                                                            ▐▌
 █ EXIM4 AUTO BCC ALL OUTGOING MAIL:                                          ▐▌
 █ `````````````````````````````````                                          ▐▌
 █ If you would like to audit all your users outgoing e-mail and have it auto ▐▌
 █ BCC (receive a copy of all outgoing e-mail) to a specified account you     ▐▌
 █ need to set up a system filter.                                            ▐▌
 █ Here is how:                                                               ▐▌
 █ 1. Create the file if it doesn't exist already:                            ▐▌
 █ su                                                                         ▐▌
 █ pico /etc/exim4/system_filter.exim                                         ▐▌
 █ Paste in, change the e-mail address to where you want a BCC sent to:       ▐▌
 █ unseen deliver audit@youremail.com                                         ▐▌
 █                                                                            ▐▌
 █ Add this line also if you want failed messages sent to you:                ▐▌
 █ errors_to audit@youremail.com                                              ▐▌
 █                                                                            ▐▌
 █ Notes:                                                                     ▐▌
 █ A. If you change 'unseen' to 'seen' the original recipients will be        ▐▌
 █ ignored - meaning all e-mail no matter the recipients address will be sent ▐▌
 █ to your 'seen' address.                                                    ▐▌
 █                                                                            ▐▌
 █ B. To save a copy of all outgoing e-mail locally view this article HERE.   ▐▌
 █ (If that article disapears let me know as I've saved it.)                  ▐▌
 █                                                                            ▐▌
 █ C. Making changes to only to system_filer.exim does not require a          ▐▌
 █ reloading of config nor restarting of the server.                          ▐▌
 █                                                                            ▐▌
 █ 2. Add the file to the config:                                             ▐▌
 █ pico /etc/exim4/exim4.conf.template                                        ▐▌
 █ Search for (beginning section of the file): LOCAL_DELIVERY=mail_spool      ▐▌
 █ Has this:                                                                  ▐▌
 █ LOCAL_DELIVERY=mail_spool                                                  ▐▌
 █ .endif                                                                     ▐▌
 █                                                                            ▐▌
 █ After the .endif paste this in:                                            ▐▌
 █ system_filter = /etc/exim4/system_filter.exim                              ▐▌
 █                                                                            ▐▌
 █ 3. Load the changes:                                                       ▐▌
 █ Reload the config:                                                         ▐▌
 █ update-exim4.conf                                                          ▐▌
 █ Restart the server:                                                        ▐▌
 █ /etc/init.d/exim4 restart                                                  ▐▌
 █ Leave root:                                                                ▐▌
 █ exit                                                                       ▐▌
 █ Test it:                                                                   ▐▌
 █ mail -s Test_Unseen whatever@youremail.com                                 ▐▌
 █ View what it did:                                                          ▐▌
 █ tail -20 /var/log/exim4/mainlog                                            ▐▌
 █                                                                            ▐▌
 █ I was unable to figure out how to Auto 'CC' all outgoing e-mail with a     ▐▌
 █ filter. If you know, please post it a mewbies forum :).                    ▐▌
 █                                                                            ▐▌
 █ More information about other auto forwarding options HERE, HERE, HERE, and ▐▌
 █ HERE.                                                                      ▐▌
 █                                                                            ▐▌
 █ LOG ROTATE:                                                                ▐▌
 █ ```````````                                                                ▐▌
 █ If you would like to change the default settings on exim4's log rotation   ▐▌
 █ continue, if not skip this.                                                ▐▌
 █ The paniclog is set to rotate after it reaches 10MB and the mainlog (and   ▐▌
 █ reject log) daily. Both are set to keep backup compressed logs up to 10.   ▐▌
 █ To change these settings (read more HERE):                                 ▐▌
 █ pico /etc/logrotate.d/exim4-paniclog                                       ▐▌
 █ Has this:                                                                  ▐▌
 █ /var/log/exim4/paniclog {                                                  ▐▌
 █         size 10M                                                           ▐▌
 █         missingok                                                          ▐▌
 █         rotate 10                                                          ▐▌
 █         compress                                                           ▐▌
 █         delaycompress                                                      ▐▌
 █         notifempty                                                         ▐▌
 █         create 640 Debian-exim adm                                         ▐▌
 █ }                                                                          ▐▌
 █                                                                            ▐▌
 █ For example I wanted mine to rotate at 5KB, leave 1 compressed log, and    ▐▌
 █ rotate even if it is 0 bytes, so I changed it to:                          ▐▌
 █ /var/log/exim4/paniclog {                                                  ▐▌
 █         size 5k                                                            ▐▌
 █         missingok                                                          ▐▌
 █         rotate 1                                                           ▐▌
 █         compress                                                           ▐▌
 █         delaycompress                                                      ▐▌
 █         create 640 Debian-exim adm                                         ▐▌
 █ }                                                                          ▐▌
 █                                                                            ▐▌
 █ And the mainlog:                                                           ▐▌
 █ pico /etc/logrotate.d/exim4-base                                           ▐▌
 █                                                                            ▐▌
 █ To test the rotation without actually executing it:                        ▐▌
 █ logrotate --debug --force /etc/logrotate.d/exim4-paniclog                  ▐▌
 █ logrotate --debug --force /etc/logrotate.d/exim4-base                      ▐▌
 █                                                                            ▐▌
 █ If you would like to manually execute the rotation:                        ▐▌
 █ logrotate --force -v /etc/logrotate.d/exim4-paniclog                       ▐▌
 █ logrotate --force -v /etc/logrotate.d/exim4-base                           ▐▌
 █                                                                            ▐▌
 █ If you reduced how many compressed archives to keep (rotate 10) you'll     ▐▌
 █ need to remove the older ones or they will be left:                        ▐▌
 █ rm /var/log/exim4/mainlog.*.gz                                             ▐▌
 █                                                                            ▐▌
 █ MAIL NOTES:                                                                ▐▌
 █ ```````````                                                                ▐▌
 █ To mail with an attachment (mycat.jpg) and the body of the message would   ▐▌
 █ be myletter.txt:                                                           ▐▌
 █ mutt -s Test Subject -a /images/mycat.jpg dog@whater.com < myletter.txt    ▐▌
 █                                                                            ▐▌
 █ type for more switches: mail --help                                        ▐▌
 █ or: man mail                                                               ▐▌
 █                                                                            ▐▌
 █ View size of Mail box:                                                     ▐▌
 █ du -hsc mbox                                                               ▐▌
 █ or                                                                         ▐▌
 █ du -hsc Mail                                                               ▐▌
 █                                                                            ▐▌
 █ Each time you make changes to 'dpkg-reconfigure exim4-config' or           ▐▌
 █ '/etc/exim4/exim4.conf.template' you need to load the changes              ▐▌
 █ 'update-exim4.conf' and you should restart the exim4 server to fully test  ▐▌
 █ the changes '/etc/init.d/exim4 restart'.                                   ▐▌
 █                                                                            ▐▌
 █ List the exim4 files:                                                      ▐▌
 █ ls -al /etc/exim4/                                                         ▐▌
 █ ls -al /usr/share/doc/exim4-base                                           ▐▌
 █ ls -al /etc/mail/                                                          ▐▌
 █ cat /etc/email-addresses                                                   ▐▌
 █                                                                            ▐▌
 █ The exim logs are here:                                                    ▐▌
 █ ls -al /var/log/exim4/                                                     ▐▌
 █ The main mail log, that you should refer to for trouble shooting:          ▐▌
 █ cat /var/log/exim4/mainlog                                                 ▐▌
 █ or: tail -20 /var/log/exim4/mainlog                                        ▐▌
 █                                                                            ▐▌
 █ View the quantity of messages in the queue:                                ▐▌
 █ exim4 -bpc                                                                 ▐▌
 █                                                                            ▐▌
 █ List all the messages in the queue:                                        ▐▌
 █ mailq                                                                      ▐▌
 █ To delete frozen messages:                                                 ▐▌
 █ mailq | grep 'frozen' | awk '{print $3}' | xargs exim4 -Mrm                ▐▌
 █                                                                            ▐▌
 █ View undelivered messages:                                                 ▐▌
 █ exim4 -bpu                                                                 ▐▌
 █                                                                            ▐▌
 █ View exim processes:                                                       ▐▌
 █ exiwhat                                                                    ▐▌
 █                                                                            ▐▌
 █ View current activity:                                                     ▐▌
 █ exim4 -bp | exiqsumm                                                       ▐▌
 █                                                                            ▐▌
 █ Exim stats:                                                                ▐▌
 █ eximstats --help                                                           ▐▌
 █ for example:                                                               ▐▌
 █ eximstats -nr /var/log/exim4/mainlog                                       ▐▌
 █                                                                            ▐▌
 █ etc-email-addresses information HERE.                                      ▐▌
 █                                                                            ▐▌
 █ TROUBLE SHOOTING:                                                          ▐▌
 █ `````````````````                                                          ▐▌
 █ Test if your server is able to connect out to gmail.com or google.com:     ▐▌
 █ lynx http://www.google.com                                                 ▐▌
 █                                                                            ▐▌
 █ Error option "*" unknown, such as option "system_filter" unknown           ▐▌
 █ Possible reason is you have added that option in the wrong section of your ▐▌
 █ /etc/exim4/exim4.conf.template                                             ▐▌
 █                                                                            ▐▌
 █ Mail immediately bounces back to your shell in box stating:                ▐▌
 █ A message that you sent could not be delivered to one or more of its       ▐▌
 █ recipients. This is a permanent error. The following address(es) failed:   ▐▌
 █ to-addr@yourserver.com                                                     ▐▌
 █ Mailing to remote domains not supported                                    ▐▌
 █ You might not have entered your correct hostname during 'dpkg-reconfigure  ▐▌
 █ exim4-config' or your /etc/exim4/exim4.conf.template isn't configured      ▐▌
 █ correctly for mailing outside of your server.                              ▐▌
 █                                                                            ▐▌
 █ Possible errors in /var/log/exim4/mainlog with possible reasons-           ▐▌
 █ Most likely SSL/TLS Authentication isn't configured correctly:             ▐▌
 █ Remote host mail.gmx.net [213.165.64.20] closed connection in response to  ▐▌
 █ initial connection                                                         ▐▌
 █                                                                            ▐▌
 █ You've sent your e-mail, no errors, no warning in your mail about it, but  ▐▌
 █ your recipients never received it:                                         ▐▌
 █ cat /var/log/exim4/mainlog                                                 ▐▌
 █ Some of the errors mainlog might contain and why-                          ▐▌
 █ Possibly a port setting is incorrect in config file or your firewall could ▐▌
 █ be blocking you:                                                           ▐▌
 █ SMTP timeout while connected to gmail-smtp-msa.l.google.com                ▐▌
 █ [74.125.65.109] after initial connection: Connection timed out             ▐▌
 █ R=send_via_gmail T=gmail_smtp defer (-53): retry time not reached for any  ▐▌
 █ host                                                                       ▐▌
 █                                                                            ▐▌
 █ This means that is has failed sending your recipients, though it will keep ▐▌
 █ trying 4-5 days:                                                           ▐▌
 █ (-53): retry time not reached for any host                                 ▐▌
 █ Message is frozen                                                          ▐▌
 █                                                                            ▐▌
 █ To force a queue to try again whether frozen or not: exim -qff             ▐▌
 █ To skip the frozen ones: exim -qf                                          ▐▌
 █ Here you can set how many minutes until it retries the mail queue:         ▐▌
 █ cat /etc/default/exim4                                                     ▐▌
 █ QUEUEINTERVAL='30m'                                                        ▐▌
 █                                                                            ▐▌
 █ Check HERE if your server's IP is blacklisted on many of the list. Note-   ▐▌
 █ mine is listed, but I'm able to send mail out just fine, so don't take     ▐▌
 █ that as it must be the reason you can't send if you find your server's IP  ▐▌
 █ on the list.                                                               ▐▌
 █                                                                            ▐▌
 █ MY NOTES OF ISSUES TO SOLVE:                                               ▐▌
 █ 1. How to save passwords encrypted only in all files.                      ▐▌
 █ 2. How to auto save sent msg in x folder with x name.                      ▐▌
 █ 3. Settings for gmx.net 'User ID'.                                         ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ //----------------------------------------------------------------------   ▐▌
 █                                                                            ▐▌
 █ If you find mistakes, have suggestions, and or questions please post at    ▐▌
 █ mewbies forum HERE - thank you.                                            ▐▌
 █                                                                            ▐▌
 █ Last update on 29 Jun '10                                                  ▐▌
 █                                                                            ▐▌
 █▌                                                                           █▌
  █▌                          -   mewbies.com   -                            █▌
   █▌                                                                       █▌
    ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██