exim4:install_exim4_complete
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:install_exim4_complete [2016/11/08 15:01] – peter | exim4:install_exim4_complete [2020/07/25 16:30] (current) – old revision restored (2016/11/08 11:39) 92.220.10.100 | ||
---|---|---|---|
Line 12: | Line 12: | ||
<WRAP alert> | <WRAP alert> | ||
- | There are less than 9999 days left before the Unix / Linux 32-bit date wrap-around occurs. | + | Less than 9999 days exist before the Unix / Linux 32-bit date wrap-around occurs. |
- | + | ||
- | This can result in the days being calculated as a negative date. It would be safer to use a more meaningful number of days. | + | |
</ | </ | ||
Line 47: | Line 45: | ||
pw useradd exim -c " | pw useradd exim -c " | ||
exit | exit | ||
- | cat /etc/passwd | grep exim | + | cat /etc/passwd | grep exim -d / |
+ | exit | ||
+ | cat /etc/passwd | pw useradd exim -c " | ||
+ | exit | ||
+ | cat /etc/passwd | grep exim | ||
+ | pw useradd exim -c " | ||
+ | exit | ||
+ | cat /etc/passwd | grep exim exim: | ||
</ | </ | ||
Line 65: | Line 70: | ||
<code bash> | <code bash> | ||
- | ee Local/ | + | $ ee Local/ |
</ | </ | ||
Line 114: | Line 119: | ||
To find the path to library files and MySQL headers, execute: | To find the path to library files and MySQL headers, execute: | ||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Usage: / | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | | ||
- | </ | ||
- | |||
- | |||
- | These values are substituted into the lines below ... | ||
- | |||
- | <file bash> | ||
- | # LOOKUP_INCLUDE = -I / | ||
- | # LOOKUP_LIBS = -L / | ||
- | |||
- | on | ||
- | |||
- | LOOKUP_INCLUDE = -I / | ||
- | LOOKUP_LIBS = -L / | ||
- | |||
- | EXIM_MONITOR = eximon.bin | ||
- | on | ||
- | |||
- | # EXIM_MONITOR = eximon.bin | ||
- | Here, we turn off support for Exim Monitor. | ||
- | |||
- | For Exim Monitor requires X11, contact is not used. | ||
- | |||
- | # WITH_CONTENT_SCAN = yes | ||
- | on | ||
- | |||
- | WITH_CONTENT_SCAN = yes | ||
- | |||
- | # WITH_OLD_DEMIME = yes | ||
- | on | ||
- | |||
- | WITH_OLD_DEMIME = yes | ||
- | Here we include an option that will help Exim work with ClamAV and Spamassassin. | ||
- | |||
- | # AUTH_CRAM_MD5 = yes | ||
- | # AUTH_PLAINTEXT = yes | ||
- | on | ||
- | |||
- | AUTH_CRAM_MD5 = yes | ||
- | AUTH_PLAINTEXT = yes | ||
- | Here we include of SMTP-authentication support for PLAIN and CRAM-MD5. | ||
- | |||
- | # SUPPORT_TLS = yes | ||
- | on | ||
- | |||
- | SUPPORT_TLS = yes | ||
- | Here we include TLS / SSL support for secure connection. | ||
- | |||
- | # TLS_LIBS = -lssl -lcrypto | ||
- | on | ||
- | |||
- | TLS_LIBS = -lssl -lcrypto | ||
- | Here we specify the names of libraries for TLS / SSL. | ||
- | |||
- | # LOG_FILE_PATH = / | ||
- | on | ||
- | |||
- | LOG_FILE_PATH = / | ||
- | Putting log files to a separate directory. | ||
- | |||
- | EXICYCLOG_MAX = 10 | ||
- | on | ||
- | |||
- | EXICYCLOG_MAX = 20 | ||
- | Number of saved log files do I increase to 20 in the event debriefing with his superiors: " | ||
- | |||
- | # EXIM_PERL = perl.o | ||
- | on | ||
- | |||
- | EXIM_PERL = perl.o | ||
- | Here we include support perl, to ensure the use of Perl-compatible regular expressions, | ||
- | |||
- | # CHOWN_COMMAND = / | ||
- | on | ||
- | |||
- | CHOWN_COMMAND = / | ||
- | Here we specify the correct path to the chown command. | ||
- | |||
- | # SUPPORT_MOVE_FROZEN_MESSAGES = yes | ||
- | on | ||
- | |||
- | SUPPORT_MOVE_FROZEN_MESSAGES = yes | ||
- | Here we include support for the automatic movement " | ||
- | </ | ||
- | |||
- | |||
- | Save the changes. | ||
- | |||
- | <code bash> | ||
- | make | ||
- | su | ||
- | make install | ||
- | </ | ||
- | |||
- | After the installation is complete, you need to create a symbolic link, this will do the following: | ||
- | |||
- | <code bash> | ||
- | ln -fs / | ||
- | ln -fs / | ||
- | ln -fs / | ||
- | ln -fs / | ||
- | </ | ||
- | |||
- | After that you want to remove from the object files Exim table name and line number information for this issue: | ||
- | |||
- | <code bash> | ||
- | strip / | ||
- | exit | ||
- | </ | ||
- | |||
- | Before configuring Exim, you need to create a database, the user and the appropriate table for this issue: | ||
- | |||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Welcome to the MySQL monitor. | ||
- | Your MySQL connection id is 3760 to server version: 4.1.10a-log | ||
- | |||
- | Type ' | ||
- | |||
- | mysql> | ||
- | </ | ||
- | |||
- | Create the database. | ||
- | |||
- | <code mysql> | ||
- | mysql> CREATE DATABASE exim; | ||
- | mysql> GRANT ALL PRIVILEGES ON exim.* TO sqlmail@localhost | ||
- | -> IDENTIFIED BY ' | ||
- | mysql> quit | ||
- | </ | ||
- | |||
- | When the database and user created, you need to create the table structure, and enter data about users. | ||
- | |||
- | <code bash> | ||
- | ee exim.sql | ||
- | </ | ||
- | |||
- | <file bash exim.sql> | ||
- | # Create the aliases table. | ||
- | CREATE TABLE aliases ( | ||
- | local_part varchar(64) NOT NULL default '', | ||
- | domain varchar(128) NOT NULL default ' | ||
- | recipients text, | ||
- | PRIMARY KEY (local_part, | ||
- | ); | ||
- | |||
- | # Populate the aliases table. | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | INSERT INTO aliases VALUES (' | ||
- | |||
- | # Create the domains table. | ||
- | CREATE TABLE domains ( | ||
- | domain varchar(128) NOT NULL default '', | ||
- | type enum(' | ||
- | PRIMARY KEY (domain) | ||
- | ); | ||
- | |||
- | # Populate the domains table. | ||
- | INSERT INTO domains VALUES (' | ||
- | |||
- | # Create the userforward table. | ||
- | CREATE TABLE userforward ( | ||
- | local_part varchar(64) NOT NULL default '', | ||
- | domain varchar(128) NOT NULL default '', | ||
- | recipients text, | ||
- | PRIMARY KEY (local_part, | ||
- | ); | ||
- | |||
- | # Create the users table. | ||
- | CREATE TABLE users ( | ||
- | login varchar(64) NOT NULL default '', | ||
- | name varchar(128) NOT NULL default '', | ||
- | password varchar(64) NOT NULL default '', | ||
- | decrypt varchar(64) NOT NULL default '', | ||
- | uid int(10) unsigned default ' | ||
- | gid int(10) unsigned default ' | ||
- | domain varchar(128) NOT NULL default ' | ||
- | quota tinyint(4) default ' | ||
- | status enum(' | ||
- | PRIMARY KEY (login, | ||
- | ); | ||
- | </ | ||
- | |||
- | Create the tables, data, and the first user. | ||
- | |||
- | <code mysql> | ||
- | / | ||
- | mysql> \. exim.sql | ||
- | mysql> INSERT INTO users (login, | ||
- | -> VALUES (' | ||
- | mysql> quit | ||
- | </ | ||
- | |||
- | It's time now to configure Exim. Go to the directory where configuration file and do the following: | ||
- | |||
- | <code bash> | ||
- | cd / | ||
- | su | ||
- | mv configure configure.default | ||
- | </ | ||
- | |||
- | Edit the configuration file. | ||
- | |||
- | <code bash> | ||
- | ee configure | ||
- | </ | ||
- | |||
- | and populate as: | ||
- | |||
- | <file exim configure> | ||
- | ###################################################################### | ||
- | # Runtime configuration file for Exim # | ||
- | ###################################################################### | ||
- | ####################################################################### | ||
- | # MAIN CONFIGURATION SETTINGS | ||
- | ###################################################################### | ||
- | |||
- | primary_hostname = sharewiz.net | ||
- | domainlist local_domains = ${lookup mysql{SELECT domain FROM domains \ | ||
- | WHERE domain=' | ||
- | (type=' | ||
- | domainlist relay_to_domains = ${lookup mysql{SELECT domain FROM domains \ | ||
- | WHERE domain=' | ||
- | hostlist | ||
- | auth_advertise_hosts = * | ||
- | daemon_smtp_ports = 25 : 465 | ||
- | tls_on_connect_ports = 465 | ||
- | tls_advertise_hosts = * | ||
- | tls_certificate = / | ||
- | tls_privatekey = / | ||
- | log_selector = \ | ||
- | +all_parents \ | ||
- | +lost_incoming_connection \ | ||
- | +received_sender \ | ||
- | +received_recipients \ | ||
- | +smtp_confirmation \ | ||
- | +smtp_syntax_error \ | ||
- | +smtp_protocol_error \ | ||
- | -queue_run | ||
- | acl_smtp_rcpt = acl_check_rcpt | ||
- | acl_smtp_mime = acl_check_mime | ||
- | qualify_domain = sharewiz.net | ||
- | allow_domain_literals = false | ||
- | never_users = root | ||
- | host_lookup = * | ||
- | rfc1413_hosts = * | ||
- | rfc1413_query_timeout = 0s | ||
- | ignore_bounce_errors_after = 30m | ||
- | timeout_frozen_after = 3d | ||
- | freeze_tell = postmaster | ||
- | message_size_limit = 10M | ||
- | smtp_accept_max = 100 | ||
- | smtp_accept_max_per_connection = 5 | ||
- | smtp_accept_max_per_host = 2 | ||
- | split_spool_directory = true | ||
- | remote_max_parallel = 15 | ||
- | smtp_banner = " | ||
- | This system does not accept Unsolicited \ | ||
- | Commercial Email\nand will blacklist \ | ||
- | offenders via our spam processor.\nHave a \ | ||
- | nice day!\n\n${primary_hostname} ESMTP" | ||
- | |||
- | hide mysql_servers = localhost/ | ||
- | |||
- | ###################################################################### | ||
- | # ACL CONFIGURATION | ||
- | # | ||
- | ###################################################################### | ||
- | begin acl | ||
- | |||
- | acl_check_rcpt: | ||
- | |||
- | accept | ||
- | |||
- | deny domains | ||
- | local_parts | ||
- | |||
- | deny domains | ||
- | local_parts | ||
- | |||
- | accept | ||
- | domains | ||
- | |||
- | require verify | ||
- | |||
- | deny message | ||
- | condition | ||
- | |||
- | deny message | ||
- | condition | ||
- | {bezeqint\\.net|net\\.il|dialup|dsl|pool|peer|dhcp} \ | ||
- | {yes}{no}} | ||
- | |||
- | deny message | ||
- | $sender_host_address is in a black list at $dnslist_domain\n$dnslist_text | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | $sender_host_address rejected - see http:// | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | $sender_host_address for bad WHOIS info, see http:// | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | is in a black list at $dnslist_domain\n$dnslist_text | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | is in a black list at $dnslist_domain\n$dnslist_text | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | http:// | ||
- | log_message | ||
- | dnslists | ||
- | deny message | ||
- | Open Proxy, see: $dnslist_domain\n$dnslist_text | ||
- | log_message | ||
- | dnslists | ||
- | |||
- | accept | ||
- | endpass | ||
- | message | ||
- | verify | ||
- | |||
- | accept | ||
- | endpass | ||
- | message | ||
- | verify | ||
- | |||
- | accept | ||
- | accept | ||
- | deny message | ||
- | |||
- | acl_check_mime: | ||
- | |||
- | warn decode = default | ||
- | |||
- | deny message = Blacklisted file extension detected ($mime_filename) | ||
- | | ||
- | {${lc: | ||
- | {\N(\.exe|\.pif|\.bat|\.scr|\.lnk|\.com|\.vbs|\.cpl)$\N} \ | ||
- | {1}{0}} | ||
- | |||
- | deny message = Sorry, noone speaks chinese here | ||
- | | ||
- | |||
- | accept | ||
- | |||
- | ###################################################################### | ||
- | # ROUTERS CONFIGURATION | ||
- | # | ||
- | ###################################################################### | ||
- | # THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT! | ||
- | # An address is passed to each router in turn until it is accepted. | ||
- | ###################################################################### | ||
- | |||
- | begin routers | ||
- | |||
- | dnslookup: | ||
- | driver = dnslookup | ||
- | domains = ! +local_domains | ||
- | transport = remote_smtp | ||
- | ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 | ||
- | no_more | ||
- | |||
- | system_aliases: | ||
- | driver = redirect | ||
- | allow_fail | ||
- | allow_defer | ||
- | data = ${lookup mysql{SELECT recipients FROM aliases \ | ||
- | WHERE local_part=' | ||
- | |||
- | userforward: | ||
- | driver = redirect | ||
- | allow_fail | ||
- | allow_defer | ||
- | data = ${lookup mysql{SELECT recipients FROM userforward \ | ||
- | WHERE local_part=' | ||
- | |||
- | virtual_localuser: | ||
- | driver = accept | ||
- | domains = ${lookup mysql{SELECT domain from domains WHERE domain=' | ||
- | local_parts = ${lookup mysql{SELECT login from users \ | ||
- | WHERE login=' | ||
- | transport = local_delivery | ||
- | |||
- | ###################################################################### | ||
- | # TRANSPORTS CONFIGURATION | ||
- | ###################################################################### | ||
- | # ORDER DOES NOT MATTER | ||
- | # Only one appropriate transport is called for each delivery. | ||
- | ###################################################################### | ||
- | |||
- | begin transports | ||
- | |||
- | remote_smtp: | ||
- | driver = smtp | ||
- | |||
- | local_delivery: | ||
- | driver = appendfile | ||
- | check_string = "" | ||
- | create_directory | ||
- | delivery_date_add | ||
- | directory = / | ||
- | directory_mode = 770 | ||
- | envelope_to_add | ||
- | group = mail | ||
- | maildir_format | ||
- | maildir_tag = , | ||
- | message_prefix = "" | ||
- | message_suffix = "" | ||
- | mode = 0660 | ||
- | quota = ${lookup mysql{SELECT quota FROM users \ | ||
- | WHERE login=' | ||
- | quota_size_regex = S=(\d+)$ | ||
- | quota_warn_threshold = 75% | ||
- | return_path_add | ||
- | |||
- | | ||
- | driver = pipe | ||
- | return_output | ||
- | |||
- | address_file: | ||
- | driver = appendfile | ||
- | delivery_date_add | ||
- | envelope_to_add | ||
- | return_path_add | ||
- | |||
- | address_reply: | ||
- | driver = autoreply | ||
- | |||
- | ###################################################################### | ||
- | # RETRY CONFIGURATION | ||
- | ###################################################################### | ||
- | |||
- | begin retry | ||
- | |||
- | * quota | ||
- | * * | ||
- | |||
- | |||
- | ###################################################################### | ||
- | # REWRITE CONFIGURATION | ||
- | ###################################################################### | ||
- | |||
- | begin rewrite | ||
- | |||
- | ###################################################################### | ||
- | # | ||
- | ###################################################################### | ||
- | |||
- | begin authenticators | ||
- | |||
- | auth_plain: | ||
- | driver = plaintext | ||
- | public_name = PLAIN | ||
- | server_condition = ${lookup mysql{SELECT login FROM users \ | ||
- | WHERE login = ' | ||
- | AND domain = ' | ||
- | AND decrypt = ' | ||
- | AND status = ' | ||
- | server_prompts = : | ||
- | server_set_id = $2 | ||
- | |||
- | auth_login: | ||
- | driver = plaintext | ||
- | public_name = LOGIN | ||
- | server_condition = ${lookup mysql{SELECT login FROM users \ | ||
- | WHERE login = ' | ||
- | AND domain = ' | ||
- | AND decrypt = ' | ||
- | AND status = ' | ||
- | server_prompts = Username:: : Password:: | ||
- | server_set_id = $1 | ||
- | |||
- | auth_cram_md5: | ||
- | driver = cram_md5 | ||
- | public_name = CRAM-MD5 | ||
- | server_secret = ${lookup mysql{SELECT decrypt FROM users \ | ||
- | WHERE login = ' | ||
- | AND domain = ' | ||
- | AND status = ' | ||
- | server_set_id = $1 | ||
- | |||
- | # End of Exim configuration file | ||
- | </ | ||
- | |||
- | |||
- | Create a directory for the log files and deal with the rights to it in the directory where we will develop a post office, and the spool-directory. | ||
- | |||
- | <code bash> | ||
- | mkdir / | ||
- | chown -R exim:mail / | ||
- | </ | ||
- | |||
- | Create a script that will run our mail server at system startup. | ||
- | |||
- | <code bash> | ||
- | ee / | ||
- | </ | ||
- | |||
- | as | ||
- | |||
- | <file bash exim.sh> | ||
- | #!/bin/sh | ||
- | ### file exim.sh ### | ||
- | case " | ||
- | start) | ||
- | echo " | ||
- | / | ||
- | ;; | ||
- | stop) | ||
- | echo " | ||
- | kill -TERM `cat / | ||
- | ;; | ||
- | restart) | ||
- | $0 stop | ||
- | sleep 2 | ||
- | $0 start | ||
- | ;; | ||
- | reload) | ||
- | echo "Exim reloading..." | ||
- | kill -HUP `cat / | ||
- | ;; | ||
- | *) | ||
- | echo " | ||
- | exit 1 | ||
- | ;; | ||
- | esac | ||
- | </ | ||
- | |||
- | and make it executable | ||
- | |||
- | <code bash> | ||
- | chmod +x / | ||
- | </ | ||
- | |||
- | Validate the syntax of the configuration file / | ||
- | |||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Exim version 4.50 #1 built 02-Apr-2005 19:12:40 | ||
- | Copyright (c) University of Cambridge 2004 | ||
- | Probably Berkeley DB version 1.8x (native mode) | ||
- | Support for: Perl OpenSSL Content_Scanning Old_Demime | ||
- | Lookups: lsearch wildlsearch nwildlsearch iplsearch dbm dbmnz mysql | ||
- | Authenticators: | ||
- | Routers: accept dnslookup ipliteral manualroute queryprogram redirect | ||
- | Transports: appendfile/ | ||
- | Fixed never_users: | ||
- | Configuration file is / | ||
- | </ | ||
- | |||
- | |||
- | If no errors are found, go on ... Now we need to check whether you will be recognition of messages for local users, for this issue: | ||
- | |||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | admin@sharewiz.net | ||
- | <-- postmaster@sharewiz.net | ||
- | router = virtual_localuser, | ||
- | </ | ||
- | |||
- | If no errors are found, go on ... Now we need to check whether you will be recognition of messages to external users, for this issue: | ||
- | |||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | someuser@msn.com | ||
- | router = dnslookup, transport = remote_smtp | ||
- | host mx1.hotmail.com [65.54.166.99] | ||
- | host mx1.hotmail.com [65.54.252.99] | ||
- | host mx1.hotmail.com [64.4.50.99] | ||
- | host mx1.hotmail.com [64.4.50.50] | ||
- | host mx4.hotmail.com [65.54.190.230] MX=5 | ||
- | host mx4.hotmail.com [65.54.190.179] MX=5 | ||
- | host mx4.hotmail.com [65.54.167.230] MX=5 | ||
- | host mx4.hotmail.com [65.54.253.230] MX=5 | ||
- | host mx3.hotmail.com [65.54.253.99] | ||
- | host mx3.hotmail.com [65.54.167.5] | ||
- | host mx3.hotmail.com [64.4.50.239] | ||
- | host mx3.hotmail.com [64.4.50.179] | ||
- | host mx2.hotmail.com [65.54.190.50] | ||
- | host mx2.hotmail.com [65.54.190.7] | ||
- | host mx2.hotmail.com [65.54.252.230] MX=5 | ||
- | host mx2.hotmail.com [65.54.166.230] MX=5 | ||
- | </ | ||
- | |||
- | If no errors are found, go on ... Now we need to check whether you will be the delivery of messages to local users, for this issue: | ||
- | |||
- | <code bash> | ||
- | / | ||
- | From: admin@sharewiz.net | ||
- | To: postmaster@sharewiz.net | ||
- | Subject: Testing Exim | ||
- | |||
- | This is a test message. | ||
- | ^D | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | LOG: MAIN | ||
- | <= root@sharewiz.net U=root P=local S=325 | ||
- | # delivering 1DOs2P-000HAY-0E | ||
- | LOG: MAIN | ||
- | => admin R=virtual_localuser T=local_delivery | ||
- | LOG: MAIN | ||
- | Completed | ||
- | </ | ||
- | |||
- | Press < | ||
- | |||
- | If no errors are found, go on ... Now we need to check whether you will be delivering messages to external users, for this issue: | ||
- | |||
- | |||
- | <code bash> | ||
- | exim -v someuser@msn.com | ||
- | From: admin@sharewiz.net | ||
- | To: someuser@msn.com | ||
- | Subject: Testing Exim | ||
- | |||
- | This is a test message. | ||
- | ^D | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | LOG: MAIN | ||
- | <= root@sharewiz.net U=root P=local S=303 | ||
- | # LOG: MAIN | ||
- | => someuser | ||
- | LOG: MAIN | ||
- | Completed | ||
- | </ | ||
- | |||
- | Press < | ||
- | |||
- | At this stage, we are convinced that Exim is correctly configured and working, now it is necessary to check the SMTP authentication, | ||
- | |||
- | <file exim> | ||
- | hostlist | ||
- | на | ||
- | |||
- | hostlist | ||
- | </ | ||
- | |||
- | Run Exim, by typing: | ||
- | |||
- | <code bash> | ||
- | / | ||
- | </ | ||
- | |||
- | To verify authentication, | ||
- | |||
- | <code bash> | ||
- | cd / | ||
- | # make install | ||
- | # exit | ||
- | </ | ||
- | |||
- | Form a line PLAIN authentication (Netscape), for this issue: | ||
- | |||
- | Encode the login. | ||
- | |||
- | <code bash> | ||
- | printf ' | ||
- | </ | ||
- | |||
- | Shows | ||
- | |||
- | < | ||
- | YWRtaW5AbXlkb21haW4ucnUAYWRtaW5AbXlkb21haW4ucnUAbXlfcGFzc3dvcmQ= | ||
- | </ | ||
- | |||
- | Now | ||
- | |||
- | <code bash> | ||
- | telnet localhost 25 | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Trying ::1... | ||
- | telnet: connect to address ::1: Connection refused | ||
- | Trying 127.0.0.1... | ||
- | Connected to localhost.net. | ||
- | Escape character is ' | ||
- | 220-Welcome on our mail server! | ||
- | 220-This system does not accept Unsolicited Commercial Email | ||
- | 220-and will blacklist offenders via our spam processor. | ||
- | 220-Have a nice day! | ||
- | 220- | ||
- | 220 sharewiz.net ESMTP | ||
- | </ | ||
- | |||
- | Then ehlo. | ||
- | |||
- | <code bash> | ||
- | ehlo localhost | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 250-sharewiz.net Hello localhost.net [127.0.0.1] | ||
- | 250-SIZE 10485760 | ||
- | 250-PIPELINING | ||
- | 250-AUTH PLAIN LOGIN CRAM-MD5 | ||
- | 250 HELP | ||
- | </ | ||
- | |||
- | |||
- | Then | ||
- | |||
- | <code bash> | ||
- | auth plain | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 334 | ||
- | </ | ||
- | |||
- | Then | ||
- | |||
- | < | ||
- | YWRtaW5AbXlkb21haW4ucnUAYWRtaW5AbXlkb21haW4ucnUAbXlfcGFzc3dvcmQ= | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 235 Authentication succeeded | ||
- | </ | ||
- | |||
- | |||
- | Then | ||
- | |||
- | <code bash> | ||
- | quit | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 221 sharewiz.net closing connection | ||
- | Connection closed by foreign host. | ||
- | </ | ||
- | |||
- | The example shows that everything went well, if you have a different result, then again carefully read and look for the error ... | ||
- | So, go ahead, forming a string LOGIN authentication (Outlook), for this issue: | ||
- | |||
- | Base64 encode the login. | ||
- | |||
- | <code bash> | ||
- | echo -n admin@sharewiz.net | mimencode -b | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | YWRtaW5AbXlkb21haW4ucnU= | ||
- | </ | ||
- | |||
- | Base64 encode the password. | ||
- | |||
- | <code bash> | ||
- | echo -n my_passowrd | mimencode -b | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | bXlfcGFzc293cmQ= | ||
- | </ | ||
- | |||
- | Then | ||
- | |||
- | <code bash> | ||
- | telnet localhost 25 | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Trying ::1... | ||
- | telnet: connect to address ::1: Connection refused | ||
- | Trying 127.0.0.1... | ||
- | Connected to localhost.net. | ||
- | Escape character is ' | ||
- | 220-Welcome on our mail server! | ||
- | 220-This system does not accept Unsolicited Commercial Email | ||
- | 220-and will blacklist offenders via our spam processor. | ||
- | 220-Have a nice day! | ||
- | 220- | ||
- | 220 sharewiz.net ESMTP | ||
- | </ | ||
- | |||
- | Then | ||
- | |||
- | <code bash> | ||
- | ehlo localhost | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 250-sharewiz.net Hello localhost.net [127.0.0.1] | ||
- | 250-SIZE 10485760 | ||
- | 250-PIPELINING | ||
- | 250-AUTH PLAIN LOGIN CRAM-MD5 | ||
- | 250 HELP | ||
- | </ | ||
- | |||
- | Then enter: | ||
- | |||
- | <code bash> | ||
- | auth login | ||
- | </ | ||
- | |||
- | You will be asked for the username. | ||
- | |||
- | < | ||
- | 334 VXNlcm5hbWU6 | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | VXNlcm5hbWU6 is Base64 encoding to Username:. | ||
- | </ | ||
- | |||
- | Enter the Base64 encoded username which was established earlier. | ||
- | |||
- | < | ||
- | YWRtaW5AbXlkb21haW4ucnU= | ||
- | </ | ||
- | |||
- | You will be asked for the password. | ||
- | |||
- | < | ||
- | 334 UGFzc3dvcmQ6 | ||
- | </ | ||
- | |||
- | <WRAP info> | ||
- | UGFzc3dvcmQ6 is Base64 encoding to Password:. | ||
- | </ | ||
- | |||
- | Enter the Base64 encoded password which was established earlier. | ||
- | |||
- | < | ||
- | bXlfcGFzc293cmQ= | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | 235 Authentication succeeded | ||
- | </ | ||
- | |||
- | Now quit. | ||
- | |||
- | <code bash> | ||
- | quit | ||
- | </ | ||
- | |||
- | Displays: | ||
- | |||
- | < | ||
- | 221 mydomain.ru closing connection | ||
- | Connection closed by foreign host. | ||
- | </ | ||
- | |||
- | The example shows that everything went well, if you have a different result, then again carefully read and look for the error ... | ||
- | |||
- | Go ahead, check the CRAM-MD5 authentication. | ||
- | |||
- | Next I'll provide the full text set out in the article the Ginger, because | ||
- | |||
- | <code bash> | ||
- | telnet localhost 25 | ||
- | Trying 127.0.0.1... | ||
- | Connected to localhost.localdomain. | ||
- | Escape character is ' | ||
- | 220 smtp.sharewiz.net ESMTP Exim 4.20 Fri, 05 Sep 2003 14:09:15 +0400 | ||
- | ehlo localhost | ||
- | 250-smtp.sharewiz.net Hello localhost.localdomain [127.0.0.1] | ||
- | 250-SIZE 10485760 | ||
- | 250-PIPELINING | ||
- | 250-AUTH PLAIN LOGIN CRAM-MD5 | ||
- | 250 HELP | ||
- | auth cram-md5 | ||
- | 334 PDI2NDAyLjEwNTY2MTE1NTVAc210cC5leGFtcGxlLnJ1Pg== | ||
- | Z2luZ2VyQGV4YW1wbGUucnUgYjllN2Q1OTUxMGMxNjE0YzIwYjU4N2JkNmFkODk2MDI= | ||
- | 235 Authentication succeeded | ||
- | quit | ||
- | 221 smtp.sharewiz.net closing connection | ||
- | Connection closed by foreign host. | ||
- | </ | ||
- | |||
- | The example shows that everything went well, if you have a different result, then again carefully read and look for the error ... | ||
- | |||
- | So, I will describe their actions ... After the team auth cram-md5 was done, there was a kind of line: | ||
- | |||
- | < | ||
- | 334 PDI2NDAyLjEwNTY2MTE1NTVAc210cC5leGFtcGxlLnJ1Pg== | ||
- | </ | ||
- | |||
- | After that we have to do the following: | ||
- | |||
- | <code bash> | ||
- | perl -MMIME:: | ||
- | PDI2NDAyLjEwNTY2MTE1NTVAc210cC5leGFtcGxlLnJ1Pg== | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | < | ||
- | </ | ||
- | |||
- | Then run: | ||
- | |||
- | <code bash> | ||
- | perl -MMIME:: | ||
- | 'print MIME:: | ||
- | Digest:: | ||
- | ' | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | Z2luZ2VyQGV4YW1wbGUucnUgYjllN2Q1OTUxMGMxNjE0YzIwYjU4N2JkNmFkODk2MDI= | ||
- | </ | ||
- | |||
- | |||
- | The result is a string of interest to us. | ||
- | |||
- | Verify a secure connection TLS / SSL | ||
- | |||
- | <code bash> | ||
- | openssl | ||
- | OpenSSL> s_client -host localhost -port 465 | ||
- | </ | ||
- | |||
- | Result | ||
- | |||
- | < | ||
- | CONNECTED(00000003) | ||
- | depth=0 / | ||
- | @sharewiz.net | ||
- | verify error: | ||
- | verify return:1 | ||
- | depth=0 / | ||
- | @sharewiz.net | ||
- | verify return:1 | ||
- | --- | ||
- | Certificate chain | ||
- | 0 s:/ | ||
- | | ||
- | --- | ||
- | Server certificate | ||
- | -----BEGIN CERTIFICATE----- | ||
- | MIIEADCCA2mgAwIBAgIBADANBgkqhkiG9w0BAQQFADCBtzELMAkGA1UEBhMCUlUx | ||
- | MDYxNTQ5MzhaMIG3MQswCQYDVQQGEwJSVTEcMBoGA1UECBMTU3RhdnJvcG9sIFRl | ||
- | bDE3MDUGA1UEChQuRWRpdG9yaWFsIG9mIE5ld3NwYXBlciAiU3RhdnJvcG9sc2th | ||
- | eWEgUHJhdmRhIjEVMBMGA1UEAxMMc3RhcHJhdmRhLnJ1MSYwJAYJKoZIhvcNAQkB | ||
- | Fhdwb3N0bWFzdGVyQHN0YXByYXZkYS5ydTAeFw0wNTA0MjIxNTQ5MzhaFw0zMjA5 | ||
- | MDYxNTQ5MzhaMIG3MQswCQYDVQQGEwJSVTEcMBoGA1UECBMTU3RhdnJvcG9sIFRl | ||
- | cnJpdG9yeTESMBAGA1UEBxMJU3RhdnJvcG9sMTcwNQYDVQQKFC5FZGl0b3JpYWwg | ||
- | b2YgTmV3c3BhcGVyICJTdGF2cm9wb2xza2F5YSBQcmF2ZGEiMRUwEwYDVQQDEwxz | ||
- | MDYxNTQ5MzhaMIG3MQswCQYDVQQGEwJSVTEcMBoGA1UECBMTU3RhdnJvcG9sIFRl | ||
- | LnJ1MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNFT87/ | ||
- | LgJ9DvOwWBFs72R1ciYvOUOQVWGAhMCeGjVkiPtysjFtRRdgKjGvKrKmx9C3pH3w | ||
- | ZN5fXFcZBqUtiLzQ0VKcdw3utAvRM4gzICSlktpjPtxfoYYSC4CUHA1/ | ||
- | HVyM7oBL+pRZyQT0A/ | ||
- | ub9oTTvksXmf9F7gMIHkBgNVHSMEgdwwgdmAFIVHLfnzpOO5ub9oTTvksXmf9F7g | ||
- | oYG9pIG6MIG3MQswCQYDVQQGEwJSVTEcMBoGA1UECBMTU3RhdnJvcG9sIFRlcnJp | ||
- | dG9yeTESMBAGA1UEBxMJU3RhdnJvcG9sMTcwNQYDVQQKFC5FZGl0b3JpYWwgb2Yg | ||
- | HVyM7oBL+pRZyQT0A/ | ||
- | MDYxNTQ5MzhaMIG3MQswCQYDVQQGEwJSVTEcMBoGA1UECBMTU3RhdnJvcG9sIFRl | ||
- | ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAA4EghSwza0gbNcik | ||
- | HVyM7oBL+pRZyQT0A/ | ||
- | eWEyOMmOGQbx/ | ||
- | zokwLdwUQZGVBRTefUivYOSOJ9c= | ||
- | -----END CERTIFICATE----- | ||
- | subject=/ | ||
- | @sharewiz.net | ||
- | issuer=/ | ||
- | sharewiz.net | ||
- | --- | ||
- | No client certificate CA names sent | ||
- | --- | ||
- | SSL handshake has read 1190 bytes and written 340 bytes | ||
- | --- | ||
- | New, TLSv1/ | ||
- | Server public key is 1024 bit | ||
- | SSL-Session: | ||
- | Protocol | ||
- | Cipher | ||
- | Session-ID: FF415922B742484BA13B84FAD575C528B3549B742484BA13AB1393C4AB3D8010 | ||
- | |||
- | Session-ID-ctx: | ||
- | Master-Key: 8A39B36BFDB180ED55F829DBC420D675F0ECAF1B07FBBED3A1632A3AA8ECCE96 | ||
- | 4CAACF8CDAE5F829DBC420D3F5AE9BA8 | ||
- | Key-Arg | ||
- | Start Time: 1114190806 | ||
- | Timeout | ||
- | Verify return code: 18 (self signed certificate) | ||
- | --- | ||
- | 220-Welcome on our mail server! | ||
- | 220-This system does not accept Unsolicited Commercial Email | ||
- | 220-and will blacklist offenders via our spam processor. | ||
- | 220-Have a nice day! | ||
- | 220- | ||
- | 220 sharewiz.net ESMTP | ||
- | </ | ||
- | |||
- | Further checks can be made on the above analogy, but the point? And so we see that all OK! | ||
- | |||
- | < | ||
- | quit | ||
- | OpenSSL> quit | ||
- | </ | ||
- | |||
- | The final step, we will configure log rotation, so that they have not grown up to infinity. | ||
- | |||
- | < | ||
- | su | ||
- | crontab -e -u exim | ||
- | </ | ||
- | |||
- | Here you can expect trouble, if you have not yet met with the editor vi . I'll help a little bit, but in the future - teach materiel. | ||
- | |||
- | Press i and type the following line: | ||
- | |||
- | < | ||
- | @daily / | ||
- | </ | ||
- | |||
- | After entering the line does not click ENTER, and ESC. Now, press a sequence of : wq . Thus, you save the changes and get out of the editor. Now our logs will be updated every day at midnight. | ||
- | |||
- | That's all.This installation and configuration of Exim can be considered fully complete. | ||
- | |||
- | Now our server can send and receive mail. But this post to deliver to the end user? This story goes on. | ||
- | |||
- | |||
- | ===== References ===== | ||
- | |||
- | http:// |
exim4/install_exim4_complete.1478617304.txt.gz · Last modified: 2020/07/15 09:30 (external edit)