Set email headers so bounced emails go to a specific address

I just figured this out myself in exim4 after a lot of reading about exim configuration. First, you want your app to add the following header: Return-Path: <bounced@yourdomain.com> Works with or without brackets. Exim will add brackets in the end either way. Second, this was the hard part. Exim always wanted to override my Return-Path: … Read more

How to find which script on my server is sending spam emails? [duplicate]

Linux Malware Detect (http://www.rfxn.com/projects/linux-malware-detect/) installation is quite easy :). Go via this link, download http://www.rfxn.com/downloads/maldetect-current.tar.gz. The link to this file is located at the very top of the web-page. Then unzip this archive, go to newly created directory by running cd in your terminal. In the directory run sudo ./install.sh which will install the scanner … Read more

Setting up Exim to forward mail

You will need to use a redirect router. Read the Exim Router specification, as it can do many things and thus can get quite complex. Basically, you will need to set something up like this (untested) sender_redirect: driver = redirect data = ${lookup{$sender_address}lsearch{/etc/exim4/sender_redirects}} Then create a file in /etc/exim4/sender_redirects that contains the redirects in a … Read more

When exim4 sends HELO/EHLO, how do I configure which host name it sends?

Assuming the error is complaining about the HELO/EHLO data, you want to use the helo_data option on the smtp transport. The default is $primary_hostname. remote_smtp: driver = smtp helo_data = host.example.com More information is available in the manual. If this isn’t the case, you probably want to include some example rejection messages. Just the three … Read more

How do I change Exim4’s primary_hostname on a Debian box?

Your /etc/hosts file should have at least two records in it. The first record should be of the form: <IP_ADDRESS> <HOST_FQDN> <HOSTNAME> the second one should be of the form: 127.0.0.1 localhost You also need to make sure that your /etc/hostname file contains the server’s FQDN, and that running hostname -f returns your servers FQDN. … Read more

What host name should the SSL certificate for an SMTP server contain?

This is actually not explicitly defined anywhere, and whether or not the server should be “trusted” depends on the client (which could of course be another mail server) connecting to it; quoting from the relevant RFC (RFC 2487): If the SMTP client decides that the level of authentication or privacy is not high enough for … Read more