St?phane MERLE: > Hi, > > Hi, > > I found this and it looks just perfect for this ! > > http://serverfault.com/questions/322657/how-can-i-route-some-emails-to-a-script-in-postfix > > one more question, if my script die and cannot process the mail (too > much cpu or ... script bug), the mail is lost or will go back in queue ? > How my script tell postfix that the process is ok or not for postfix to > have a clean exit ?
Please see "man 8 pipe". This documentation describes how Postfix deals with successful or failed exits from a program, and more. Wietse > again sorry if those questions are not asked in the good place or form, > please advise and I will try my best ! > > 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 > > > > > > > > > >