incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bykov <m.by...@gmail.com>
Subject send mail with /bin/mail
Date Wed, 05 Dec 2012 14:17:42 GMT
Hi,

I am trying work with external process (i.e. sending a mail)

[external]
mail=/bin/bash /home/michael/web/socadimo/morpheus/lib/mail.sh

[httpd_db_handlers]
_mail = {couch_httpd_external, handle_external_req, <<"mail">>}

mail.sh is:

#!/bin/bash
subject="$# parameters $1"
email="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=test"

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?


-- 
лю.

http://diglossa.ru
xmpp://m.bykov@jabber.ru

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message