Hi Angelo,
thanks for your quick reply.
I had a look at your solution, but I'd need a filter on the subject, not on
sender or recipient. Can your solution be modified to include subject
filtering as well?
Grazie :-)

On Wed, 4 Dec 2019 at 21:20, Fazzina, Angelo <angelo.fazz...@uconn.edu>
wrote:

> 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 <helpcen...@uconn.edu>
>
> 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               ang...@uconn.edu, autore...@autoreply.uconn.edu
>
>
>
>
>
> 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
>
>
>
> ang...@uconn.edu
>
> University of Connecticut,  ITS, SSG, Server Systems
>
> 860-486-9075
>
>
>
> *From:* owner-postfix-us...@postfix.org <owner-postfix-us...@postfix.org> *On
> Behalf Of *Quasar
> *Sent:* Wednesday, December 4, 2019 3:02 PM
> *To:* postfix-users@postfix.org
> *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.
>

Reply via email to