Core OS Index

2.5. Exim

2.5.1. Exim Configuration

Exim come with default configuration we will change to mach system settings /etc/exim/exim.conf.

        $ sudo prt-get depinst mailx
        

2.5.2. Certificates

Exim creates a key for you if you just copy exim.conf and start daemon;

        # cp /home/username/data/git/doc/core/conf/exim/exim.conf /etc/exim/exim.conf
        # sh /etc/rc.d/exim start
        SSL certificate /etc/ssl/certs/exim.crt with key /etc/ssl/keys/exim.key for host machine.example created
        #
        

Manually create a private key;

	$ sudo mkdir /etc/ssl/keys
	
	$ sudo openssl req -x509 -newkey rsa:2048 -keyout /etc/ssl/keys/exim.key -out /etc/ssl/certs/exim.cert -days 9000 -nodes
	Generating a 2048 bit RSA private key
	...........................................+++
	..............+++
	writing new private key to '/etc/ssl/keys/exim.key'
	-----
	You are about to be asked to enter information that will be incorporated
	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 '.', the field will be left blank.
	-----
	Country Name (2 letter code) [AU]:PT
	State or Province Name (full name) [Some-State]:
	Locality Name (eg, city) []:
	Organization Name (eg, company) [Internet Widgits Pty Ltd]:
	Organizational Unit Name (eg, section) []:
	Common Name (e.g. server FQDN or YOUR name) []:machine.example.org
	Email Address []:postmaster@machine.example.org
	#
        
	# chown mail:mail /etc/ssl/keys/exim.key
	# chmod 0600 /etc/ssl/keys/exim.key
	# chmod 644 /etc/ssl/certs/exim.cert
	

2.5.3. Aliases

Exim come with default aliases we will change to mach system settings /etc/exim/aliases;

        # Default aliases file, installed by Exim. This file contains no real aliases.
        # You should edit it to taste.

        # The following alias is required by the mail RFCs 2821 and 2822.
        # Set it to the address of a HUMAN who deals with this system's mail problems.

        postmaster: machine-admin

        # It is also common to set the following alias so that if anybody replies to a
        # bounce message from this host, the reply goes to the postmaster.

        mailer-daemon: postmaster

        # You should also set up an alias for messages to root, because it is not
        # usually a good idea to deliver mail as root.

        root: postmaster

        # It is a good idea to redirect any messages sent to system accounts so tha
        # they don't just get ignored. Here are some common examples:

        bin: root
        daemon: root
        ftp: root
        nobody: root
        operator: root
        uucp: root

        # You should check your /etc/passwd for any others.

        # Other commonly enountered aliases are:
        #
        # abuse:       the person dealing with network and mail abuse
        # hostmaster:  the person dealing with DNS problems
        # webmaster:   the person dealing with your web site

        ####
        

2.5.4. Smarthost

Tony Finch publish a nice configuration reference.

File /etc/exim/alias rewrite addresses when receiving, return_path and headers_rewrite rewrite addresses in header (envelop) while main rewrite apply rewriting to all.

Test sender rewriting;

        # exim -brw bo