On 7/1/2019 11:56 AM, Patton, Matthew [Contractor] wrote:
On 7/1/2019 10:19 AM, Patton, Matthew [Contractor] wrote:
I need a way for Postfix to listen to SMTP (think smarthost) and then re-send
all emails via HTTP POST operation. Is the correct way to tackle this (aside
from
Maybe if you explain your base problem in detail someone can help with an
alternate solution.
A disturbing number of USA FedGov agencies have contracted with a "digitial communications
provider" (aka marketing campaign site) as their outbound email provider where it concerns
sending email to the filthy citizens, because SMTP is too scary. (I'm not kidding, they've
"certified" this service as FedRamp approved but AWS Simple Email Service is prohibited).
This so-called service does not run SMTP listeners, authenticated or otherwise. Incredibly the only
way to send mail using the platform is an API call (HTTP POST) with a JSON payload or via Web
browser and forms template.
It seems like the best solution is to not fight the system... tell
them to use the web form to send their announcements.
In effect I need to do;
For each message in delivery queue, construct JSON payload and use Curl to post
to API endpoint, mark message as forwarded. Next.
There will not be any local delivery so I'm guessing I can just change the default transport from smtp to Pipe(8)?
Yes, this should work. Pretty much anything that can be reliably
scripted can be implemented as a postfix pipe transport. Make sure
your script exists with an appropriate sysexits.h code - 0 for
success, non-zero for failure - so postfix knows if it worked. See
pipe(8) for important details.
I haven't looked at what's involved in writing a 'native' transport agent that
Postfix can call directly to process the queue.
Not recommended. The postfix internal plumbing is intentionally
undocumented as it may change between versions, possibly without
warning.
-- Noel Jones