Exim4 to relay emails

eximsmtp

I have exim4 installed on a Linux box. The basics work fine and I can send email from that machine without any problem to whatever email address.

I also have a printer/scanner which is capable to send scans as emails. It needs an SMTP gateway to be able to do that. So I give the IP address of that Linux box, changed the configuration a little bit but still cannot get it to work.

After I run dpkg-reconfigure exim4-config, here is what I get in /etc/exim4/update-exim4.conf.conf :

dc_eximconfig_configtype='internet'
dc_other_hostnames=''
dc_local_interfaces='127.0.0.1;192.168.2.2'
dc_readhost=''
dc_relay_domains='mycompanyemail.com'
dc_minimaldns='false'
dc_relay_nets='192.168.2.0/24'
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='false'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='mail_spool'

My problem is that with this configuration, I can only send to emails @mycompanyemail.com… It says I can use wildcard, but when I do that, the '*' is replaced by whatever filename is in the directory where I run all that.

How can I configure it to be able to send emails with any domain ? Or am I doing it wrong ?

EDIT : here is the part of the log that's causing trouble :

2011-08-03 16:28:18 H=(NPI2D389C) [192.168.2.20] F=<scanner@company.cal> rejected RCPT <m......j.....@gmail.com>: relay not permitted

The first part (scanner@company.cal) does not matter. I changed the email address. The point is that if this email is @mycompanyemail.com then everything works fine. Anything else does not work. I could add gmail.com, but I am looking to have any domain working…

Best Answer

You are using "dc_relay_domains='mycompanyemail.com'" and this is the reason why you are able to send mails only to your company mail addresses. This parameter need to be configured only if you need to restrict email delivery and you need to leave it empty to fix your issue.

Actually, the dc_relay_nets is the parameter, that restricts the relay IPs.

Cheers