{"id":2106,"date":"2023-12-19T14:48:09","date_gmt":"2023-12-19T09:18:09","guid":{"rendered":"https:\/\/www.veeble.org\/kb\/?p=2106"},"modified":"2025-03-11T11:34:02","modified_gmt":"2025-03-11T06:04:02","slug":"managing-exim-mail-server-in-linux","status":"publish","type":"post","link":"https:\/\/www.veeble.com\/kb\/managing-exim-mail-server-in-linux\/","title":{"rendered":"Managing Exim Mail Server in Linux"},"content":{"rendered":"\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1.png\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"594\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-1024x594.png\" alt=\"Managing Exim Mail Server in Linux\" class=\"wp-image-2365\" style=\"width:768px;height:auto\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-1024x594.png 1024w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-300x174.png 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-768x446.png 768w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-1536x891.png 1536w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p><a href=\"https:\/\/www.exim.org\/exim-html-current\/doc\/html\/spec_html\/ch-the_exim_monitor.html\" target=\"_blank\" rel=\"noopener\">Exim <\/a>is a popular mail transfer agent (MTA) in <a href=\"https:\/\/en.wikipedia.org\/wiki\/Unix-like#:~:text=Some%20well%2Dknown%20examples%20of,used%20on%20Unix%2Dlike%20systems.\" target=\"_blank\" rel=\"noopener\">Unix-like operating systems<\/a>. Below is a comprehensive KB that covers essential commands for managing Exim on a Linux server. Whether you&#8217;re a system administrator, a web hosting professional, or a Linux enthusiast, this guide is crafted to provide you with a comprehensive set of commands to manage <strong>Exim Mail Queue<\/strong>. <\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"1-checking-exim-mail-version\">1. <strong>Checking Exim mail Version<\/strong><\/h3>\n\n\n<ul class=\"wp-block-list\">\n<li>Verify the installed version of Exim.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -bV\nExim version 4.96.2 #2 built 16-Oct-2023 07:31:34\nCopyright (c) University of Cambridge, 1995 - 2018\n(c) The Exim Maintainers and contributors in ACKNOWLEDGMENTS file, 2007 - 2022\nBerkeley DB: Berkeley DB 5.3.21: (May 11, 2012)\nSupport for: crypteq iconv() IPv6 PAM Perl OpenSSL TLS_resume Content_Scanning DANE DKIM DNSSEC Event I18N OCSP PIPECONNECT PRDR Queue_Ramp SPF SRS\nLookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmjz dbmnz dnsdb dsearch passwd sqlite\nAuthenticators: cram_md5 dovecot plaintext spa\nRouters: accept dnslookup ipliteral manualroute queryprogram redirect\nTransports: appendfile\/maildir autoreply lmtp pipe smtp\nMalware: f-protd f-prot6d drweb fsecure sophie clamd avast sock cmdline\nConfigure owner: 0:0\nSize of off_t: 8\n2023-12-18 21:18:15 cwd=\/home\/nayana 2 args: exim -bV\nConfiguration file is \/etc\/exim.conf\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"display-the-number-of-email-messages-in-the-queue\">2. <strong>Display the number of email messages in the exim mail<\/strong> <strong>queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# <span style=\"background-color: initial;color: var(--ast-global-color-3)\">exim -bpc<\/span>\n30<\/code><\/pre>\n\n\n\n<p>The output &#8220;30&#8221; indicates that there are currently 30 messages in the mail queue awaiting processing or delivery.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"display-information-about-email-messages-in-the-queue\">3. <strong>Display information about email messages in the queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# <span style=\"background-color: initial;color: var(--ast-global-color-3)\">exim -bp<\/span><\/code><\/pre>\n\n\n\n<p>This displays message-id, sender ,recipient, time queued and size.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"display-a-summary-of-messages-in-the-queue\">4. <strong>Display a summary of messages in the exim mail<\/strong> <strong>queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# <span style=\"background-color: initial;color: var(--ast-global-color-3)\">exim -bp | exiqsumm&nbsp;<\/span><\/code><\/pre>\n\n\n\n<p>This will generate a summary report of the mail queue.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2023\/12\/exiqsum1.jpg\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"810\" height=\"679\" src=\"https:\/\/www.veeble.org\/kb\/wp-content\/uploads\/2023\/12\/exiqsum1.jpg\" alt=\"exiqsumm\" class=\"wp-image-2107\" style=\"aspect-ratio:1.1929307805596465;width:403px;height:auto\" srcset=\"https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/12\/exiqsum1.jpg 810w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/12\/exiqsum1-300x251.jpg 300w, https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2023\/12\/exiqsum1-768x644.jpg 768w\" sizes=\"auto, (max-width: 810px) 100vw, 810px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"display-exims-current-activity\">5. <strong>Display Exim\u2019s current activity<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# <span style=\"background-color: initial;color: var(--ast-global-color-3)\">exiwhat<\/span>\n4820 daemon(4.96.2): -q1h, listening for SMTP on port 25 (IPv6 and IPv4) port 587 (IPv6 and IPv4) and for SMTPS on port 465 (IPv6 and IPv4)<\/code><\/pre>\n\n\n\n<p>The exiwhat command serves to present information about the Exim processes that are presently running. In essence, it provides insights into the current state and activity of Exim, shedding light on the daemon processes and their respective configurations.<\/p>\n\n\n\n<p> <mark class=\"annotation-text annotation-text-yoast\" id=\"annotation-text-85035e59-e007-4d49-b1d9-04f70a8d5a31\">This output indicates that Exim is currently running as a daemon, and it is configured to listen for incoming SMTP connections on both IPv6 and IPv4 addresses.<\/mark> <mark class=\"annotation-text annotation-text-yoast\" id=\"annotation-text-6c436686-3fcb-4d5f-b82f-9a8ac1c1643b\">Additionally, it is listening for secure SMTPS connections on port 465.<\/mark> The information provided by <code>exiwhat<\/code> is useful for checking the current state and configuration of the Exim processes.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"6-displays-the-header-details-of-the-particualr-email\">6. Displays the Header details of the particualr email<\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -Mvh 1rFQ98-0001EF-33<\/code><\/pre>\n\n\n\n<p>The <code>exim -Mvh<\/code> command is used to view the headers of a specific message in the Exim mail queue.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"7-displays-the-body-of-the-particular-email\">7. Displays the body of the particular email<\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~#  exim -Mvb 1VcjOL-0002YV-8g<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"8-to-remove-the-mails-in-the-queue-completely\">8. To remove the mails in the queue completely<\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -bp | awk \u2018\/^ *&#91;0-9]+&#91;mhd]\/{print \u201cexim -Mrm \u201d $3}\u2019 | bash<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"9-view-specific-message-in-queue\">9. <strong>View Specific Message in Queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -Mvl 1VcjOL-0002YV-8g\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"10-force-delivery-of-message-in-queue\">10. <strong>Force Delivery of Message in Queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -M 1VcjOL-0002YV-8g\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"11-remove-message-from-queue\">11. <strong>Remove Message from Queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# exim -Mrm 1rFQ98-0001EF-33<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"12-show-exim-main-log\">12. <strong>Show Exim Main Log<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# cat \/var\/log\/exim4\/mainlog\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"13-show-exim-reject-log\">13. <strong>Show Exim Reject Log<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>root@ervintest:~# cat \/var\/log\/exim4\/rejectlog<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"14-view-frozen-messages\">14. <strong>View Frozen Messages<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>exim -bp | grep frozen\n<\/code><\/pre>\n\n\n<h3 class=\"wp-block-heading\" id=\"15-unfreeze-messages-in-the-queue\">15. <strong>Unfreeze Messages in the Queue<\/strong><\/h3>\n\n\n<pre class=\"wp-block-code\"><code>exim -qff\n<\/code><\/pre>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<div class=\"wp-block-uagb-call-to-action uagb-block-771ab710 wp-block-button\"><div class=\"uagb-cta__wrap\"><h3 class=\"uagb-cta__title\">Take Control of Your Hosting with Windows VPS<\/h3><p class=\"uagb-cta__desc\">Gain complete control over your server environment. Customize, configure, and manage your Windows VPS to meet your exact needs.<\/p><\/div><div class=\"uagb-cta__buttons\"><a href=\"https:\/\/www.veeble.com\/in\/windows-vps\/\" class=\"uagb-cta__button-link-wrapper wp-block-button__link\" target=\"_blank\" rel=\"noopener noreferrer\">Get Your VPS Now<svg xmlns=\"https:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\"><path d=\"M504.3 273.6l-112.1 104c-6.992 6.484-17.18 8.218-25.94 4.406c-8.758-3.812-14.42-12.45-14.42-21.1L351.9 288H32C14.33 288 .0002 273.7 .0002 255.1S14.33 224 32 224h319.9l0-72c0-9.547 5.66-18.19 14.42-22c8.754-3.809 18.95-2.075 25.94 4.41l112.1 104C514.6 247.9 514.6 264.1 504.3 273.6z\"><\/path><\/svg><\/a><\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Exim is a popular mail transfer agent (MTA) in Unix-like operating systems. Below is a comprehensive KB that covers essential commands for managing Exim [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":2365,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-2106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux","category-mail"],"uagb_featured_image_src":{"full":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1.png",2048,1188,false],"thumbnail":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-150x150.png",150,150,true],"medium":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-300x174.png",300,174,true],"medium_large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-768x446.png",768,446,true],"large":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-1024x594.png",1024,594,true],"1536x1536":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1-1536x891.png",1536,891,true],"2048x2048":["https:\/\/www.veeble.com\/kb\/wp-content\/uploads\/2024\/01\/Untitled-design-1-1.png",2048,1188,false]},"uagb_author_info":{"display_name":"Nayana Nair","author_link":"https:\/\/www.veeble.com\/kb\/author\/nayana\/"},"uagb_comment_info":0,"uagb_excerpt":"Exim is a popular mail transfer agent (MTA) in Unix-like operating systems. Below is a comprehensive KB that covers essential commands for managing Exim [&hellip;]","_links":{"self":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/2106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/comments?post=2106"}],"version-history":[{"count":7,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/2106\/revisions"}],"predecessor-version":[{"id":8003,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/posts\/2106\/revisions\/8003"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media\/2365"}],"wp:attachment":[{"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/media?parent=2106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/categories?post=2106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veeble.com\/kb\/wp-json\/wp\/v2\/tags?post=2106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}