I have an app on a server that sends mail via the local system's 'sendmail'. I want to write a program that takes the payload of the message, modifies it, and then sends it on to the original recipients.
I am running sendmail 8.14.4-8 on a Red Hat 6.4 server.
I thought that I could replace the link to /usr/sbin/sendmail with a link to my own script that would do the work and then delegate to the actual sendmail binary.
That didn't seem to work, so next I tried setting up a programmable SMTP server on the same host and tried to get sendmail to relay the messages to it, but sendmail didn't want to relay to any port other than 25. I tried using the following lines:
dnl define(`RELAY_MAILER_ARGS', `TCP $h 8025')dnl dnl define(`ESMTP_MAILER_ARGS', `TCP $h 8025')dnl
My reading suggested that would work, but sendmail just kept trying port 25.
Anyone have any other ideas how I could approach this problem?