From user-return-22986-apmail-couchdb-user-archive=couchdb.apache.org@couchdb.apache.org Wed Dec 5 14:18:10 2012 Return-Path: X-Original-To: apmail-couchdb-user-archive@www.apache.org Delivered-To: apmail-couchdb-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C38E5ECA4 for ; Wed, 5 Dec 2012 14:18:10 +0000 (UTC) Received: (qmail 47187 invoked by uid 500); 5 Dec 2012 14:18:09 -0000 Delivered-To: apmail-couchdb-user-archive@couchdb.apache.org Received: (qmail 46994 invoked by uid 500); 5 Dec 2012 14:18:09 -0000 Mailing-List: contact user-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@couchdb.apache.org Delivered-To: mailing list user@couchdb.apache.org Received: (qmail 46966 invoked by uid 99); 5 Dec 2012 14:18:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2012 14:18:08 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of m.bykov@gmail.com designates 209.85.220.180 as permitted sender) Received: from [209.85.220.180] (HELO mail-vc0-f180.google.com) (209.85.220.180) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2012 14:18:03 +0000 Received: by mail-vc0-f180.google.com with SMTP id p16so4172148vcq.11 for ; Wed, 05 Dec 2012 06:17:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=uUUj5RgUpZmc3FZY8skmHJGntE9qRf46AywITtXFkDo=; b=iazJ6Y1WS7VkGFv/Qbx5HGVGA6XfsriDQ+W1ZxN3OvE9iY3c8/2AlNvsvIILINvTwS DPjWx6l1NXvnKdwDc3T2HyDzCLM7Y2aNaiy4e2f8wxv3ng40vNRvQ/63+aYtoK1KccQJ p+sJujN1FB3hpf4penqfAzxZv/3yfvPrUhtgWsBKMCdsEAes80NN2xD6Rdj7K/TCkgOL NWfYSitLAOpWds2Y1oVIExMfT1An0hregxjt1U6fMhIO0q4VP+JAQj0HYc4GErTE2307 MQ3IiQSu4sa0L7nZPV7Oqupe2iJ5tPnUwVI0ven7L4gwpbPRMZlc14wzCKV55/3+0GfJ e09Q== MIME-Version: 1.0 Received: by 10.52.19.20 with SMTP id a20mr13631190vde.26.1354717062659; Wed, 05 Dec 2012 06:17:42 -0800 (PST) Received: by 10.58.221.229 with HTTP; Wed, 5 Dec 2012 06:17:42 -0800 (PST) Date: Wed, 5 Dec 2012 17:17:42 +0300 Message-ID: Subject: send mail with /bin/mail From: Michael Bykov To: user@couchdb.apache.org Content-Type: multipart/alternative; boundary=bcaec50408384a802304d01ba5eb X-Virus-Checked: Checked by ClamAV on apache.org --bcaec50408384a802304d01ba5eb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, I am trying work with external process (i.e. sending a mail) [external] mail=3D/bin/bash /home/michael/web/socadimo/morpheus/lib/mail.sh [httpd_db_handlers] _mail =3D {couch_httpd_external, handle_external_req, <<"mail">>} mail.sh is: #!/bin/bash subject=3D"$# parameters $1" email=3D"m.bykov@gmail.com" echo "this is an email message test"> $message /bin/mail -s "$subject" "$email" < $message With curl "http://localhost:5984/diglossa/_mail?par=3Dtest" 1) I got message in Gmail, script works OK. But without parameters, i.e subject is "0 parameters". 2) In console log I got, nevertheless, an error: {"error":"{bad_return_value,{os_process_error,{exit_status,0}}}","reason":"= {gen_server,call,\n, ... etc Please, advice me, is it correct approach? If so, how I can get the parameters in email? --=20 =D0=9C. http://diglossa.ru xmpp://m.bykov@jabber.ru --bcaec50408384a802304d01ba5eb--