

Command Line Faxing - zrail
https://www.petekeen.net/command-line-faxing

======
jnankin
Phaxio co-founder here. Thanks for the write up, Pete! Really great to see the
product we've been bootstrapping for 3 years on the front page of HN. We're
devoted to making developer faxing as easy as possible. If you have any
comments or questions about the service, feel free to contact me directly at
josh at phaxio dot com.

------
joosters
In general, it's a terrible idea to run a command that contains secret
information _in the command line_. The 'API secret' will be viewable by any
user on the machine. (For instance, they could run 'ps waux' and grab the key)

Of course, the script could be running on a machine with only one user, so
there might be no problem for this specific case. But it's just good practice
to avoid creating potential security holes.

~~~
zrail
Yep, absolutely right. This is just running on my laptop so there's no other
user, but a server-based solution should absolutely hit the API using
something like Faraday[1] or requests[2].

[1]:
[https://github.com/lostisland/faraday](https://github.com/lostisland/faraday)

[2]: [http://docs.python-requests.org/en/latest/](http://docs.python-
requests.org/en/latest/)

~~~
joosters
I think there's an even easier fix here; you can solve it by getting curl to
read the form parameters from a file (I'm not 100% sure, the manpage seems to
suggest that -F can take a file source, but it might just be referring to how
to upload an entire file?)

------
cpr
Nice work, thanks for documenting!

We've been very happy with the HelloFax (YC W11) service for some time now.

We pay $5/month for the once-every-few-months fax we get or send, but it still
seems like a good deal for an official fax interface to the world. It's
painless to use and has a pleasant web interface.

~~~
zrail
Thanks!

I was initially using eFax but their $16.99/mo fee was waaay too high for my
usage, so then I tried to use HelloFax but their sign up form was busted.
Ended up with Phaxio while searching for an API to power my own web-based fax
app which never materialized after I found the email integration.

------
zrail
Note: Phaxio hasn't compensated me for this post. I'm just a happy small-time
customer :)

~~~
otoburb
Thanks for the write-up. This hits a serious pain point for anybody needing to
interface with older institutions or businesses preferring fax as their main
communication channel.

Appreciate the reminder of the OS X Preview signature signing capability!

------
ef4
Thanks. I have integrated with both Pamfax and Interfax, and neither really
makes me happy. I will check this out in detail.

HelloFax is also a great service, but not comparable. It's for end users, not
a programmable API.

~~~
hsitz
I have been happy with Faxaway. I think my $10 payments each last me almost a
year, given how much I use the service ($1/month plus $0.11 per minute sending
in U.S., receive faxes for free). The interface is email: put fax phone number
+ '@fax2.faxaway.com' as recipient, 'FAXDOC' as subject, and attach pdf of
document you're faxing. Works great.

~~~
dergachev
We've been using myfax.com for $10/month and it works the same way. Hasn't
failed us once in many years, but kind of pricy. Maybe worth considering a
cheaper alternative.

------
sunsu
I highly doubt that actually have "a whole bunch of fax machines" or even
"banks of modems" anywhere. They are probably just using FreeSWITCH.

~~~
zrail
Oh I had no idea FreeSWITCH lets you send faxes. That makes a lot more sense
:)

~~~
vladimirralev
Not only that, but sending a fax from your own freeswitch is a one-liner from
the command line itself like this:

    
    
      fs_cli originate sofia/sipinterface/destination@privider &txfax(/fax.tiff)

------
latchkey
I solved this issue with an obi200 + cheapo fax machine + google voice. I need
a hardware solution because my non-techie wife needs to be able to fax without
my help. I had a obi100 but it couldn't fax at all, so I sold it for a small
profit (ha!).

I also got an email from Obihai recently saying that GV is discontinuing fax
support, but so far it seems to continue working just fine, shrug.

------
tfrivold
I really like this guide. Also because it gives me a nice example of how to
use an API with Python (I'm learning stuff). Much apprechiated!

------
rsync
On the one hand, this interests me because I am a unix user and I hate faxing
so, so much.

But on the other hand, this just promotes faxing. Faxing needs to die,
immediately. Nobody anywhere should be faxing anything for any reason, ever.

The only reasonable response to (anything to do with faxing) is this:

[http://cdn.shopify.com/s/files/1/0042/9942/products/hatedeat...](http://cdn.shopify.com/s/files/1/0042/9942/products/hatedeath_det_medium.jpeg?v=1285423431)

------
anarchoni
Easily the coolest thing I've seen in a while.

------
tghw
Does Ruby not have a good HTTP library? Why would you ever shell out to curl?

~~~
zrail
Because I'm lazy, basically. I already had a working curl command, I just
wanted to make it sanity check my arguments. Also, in my experience convincing
the various Ruby libraries to do multipart form uploads (for the documents
themselves) is sort of a pain (but if there's an alternative I would love to
hear it!)

~~~
tghw
Sorry, can't make any Ruby suggestions. I spend more time in the Python world
where we have requests[0], which makes it all dead simple.

For example, multipart file uploads looks like:

    
    
        files = {'filename[]': open(filename, 'rb')}
        data = {'to': to, 'api_key': api_key, 'api_secret': api_secret}
        response = requests.post(url, data=data, files=files)
    

[0][http://docs.python-requests.org/en/latest/](http://docs.python-
requests.org/en/latest/)

