Hi, AFA I know there is the “argv” parameter in master.cf that can run scripts
you create, there may be others.
This is my test config:
autoreply unix - n n - - pipe
flags=DF user=nobody
argv=/usr/local/bin/angelo $sender $recipient $original_recipient $user
$mailbox
And here is the script:
[root@mta5 ]# more /usr/local/bin/angelo
#!/usr/bin/bash
/usr/sbin/sendmail -oi -t <<EOF
From: UConn Help Center <[email protected]>
To: $1
Subject: Your email to $3 was delivered
Content-Type: text/plain; charset=utf-8
This is a test email.
This is a notice to inform you that in the future when you send emails
to $3 they will fail to send.
Please send all future emails to users @uconn.edu address.
Thank you.
this is 2 = $2
this is 1 = $1
this is 3 = $3
this is user = $4
this is mailbox = $5
And i recall only adding this to main.cf
transport_destination_recipient_limit = 1
and in virtual
@uchc.edu [email protected],
[email protected]<mailto:[email protected]>
You will likely get a more specific answers with more details about your
scenario.
I do not know if header_checks is normal way to trigger a script, I never did
it that way.
Good Luck.
-ANGELO FAZZINA
[email protected]
University of Connecticut, ITS, SSG, Server Systems
860-486-9075
From: [email protected] <[email protected]> On
Behalf Of Quasar
Sent: Wednesday, December 4, 2019 3:02 PM
To: [email protected]
Subject: How to trigger a script based on header
Hi there,
I need some help, tried to find the answer googling for it, but no luck.
Here's my question: I'd need to trigger a script whenever an email is processed
and sent. This trigger should be based on some header fields (e.g. subject).
I tried playing with header_checks but without getting anything.
Can you please help me?
Thanks
Giuseppe.