Take the 2-minute tour ×

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 :


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) [] 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...

share|improve this question
What do your logs say? –  womble Aug 4 '11 at 0:44
As @womble said, check your logs (use the exigrep command to filter unneeded noise) for errors. Could easily be some incorrect HELO/EHLO from the printer or some malformed recipient address. –  Mr Shunz Aug 4 '11 at 13:02
add comment

3 Answers

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.


share|improve this answer
I tried to leave that dc_relay_domains empty or use and asterisk but none worked (the latter replaced the asterisk with file names...) –  Matthieu Aug 5 '11 at 1:07
Could you try to set that to gmail.com and see what happens ? –  SparX Aug 5 '11 at 2:31
add comment

Set dc_relay_domains='' rather than setting it to *. Trust in the dc_relay_nets to limit use of the server to local servers.

share|improve this answer
add comment

I had this too. Took me a while to figure, however the solution I found was simple.

You have a smarthost which you want to use to send emails from your local host, which also runs Exim4. For that reason you seem to have selected the right dpkg-configure exim4-reconfigure options. As your exim4.conf.conf shows an entry under dc_relay_domains. So far, so good.

But if that smarthost is a well configured email server, it would still only accept emails for its own domain and return an 550 relay not permitted error. That seems to be the case as you describe. That is because the smarthost accepts only emails for its own domain upon delivery attempts of unidentified SMTP delivery. Otherwise it would be an entry point of spam being a so called open relay. Open relays are no good.

Using the smarthost your local Exim4 needs to log int the smarthost using an existing user account and credentials. This way your local Exim4 identifies itself to the smarthost as an allowed user who gets then unrestricted access, that includes deliver and relaying emails for foreign domains.

To achieve that you need a user account on the smarthost and edit the config file /etc/exim4/passwd.client adding the following line


That should do the job. Just make sure that the smarthost URL is identical, or matches the dc_relay_domains entry in exim4.conf.conf. (wildcard strings are allowed) Don't forget to chmod 640 the passwd.client as it contains user credentials in cleartext.

share|improve this answer
add comment

Your Answer


