Exim.conf Variable for Calling Script

Richpark

Verified User
Joined
Sep 25, 2014
Messages
55
I need to access the name of the PHP script sending an email. If there a variable such as this that can be used in exim.conf?
 
Hello,

I believe a PHP script name can be found in headers of an email.

Exim does not log a script name, only a cwd. You might check and play with log_selector in exim config. I'm not too sure it will do what you want though.
 
Hello,

I believe a PHP script name can be found in headers of an email.

Exim does not log a script name, only a cwd. You might check and play with log_selector in exim config. I'm not too sure it will do what you want though.
Thanks. My application has a “newsletter” feature that lets my customers email their customers.

Unfortunately, this sometimes gets the main server IP blacklisted temporarily.

I wanted to use the script name to conditionally change the Exim sender IP for such emails, creating some separation.

Can you think of any other way for exim.conf to know how the email is being sent? I have full control over the email headers as it’s my application.
 
If you have multiple IPs on a server, then you could assign individual IPs in Exim, see: https://docs.directadmin.com/other-...hat-mail-is-sent-from-a-domain-s-dedicated-ip

If all sends are done within a single domain name, then you could probably try and use different SMTP auth for clients. Then you could probably use different IPs in Exim's transport and specify an interface depending on $authenticated_id.

Something like that:

Bash:
  headers_add = "${if def:authenticated_id{X-Authenticated-Id: ${authenticated_id}}}"
  interface = <; ${if exists{/etc/virtual/authenticated_ips}{${lookup{$authenticated_id}lsearch*{/etc/virtual/authenticated_ips}}}}

Then you will need to have a file /etc/virtual/authenticated_ips with a content something like:

Code:

The latest is just a raw idea. I did not test it and cannot say it will work and do what you need.
 
Back
Top