1

I have a fresh exim4 install without any tweaks on a Debian 8.6 machine.

I use it to send emails from PHP:

; /etc/php5/fpm/conf.d/mail.ini 
[mail function]
sendmail_path = /usr/sbin/exim4 -t
mail.add_x_header = On
mail.log = syslog

Recently we began to receive a lot of spam emails, which exim tries to send back, because of inexistent recepients.

So, my question is: how to completely deny exim4 to receive any external emails? (Maybe excluding some local emails like cron ones.)

Thank you.


As pointed by @slipeer my Exim already not receiving any external emails. So I created a different question:

Deny some local users (not addresses) to send email from exim4

0

As I understand it you need to relay outbound emails from php local.

Try run:

dpkg-reconfigure exim4-config

Then:

  1. Select 'internet site' configuration.
  2. Enter your system’s FQDN
  3. Configure 127.0.0.1 as listening IP (or 127.0.0.1; ::1 if you use IPv6)
  4. Specify local domains. Here you should specify the domain names, the which mails will be delivered locally. (If you need to deliver locally only emails with recipients like somebody@localhost, you can specify only localhost here)
  5. Leave the relay domains field blank.
  6. Leave the relay machines field blank.
  7. Select local mail storage format. I recommend 'Maildir'
  8. Select generated exim config format. I recommend 'non-split' - allconfig in one file

This guid with screens can found here (screenshots for Debian 6, but since that time they have not changed.).

7
  • — on step 3 I have 127.0.0.1 ; ::1; — on step 4: subdomail.domain.com (should I paste localhost here?); — 5-6 are blank; — 7: mbox; — 8: non-split Jan 13 '17 at 13:56
  • Of course, if you have configured and used ipv6, the line will look like this. I'll add it to my ansver.
    – Slipeer
    Jan 13 '17 at 13:59
  • Sorry for being lame: how can I check if my exim4 is send-only? Jan 13 '17 at 14:02
  • When your Exim accept connections only on the loopback interface - it can not accept emails from the outside. To check it run: netstat -lnp | grep -i exim
    – Slipeer
    Jan 13 '17 at 14:10
  • I have: sishot.ru/i/bUVYSnG-AG9n Jan 13 '17 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.