Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: preg_match(): Unknown modifier '-' in /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php on line 783

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794

Warning: Cannot modify header information - headers already sent by (output started at /home/akl1986/public_html/support/wp-content/plugins/redux-framework/redux-core/inc/extensions/metaboxes/class-redux-extension-metaboxes.php:783) in /home/akl1986/public_html/support/wp-includes/rest-api/class-wp-rest-server.php on line 1794
{"id":2574,"date":"2019-12-06T14:39:31","date_gmt":"2019-12-06T14:39:31","guid":{"rendered":"https:\/\/support.aklwebhost.com\/?post_type=manual_kb&p=2574"},"modified":"2019-12-06T14:39:31","modified_gmt":"2019-12-06T14:39:31","slug":"setup-exim-to-send-email-using-gmail-in-debian","status":"publish","type":"manual_kb","link":"https:\/\/support.aklwebhost.com\/knowledgebase\/setup-exim-to-send-email-using-gmail-in-debian\/","title":{"rendered":"Setup Exim to Send Email Using Gmail in Debian"},"content":{"rendered":"

Port 25<\/strong>\u00a0in\u00a0AKLWEB Host<\/strong>\u00a0is blocked by default. If you need to send out email without contacting\u00a0AKLWEB Host support<\/strong>, you can follow this tutorial to setup your\u00a0Exim to send email via Gmail SMTP server.<\/strong><\/p>\n

Install Exim4<\/strong><\/h2>\n
apt-get install exim4\r\n<\/code><\/pre>\n

Configuration<\/strong><\/h2>\n

Run following command to configure Exim4.<\/p>\n

dpkg-reconfigure exim4-config\r\n<\/code><\/pre>\n

Choose this option when asked:\u00a0“mail sent by smarthost; no local mail”<\/strong>.<\/p>\n

Fill in the rest of the fields:<\/strong><\/p>\n

System mail name: YOUR_HOSTNAME\r\nIP-addresses to listen on for incoming SMTP connections: 127.0.0.1 ; ::1\r\nOther destinations for which mail is accepted: <BLANK>\r\nVisible domain name for local users: <BLANK>\r\nIP address or host name of the outgoing smarthost: smtp.gmail.com::587\r\nKeep number of DNS-queries minimal (Dial-on-Demand)? No\r\nSplit configuration into small files? No\r\nRoot and postmaster mail recipient: <BLANK>\r\n<\/code><\/pre>\n

Open and edit\u00a0\/etc\/exim4\/exim4.conf.template<\/code>.<\/p>\n

Search for:<\/strong><\/p>\n

.ifdef DCconfig_smarthost DCconfig_satellite\r\n<\/code><\/pre>\n

Then add these lines after it:<\/strong><\/p>\n

send_via_gmail:\r\n    driver = manualroute\r\n    domains = ! +local_domains\r\n    transport = gmail_smtp\r\n    route_list = * smtp.gmail.com\r\n<\/code><\/pre>\n

Remove other\u00a0smarthost blocks<\/strong>\u00a0that contains\u00a0domains = ! +local_domains<\/code>.<\/p>\n

Search for:<\/p>\n

begin authenticators\r\n<\/code><\/pre>\n

And add\u00a0these lines<\/strong>\u00a0after it:<\/p>\n

gmail_login:\r\n    driver = plaintext\r\n    public_name = LOGIN\r\n    client_send = : YOUR_GMAIL_ACCOUNT@gmail.com : YOUR_GMAIL_PASSWORD\r\n<\/code><\/pre>\n

Remove other\u00a0authenticator blocks<\/strong>\u00a0that contains\u00a0public_name = LOGIN<\/code>.<\/p>\n

Search for:<\/p>\n

transport\/30_exim4-config_remote_smtp_smarthost\r\n<\/code><\/pre>\n

And add these lines after it:<\/p>\n

gmail_smtp:\r\n    driver = smtp\r\n    port = 587\r\n    hosts_require_auth = $host_address\r\n    hosts_require_tls = $host_address\r\n<\/code><\/pre>\n

Save and close\u00a0\/etc\/exim4\/exim4.conf.template<\/code>.<\/p>\n

Apply the new configuration:<\/strong><\/p>\n

update-exim4.conf\r\n<\/code><\/pre>\n

Restart\u00a0Exim4<\/strong>\u00a0service:<\/p>\n

\/etc\/init.d\/exim4 restart\r\n<\/code><\/pre>\n

Testing<\/strong><\/h2>\n

Now send a\u00a0test email using following command:<\/strong><\/p>\n

echo 'Test Message from AKLWEB Host.' | mail -s 'Test Message' YOUR_EMAIL_ADDRESS\r\n<\/code><\/pre>\n

Check\u00a0\/var\/log\/exim4\/mainlog<\/code>\u00a0if any errors occurred. You can now send emails from your\u00a0AKLWEB Host VPS<\/strong>.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[231],"manual_kb_tag":[356],"_links":{"self":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2574"}],"collection":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/comments?post=2574"}],"version-history":[{"count":1,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2574\/revisions"}],"predecessor-version":[{"id":2575,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb\/2574\/revisions\/2575"}],"wp:attachment":[{"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/media?parent=2574"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manualknowledgebasecat?post=2574"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/support.aklwebhost.com\/wp-json\/wp\/v2\/manual_kb_tag?post=2574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}