4

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...

Matthieu
  • 145
  • 1
  • 1
  • 6
  • What do your logs say? – womble Aug 04 '11 at 00: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. – Daniele Santi Aug 04 '11 at 13:02

3 Answers3

2

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

SparX
  • 1,924
  • 12
  • 10
  • 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 05 '11 at 01:07
  • Could you try to set that to gmail.com and see what happens ? – SparX Aug 05 '11 at 02:31
1

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

Mark
  • 2,248
  • 12
  • 15
1

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

mycompanyemail.com:[user]:[password]

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.

Falcon Momot
  • 25,244
  • 15
  • 63
  • 92
zap
  • 11
  • 1