TomTicket
By:
TomTicket

Execute Script on Receive Email with Exim

April 10, 2017 371 views
Email System Tools Ubuntu 16.04

I configured Exim4 to receive fake emails in wildcard domains (eg: @subdomain.mydomain.com) and run a command. But every time I send an email to the domain an error is returned.

2017-04-08 19:45:59 H=mail-qk1-fl21.google.com IP] F=sender_example@example.com rejected RCPT fakemail@fake-sub-domain.mydomain.com: relay not permitted

This is my Exim4 config:

Routes

begin routers

catchall_mail:
  driver = accept
  domains = %
  transport = send_to_site

Transports

begin transports

send_to_site:
  driver = pipe
  command = /usr/bin/curl https://www.example.com/mail.php --data-urlencode "mail@-"
  user = nobody
  group = nogroup
  return_path_add
  delivery_date_add
  envelope_to_add

Config

dc_eximconfig_configtype='internet'
dc_other_hostnames='mailer.dominio.com;dominio.com'
dc_local_interfaces=''
dc_readhost=''
dc_relay_domains=''
dc_minimaldns='false'
dc_relay_nets=''
dc_smarthost=''
CFILEMODE='644'
dc_use_split_config='true'
dc_hide_mailname=''
dc_mailname_in_oh='true'
dc_localdelivery='maildir_home'

What can I be doing wrong?

Be the first one to answer this question.