exim4:config
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:config [2016/11/23 10:28] – peter | exim4:config [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exim4 - Config ====== | ====== Exim4 - Config ====== | ||
+ | |||
+ | http:// | ||
TODO | TODO | ||
Line 11: | Line 13: | ||
<WRAP info> | <WRAP info> | ||
- | A different user could be used as the owner instead of using the **mail** user account, and if so simply ensure that you adjust for all subsequent instructions in this setup. | + | **NOTE**: |
For example, you could create a different user account named exim: | For example, you could create a different user account named exim: | ||
Line 39: | Line 41: | ||
<WRAP info> | <WRAP info> | ||
- | Ubuntu usually has the **mail** user having: | + | **NOTE**: |
* a UID value of 8. | * a UID value of 8. | ||
Line 51: | Line 53: | ||
To use TLS / SSL create a certificate. | To use TLS / SSL create a certificate. | ||
+ | |||
+ | Create a certificate manually. | ||
<code bash> | <code bash> | ||
Line 58: | Line 62: | ||
</ | </ | ||
- | Fill in the following fields with any data you like (as this is purely a self-signed certificate) except for the **Common Name (eg, YOUR name) []** field where you need to enter the name of the server: | + | <WRAP todo> |
+ | Should | ||
+ | |||
+ | openssl req -x509 **-sha256** -newkey rsa:4096 -keyout mail.pem -out mail.pem -days 9999 -nodes | ||
+ | </ | ||
<WRAP alert> | <WRAP alert> | ||
- | There are less than 9999 days left before the Unix / Linux 32-bit date wrap-around occurs. | + | **ALERT**: |
This can result in the days being calculated as a negative date. It would be safer to use a more meaningful number of days. | This can result in the days being calculated as a negative date. It would be safer to use a more meaningful number of days. | ||
</ | </ | ||
+ | |||
+ | Fill in the following fields with any data you like (as this is purely a self-signed certificate) except for the **Common Name (eg, YOUR name) []** field where you need to enter the name of the server: | ||
+ | Shows | ||
< | < | ||
- | Country Name (2 letter code) [CA]: UA | + | Generating a 4096 bit RSA private key |
- | State or Province Name (full name) [Quebec]: Kiev | + | ............................................++ |
- | Locality Name (eg, city) [Montreal]: Kiev | + | .............................................................................................................................++ |
- | Organization Name (eg, company) [Open Network Architecture]: Internet Provider | + | writing new private key to ' |
- | Organizational Unit Name (eg, section) [Internet Department]: Network Operation Center | + | ----- |
- | Common Name (eg, YOUR name) []: jared.kiev.ua | + | You are about to be asked to enter information that will be incorporated |
- | Email Address []: noc@jared.kiev.ua | + | into your certificate request. |
+ | What you are about to enter is what is called a Distinguished Name or a DN. | ||
+ | There are quite a few fields but you can leave some blank | ||
+ | For some fields there will be a default value, | ||
+ | If you enter ' | ||
+ | ----- | ||
+ | Country Name (2 letter code) [AU]:UK | ||
+ | State or Province Name (full name) [Some-State]:Jersey | ||
+ | Locality Name (eg, city) []:St. Helier | ||
+ | Organization Name (eg, company) [Internet Widgits Pty Ltd]:ShareWiz | ||
+ | Organizational Unit Name (eg, section) []:Tech | ||
+ | Common Name (e.g. server FQDN or YOUR name) []:mail.sharewiz.net | ||
+ | Email Address []:admin@sharewiz.net | ||
</ | </ | ||
Line 117: | Line 140: | ||
openssl ecparam -list_curves | openssl ecparam -list_curves | ||
- | openssl rsa req -passin | + | openssl rsa req -passin |
Line 155: | Line 178: | ||
==== configure ==== | ==== configure ==== | ||
- | <code> | + | <file bash configure> |
- | configure: | + | ###################################################################### |
+ | # Runtime configuration file for Exim # | ||
+ | ###################################################################### | ||
- | ################################################## | + | # Include main settings. |
- | # Runtime configuration file for Exim # | + | include / |
- | ################################################## | + | |
- | | + | # Include |
- | | + | .include / |
- | # Inklyudim settings Greylisting | + | ### ACL configuration for incoming mail. |
- | .include / | + | begin acl |
- | ### ACL configuration | + | # Start ACL - " |
- | begin acl | + | .ifdef USE_GREYLIST |
+ | greylist_acl: | ||
+ | .include / | ||
+ | .endif | ||
- | # Start ACL - "working" | + | # Verify the HELO. |
- | .ifdef USE_GREYLIST | + | acl_check_helo: |
+ | accept hosts = +relay_from_hosts | ||
+ | drop condition = ${if match{$sender_helo_name}{MY_IP}{yes}{no} } | ||
+ | message | ||
+ | drop condition = ${if match{$sender_helo_name}{^[0-9]\.[0-9]\.[0-9]\.[0-9]}{yes}{no} } | ||
+ | message | ||
+ | accept | ||
- | | ||
- | | ||
- | .endif | + | # These rules are triggered for each email. |
+ | acl_check_rcpt: | ||
+ | warn set acl_c_lp = $local_part@$domain | ||
- | # Verifying | + | |
- | | + | .include / |
- | | + | |
- | drop condition = ${if match {$sender_helo_name} {MY_IP} {yes} {no}} | + | |
- | message = " | + | |
- | drop condition = ${if match {$sender_helo_name} {^ [0-9] \. [0-9] \. [0-9] \. [0-9]} {yes} {no}} | + | |
- | message = " | + | |
- | | + | |
- | # These rules are triggered for each letter | + | |
- | acl_check_rcpt: | + | |
- | warn set acl_c_lp = $local_part @ $ domain | + | # Acl_check_rcpt - black-lists, |
+ | .include / | ||
- | # Acl_check_rcpt - checking the syntax is correct | ||
- | | ||
- | # Acl_check_rcpt - anti-spam - Host and others. | + | # Check the message body. |
- | .include / | + | acl_check_content: |
- | # Acl_check_rcpt - black-lists, | + | |
- | | + | .include / |
- | # Check the message body | ||
- | acl_check_content: | ||
- | # Inklyudim configuration message body check | + | # What do we do with the mail. |
- | .include / | + | begin routers |
- | # What do we do with the mail | + | |
- | begin routers | + | .include / |
- | # Inklyudim | + | |
- | | + | |
- | # Start transports - both deliver mail | ||
- | begin transports | ||
- | # Inklyudim transports | ||
- | | ||
- | # Configuration of repetition and rewriting | + | # Start transports - Delivers the mail. |
- | .include / | + | begin transports |
- | #begin rewrite | + | |
+ | .include / | ||
- | # Authentication section when sending emails. | + | |
- | begin authenticators | + | # Configuration of repetition and rewriting. |
- | # Authenticate users. | + | .include / |
- | | + | |
- | </code> | + | |
+ | #begin rewrite | ||
+ | |||
+ | |||
+ | # Authentication section when sending emails. | ||
+ | begin authenticators | ||
+ | # Authenticate users. | ||
+ | .include / | ||
+ | </file> | ||
Line 235: | Line 262: | ||
< | < | ||
- | | + | # Set the variables. |
- | MY_IP = 123.123.123.123 | + | MY_IP = 123.123.123.123 |
- | | + | INTERNAL_IP = 192.168.1.2 |
+ | |||
+ | # Settings Vexim. | ||
+ | USE_SPF = true | ||
+ | USE_AV = true | ||
+ | USE_SPAMD = true | ||
+ | USE_GREYLIST = true | ||
+ | TLS = true | ||
+ | |||
+ | # Whitelisting. | ||
+ | hostlist whitelist_hosts = net-iplsearch; | ||
+ | addresslist whitelist_sender = wildlsearch; | ||
+ | |||
+ | # In IPv6 we do not work. | ||
+ | disable_ipv6 = true | ||
- | # Settings Vexim | + | # User and group from which will run the entire bundle. |
- | USE_SPF | + | exim_user |
- | USE_AV | + | exim_group |
- | | + | |
- | | + | |
- | TLS = true | + | |
- | # Whitelisting | + | # There were mailings settings, do not use - no setup. |
- | hostlist whitelist_hosts | + | MAILMAN_HOME |
- | addresslist whitelist_sender | + | MAILMAN_WRAP = MAILMAN_HOME/mail/mailman |
+ | MAILMAN_USER | ||
+ | MAILMAN_GROUP = mail | ||
- | # In IPv6 we do not work | + | # Enter the credentials to connect to the MySQL server. |
- | disable_ipv6 | + | # Word `hide`, first, means that when |
+ | # Check config command call | ||
+ | # Exim -bV config_file these data will not be displayed. | ||
+ | # If without it - it will be shown ... Recording format: | ||
+ | # Host / dbname / user / password | ||
+ | hide mysql_servers | ||
- | # User and group from which will run the entire bundle | + | # Interfaces to listen. |
- | exim_user | + | local_interfaces |
- | | + | |
- | # | + | # Host Name. Used EHLO. |
- | MAILMAN_HOME = / usr / local / mailman | + | # Listed on the other points, if they are not specified, the type qualify_domain and other .. |
- | | + | # If there are not found anything (comment out the line), then used that returns the uname () function. |
- | | + | primary_hostname |
- | MAILMAN_GROUP | + | |
- | # Enter the credentials to connect to the MySQL server. | + | # Request for sampling Domain Information. |
- | # Word `hide`, first, means that when | + | VIRTUAL_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = ' |
- | | + | RELAY_DOMAINS = SELECT DISTINCT domain FROM domains WHERE type = ' |
- | # Exim -bV config_file these data will not be displayed. | + | ALIAS_DOMAINS |
- | # If without it - it will be shown ... Recording format: | + | |
- | # Host / dbname / user / password | + | |
- | hide mysql_servers | + | |
- | # | + | # Make a list of local domains. |
- | local_interfaces | + | # In this case, the domains are selected from the database MySQL. |
+ | domainlist local_domains = @ : ${lookup mysql{VIRTUAL_DOMAINS}} : ${lookup mysql{ALIAS_DOMAINS}} | ||
+ | domainlist relay_to_domains | ||
- | # Host Name. Used EHLO. | + | # List of trusted networks from which mail will go without a number of checks. |
- | # Listed on the other points, if they are not specified, the type qualify_domain and other .. | + | hostlist |
- | # If there are not found anything (comment out the line), then used that returns the uname () function | + | |
- | | + | |
- | # Request | + | # Enter the name acl for checking mail. |
- | VIRTUAL_DOMAINS | + | acl_smtp_rcpt |
- | RELAY_DOMAINS | + | acl_smtp_data |
- | ALIAS_DOMAINS = SELECT DISTINCT alias FROM domainalias WHERE alias = ' | + | acl_smtp_helo |
- | # Make a list of local domains. Next, the list will appear in the form of + local_domains | + | # If the setting is said to check mail for viruses - connect. |
- | # In this case, the domains are selected from the database MySQL. | + | .ifdef USE_AV |
- | domainlist local_domains | + | av_scanner |
- | domainlist relay_to_domains = ${lookup mysql {RELAY_DOMAINS}} | + | .endif |
- | # List of trusted networks from which mail will go without a number of checks | ||
- | | ||
- | # Enter the name acl`ov for checking | + | # If the setting is said to check mail for spam - connect. |
- | acl_smtp_rcpt = acl_check_rcpt | + | .ifdef USE_SPAMD |
- | acl_smtp_data | + | spamd_address |
- | acl_smtp_helo = acl_check_helo | + | .endif |
- | # If the setting is said to check mail for viruses - connect | ||
- | | ||
- | | ||
- | | ||
- | # If the setting is said to check mail for spam - connect | + | # If the setting is said to work with support |
- | | + | .ifdef |
- | spamd_address | + | # SSL/TLS cert and key |
- | | + | |
+ | | ||
+ | # Advertise TLS to anyone | ||
+ | | ||
+ | | ||
+ | .endif | ||
- | # If the setting is said to work with support for SSL - connect | ||
- | | ||
- | # SSL / TLS cert and key | ||
- | tls_certificate = / | ||
- | tls_privatekey = / | ||
- | # Advertise TLS to anyone | ||
- | tls_advertise_hosts = * | ||
- | tls_on_connect_ports = 465 | ||
- | | ||
- | # Domain name is added to the local senders (real | + | # Domain name is added to the local senders (real users of the system) that mail is sent from the root, will be from |
- | # Of users of the system) that mail is sent from the root, will be from | + | # root@sharewiz.net. If this item is not specified, |
- | # Root @ domen_ukazannyy_zdes. If the item is not specified, | + | qualify_domain = sharewiz.net |
- | # Hostname | + | |
- | | + | |
- | # Host Name for the situation, return to the previous one - is the domain name to be added to the e-mail | + | # Host Name for the situation, return to the previous one - is the domain name to be added to the e-mail |
- | # Of system users, well and in general for the post, which came on the address type `root` etc ... | + | # Of system users, well and in general for the post, which came on the address type `root` etc ... |
Eton # If the item is not specified then the value obtained from the preceding paragraph - `qualify_domain` | Eton # If the item is not specified then the value obtained from the preceding paragraph - `qualify_domain` | ||
| | ||
Line 453: | Line 481: | ||
| | ||
</ | </ | ||
- | |||
==== 110.greylist.conf ==== | ==== 110.greylist.conf ==== |
exim4/config.1479896917.txt.gz · Last modified: 2020/07/15 09:30 (external edit)