Hi,

I did manage to pipe my emails to a bash script which filter and push to an api some emails, but I would like to "forward" some of them to an email address.

when I send the mail content via sendmail :

sendmail -t $nouveau_destinataire <<< $lemail

or

sendmail $nouveau_destinataire <<< $lemail

I receive a blank email from root ...

I have the feeling that it's due to the lack of eol in the variable (which is normal from the smtp process if I am right), but I am not sure ...

I also try to replace the "To: oldem...@olddomaine.com " in the variable but it seems to have no effect ...

What am I missing here ?

is there a easy way to reinsert correctly the eol ?

Thanks for your help !

Stéphane



Le 25/11/2016 à 11:35, Stéphane MERLE a écrit :
Hi,

I got a 2 dedicated postfix/dovecot servers that deal with return to replyto mails. For now, I got a bash script that "read and parse" each files in /Maildir/new and if it match some criterias (most on TO/FROM/SUBJECT) send it to another domain mailbox, from that new domain, the mails are taken and inserted in a MSSQL bdd by a script that pop the box ...

That way of working seems not efficient to me, so I am trying to find a way to parse the mail directly within postfix (I think that sieve can handle that), and to insert it into the bdd or make a HTTP REST call to our API ...

First is that just possible (sending the mail to a bdd or to a POST HTTP call) ?

and if not, where can I find information on how I can use postfix to send each mail to a developed a golang binary that would parse the mail and call the API (kind of like it seems to work with dovecot or sieve or spamassassin). In order to know what to answer to postfix for example ... or a way to tell sieve to send the mail matching those criterias to my process

Sorry if the question sounds terrible, and maybee offtopic, I am trying to find a better way to deal with that task.

Stéphane





Reply via email to