mgetty
Short URL: http://fsmsh.com/2033
- 2007-01-28
-
Write a full post in response to this!
By many people, sending and receiving faxes on GNU/Linux is considered to be equivalent to using HylaFAX. And while I agree that HylaFAX is a nice piece of software with a nice set of features, I found that sometimes it can be rather overwhelming to set up. If you need some of its more advanced features, such as its client-server protocol that’s used for Windows clients, then HylaFAX is a great choice. But if you don’t need all that, then I believe mgetty is a much wiser choice…
Background
The transmission standard for faxes is very similar to modem technology; a fax may send data at a speed of either 9600 or 14400 bps. Since there are some differences, a modem does need some modifications to allow for sending and receiving faxes; so not all modems will support sending and/or receiving faxes at all. Most will, however. Obviously the computer also needs to know whether the incoming transmission contains fax data or is just a data transmission; but that’s easy to find out, since the modem will tell the software this. Additionally, since the beginning of a PPP connection is rather peculiar, it’s pretty easy to figure out whether you’re talking to a PPP connection or whether the incoming data transmission contains some random junk.
With mgetty, it’s possible to exploit this so that one can use a single modem as a fax receiver, to handle incoming PPP connections, and to give people the ability to log in through a getty connection on the modem line. Additionally, mgetty can send out faxes as well, and even handle voice calls, if your modem has support for that. Incoming faxes will be handed to a script; the default script will convert the fax to an image file in one of a number of formats, and mail that off to a configurable user.
Setting up incoming data traffic
So, how does all this work? It’s quite simple, really:
First, you need to install mgetty, either by using the packages in your distribution, or from source.
Next, edit the configuration files. In prepackaged distributions, these are often found in /etc/mgetty; the most important one for incoming data is /etc/mgetty/login.config, which specifies what to do with incoming transmissions. It can be as simple as containing two lines:
/AutoPPP/ - a_ppp /usr/sbin/pppd auth -chap +pap login proxyarp debug * - - /bin/login @
Which will allow incoming PPP connections, provided the user specifies a username and password that exist in /etc/passwd, encoded using PAP; or it will allow a non-PPP data connection by just giving the user a plain-text login prompt, where the user should log in with the same username and password.
It’s important to realize that PAP and getty logon procedures require passwords to be sent out in the clear over the wire; if you’re interested in a slightly more secure setup, you may want to look into using CHAP rather than PAP; but note that then you can’t use passwords from /etc/passwd then, while CHAP isn’t an encryption system either; it’s just a rather weak password scrambling system. Also note that login.conf gives you a pretty flexible way of disallowing certain users to log in; if you don’t want every user in /etc/passwd to be able to log on to your modem via your getty, you can replace the * in the second line by a username (you would need to add a line per user who is allowed to log in).
Now it’s time to put mgetty in your /etc/inittab. Add a line like this:
S0:2345:respawn:/sbin/mgetty -x0 -s 57600 ttyS0
And take care to ensure that the first two letters are unique in your entire inittab, that the 57600 is modified to be the correct speed for your modem, and that the “2345” includes the runlevel your system defaults to.
With that, you have a running and working mgetty setup. You can receive faxes; you can receive PPP calls to investigate if something goes wrong with your network; and you can receive “regular” getty logins through a modem in case something goes totally awry and even PPP doesn’t work.
Faxing
After setting up mgetty as described above, receiving faxes is enabled by default, but it can be disabled by specifying a -D option on the mgetty command line in inittab; -D, for “Data only”. Similarly, data calls can be disabled by use of the -F command line option, for “Fax only”. If you choose to enable receiving faxes, then the /etc/mgetty/new_fax script is executed when a fax is received. As explained before, the default new_fax script will mail the fax off to a specified user after conversion to a specific image format; you may want to edit the that file to modify the recipient of fax mails, and/or the image format to which faxes are converted.
If you also want to send faxes using your mgetty setup, then you need a bit more work. Not much, though:
First, edit /etc/mgetty/mgetty.config, /etc/mgetty/sendfax.config, and /etc/mgetty/faxrunq.config, which require some configuration regarding your modem, your fax ID (the string, usually containing your name, which is listed on top of every outgoing fax), and some other things. These files are pretty well documented and straightforward; I can’t really explain them here. Next, make sure that faxrunqd is running; on Debian, you do this by way of the /etc/init.d/mgetty-fax initscript. Finally, you can send faxes by way of the faxspool command: faxspool +3231234567 file1.ps file2.ps file3.ps will convert three postscript files to the right Fax encoding, and queue them for transmission. Faxspool will accept files in either Postscript or plain ASCII format; it also supports delayed transmission (e.g., queueing a fax for transmission at night). For more information on this and several other features, please see the faxspool manpage.
Conclusion
While mgetty does not support a client-server protocol such as is the case with HylaFAX, which makes sending faxes from Windows clients slightly more complicated, it is a nice piece of software that is easy to set up, and supports many advanced fax features, as well as a number of other things. If you tried HylaFAX and didn’t like it—or just if you don’t need all the maintenance overhead—mgetty may be something for you.
Resources
Write a full post in response to this!
Similar articles
Do you like this post?
Vote for it!
Copyright information
This entry is (C) Copyright by its author, 2004-2008. Unless a different license is specified in the entry's body, the following license applies: "Verbatim copying and distribution of this entire article is permitted in any medium without royalty provided this notice is preserved and appropriate attribution information (author, original site, original URL) is included".
Biography
Wouter Verhelst: Wouter is an independent contractor specializing on Free Software. In his free time, he contributes to the Debian Project as a Debian Developer.
- Wouter Verhelst's posts
- Login or register to post comments
- 7537 reads




Best voted contents
Buzz authors
Free Software news
- RT @turicas: The #Arduino #HackNBeer yesterday with @maddoghall at #UFF (in Niterói/RJ - Brazil) was amazing! \o/ #freesoftware #FTW
- Second Sole of Ohio | marymoome: http://tinyurl.com/25y6nzv #coolest #freesoftware #freesoftware Amor no respeta l... http://bit.ly/azeueY
- http://tinyurl.com/25y6nzv #coolest #freesoftware #freesoftware Amor no respeta ley ni obedece a rey A diario una manzana es cosa sana
- via @Developpez A new font for easier code writing: http://bit.ly/9AADsE under #OpenFontLicense #freesoftware
- RT @turicas: The #Arduino #HackNBeer yesterday with @maddoghall at #UFF (in Niterói/RJ - Brazil) was amazing! \o/ #freesoftware #FTW
Similar entries
Other sites
- The Top 10 Everything (Dave). The good, the bad and the ugly.
- Free Software news (Dave & Bridget). All about free software -- free as in freedom!
- Book Reviews: Illiterarty (Bridget). Book reviews, blogs, and short stories.
Hot topics - last 60 days
-
10 years on: free software wins, but you have nowhere to install it
Tony Mobily, 2010-07-29 -
Tales From the Front: in Search of APT-GET UNDO
Rosalyn Hunter, 2010-08-13 -
Finding Free Music for a Free Film with Jamendo, VLC, and K3B
Terry Hancock, 2010-07-13 -
The Jargon of Freedom: 60 Words and Phrases with Context
Terry Hancock, 2010-07-24 -
MediaWiki and Script Translation for the Morevna Project
Terry Hancock, 2010-07-07
Hot topics - last 21 days
-
Net Neutrality: what does the Google Verizon proposal mean for GNU Linux?
Gary Richmond, 2010-08-16 -
The Bizarre Cathedral - 78
Ryan Cartwright, 2010-08-16 -
The Bizarre Cathedral - 79
Ryan Cartwright, 2010-08-24 -
Flip: A Simple Camera Done Right
Terry Hancock, 2010-08-31
Free Software Magazine uses Apollo project management and CRM for its everyday activities!

Faxing using mgetty
Submitted by Anonymous visitor on Sun, 2007-02-18 15:38.
Vote!I prefer mgetty in any case
Kirsty
how to connect intrenet thro. mobile for kubuntu
Submitted by saravanan r t (not verified) on Mon, 2007-12-17 07:09.
Vote!hai,
can u clarify how to connect internet thro. my mobile device(Sony K750i) for kubuntu os.