not good:
3 phases :
1 --> the mail is for admin or CRM ? --> forward to admin or crm && return 0
2 --> the mail is crap --> delete it && return 0
3 --> none of the previous --> send to bdd by api rest call http
so the sendmail is not always the final decision ...
I feel that the originale r
On Dec 22, 2016, at 12:36 PM, Wietse Venema wrote: # Final command. Shell will remove the temp file and exit with # Sendmail's exit code. /usr/sbin/sendmail "$@"And do not forget the '--' inpipe ... argv=/path/to/script -f ${sender} -- ${recipient}And the missing "< $msg" in the final command: /u
> On Dec 22, 2016, at 12:36 PM, Wietse Venema wrote:
>
>> # Final command. Shell will remove the temp file and exit with
>> # Sendmail's exit code.
>> /usr/sbin/sendmail "$@"
>
> And do not forget the '--' in
> pipe ... argv=/path/to/script -f ${sender} -- ${recipient}
And the
Viktor Dukhovni:
>
> > On Dec 22, 2016, at 3:51 AM, St?phane MERLE
> > wrote:
> >
> > First, I save the message in the file descriptor 3
> >
> >msg=$(mktemp /tmp/msg.XX) || exit 75
> >cat > $msg || { rm $msg; exit 75; }
> >exec 3< $msg || { rm $msg; exit 75; }
> >rm $msg
>
> On Dec 22, 2016, at 3:51 AM, Stéphane MERLE
> wrote:
>
> First, I save the message in the file descriptor 3
>
>msg=$(mktemp /tmp/msg.XX) || exit 75
>cat > $msg || { rm $msg; exit 75; }
>exec 3< $msg || { rm $msg; exit 75; }
>rm $msg
>
> then I use it by rewinding it :
>
Hi Viktor,
I though I new a little of bash but in fact no ... you're a bash king !
if I understood it well :
first, I save the message in the file descriptor 3
msg=$(mktemp /tmp/msg.XX) || exit 75
cat > $msg || { rm $msg; exit 75; }
exec 3< $msg || { rm $msg; exit 75; }
rm $
On Wed, Dec 21, 2016 at 05:00:19PM +0100, Stéphane MERLE wrote:
> lemail=$(cat)
Instead of buffering the message into a shell variable, buffer it
into a temporary file (and set a "trap" command to delete the file).
You can then inspect the file content before sending the right
message.
It is po
Hi Wietse,
Le 21/12/2016 à 16:46, Wietse Venema a écrit :
St?phane MERLE:
at the top of my bash script I got :
lemail=$(cat)
Aaeeiigghh. Why not let the sendmail command read stdin.
see more explanations below
sendmail -i "$@" "$additional_recipient" < "$msg"
will it work without the "-f
St?phane MERLE:
> at the top of my bash script I got :
>
> lemail=$(cat)
Aaeeiigghh. Why not let the sendmail command read stdin.
> sendmail -i "$@" "$additional_recipient" < "$msg"
>
> will it work without the "-f" ?
If you invoke the script via
pipe ... argv=/path/to/script -f ${sender}
Hi Viktor,
Le 21/12/2016 à 15:02, Viktor Dukhovni a écrit :
On Wed, Dec 21, 2016 at 10:42:37AM +0100, Stéphane MERLE wrote:
when I send the mail content via sendmail :
sendmail -t $nouveau_destinataire <<< $lemail
This is wrong on many levels.
1. It revives *header* recipients, possibl
> On Dec 21, 2016, at 9:10 AM, Ansgar Wiechers wrote:
>
>>3. I has a mysterious "<<<", instead of "<".
>
> `... <<< $var` is bash 4 syntactic sugar for `echo $var | ...`.
An exceedingly bad way to handle message content, especially
sans quotes around "$var".
--
Viktor.
On Wed, Dec 21, 2016 at 10:42:37AM +0100, Stéphane MERLE wrote:
> when I send the mail content via sendmail :
>
> sendmail -t $nouveau_destinataire <<< $lemail
This is wrong on many levels.
1. It revives *header* recipients, possibly creating mail
loops and/or double deliveries. NEV
12 matches
Mail list logo