Table of Contents

Name

sms2mailgw - SMS to mail gateway module

Synopsis

sms2mailgw [ options ]

Description

sms2mailgw is a daemon program that will process the mailbox file created by sms_serv(1) and extract from it the messages that comply with a specified format. Those messages will then be converted to an email-compatible format and handed over to an SMTP-compliant MTA (typically sendmail(1) ) for delivery. The sms2mailgw daemon will automatically synchronize its mailbox-checking interval with the interval used by the sms_serv server module.

This manual page will cover the functionalities and use of sms2mailgw. For installation and configuration instructions, please refer to the GW-INSTALL document, provided in the sources directory.

Options

sms2mailgw now uses GNU getopt to parse its command line, and supports, for each option, its long or short form.
-cn, --mbchkinterval=n

Sets the incoming message box check interval to n seconds. Overrides the compiled-in default stored in the "MBCHKINTERVAL" macro defined in server/sms_serv.h. Please set this parameter to the same value you used for the sms_serv(1) daemon, in order to keep them in sync. A value of 0 (zero) disables the mailbox check completely and causes the sms2mailgw(1) daemon to exit. Acceptable values for the interval range from 60 (= 1 min.) to MAXINT. Compiled-in default as shipped: 3600 secs (= 1 hour).
-Fs, --defaultdomain=s

This option allows you to override the default DNS domain that the sms2mailgw server will be working for. The purpose of the default domain is to allow users of the gateway to shorten destination email addresses (the To: part). Any email address found in the incoming SMSes that is missing the "@something.xx" part will automatically get the default domain appended.
The server software should automatically detect the DNS domain it is working for (that is, provided its hostname properly resolves), but there are situations where you might want to override this (an example of such is when the server is working within an MS ActiveDirectory environment, where the internal DNS domain (the AD domain) is different from the SMTP mail domain (the one published "outside") -- yes, I've seen such a place !).
-Ms, --smtprelay=s

Sets to s the name of the SMTP relay that will be used by the mail sending routine. By default, the compiled-in SMTP relay is "localhost" -- which means that you should have a properly configured and running sendmail on the SMSLink server (even if all sendmail does is forward to a "smart relay" - the "DS" macro). This option allows you to override this behaviour and to address your mail directly to the appropriate SMTP relay.
-is, --pidfile=s

Uses the provided string as name for the PID file. By default, the PID file name would be /var/run/sms2mailgw.pid.
-d[n], --debug[=n]

Sets the debug level. If omitted, debug is turned off, and only the normal logging takes place. If the option is used, but the <level> is omitted, DEBUG_ALL is assumed. The <level> parameter allow you turn on or off special debug elements. This parameter is in fact a set of flags, whose meaning and value are defined in sms_serv.h.
-h, --help

Displays a short help text with the current program version and a list of supported options, then exits.

-v, --version

Displays the program version string and exits.

Sms Message Format

In order for an incoming SMS to be recognized as an email candidate by the sms2mailgw module, it has to comply to the following format:

T: name[, name] [C: name[, name]] [B: name[, name]] [R: name] [F: name] [S: text#]body

Please note that field headers are not case-sensitive, and can come in any order, except for the T: field that has to come first, and the S: field that has to come last before the message body. Multiple identical field headers are allowed. When a field can be multi-part, multiple identical fields are just added to each other. When such fields cannot be multi-part, the last occurance only will be used.

Also please note that the blank character between the ':' and the first letter of the field contents is optional. Optional as well is the blank following a comma in multi-part fields. But the blank separating the end of a field contents from the next field header is mandatory.

Fields and Field Contents

T: (To: field)
Required. Has to be the first field (an SMS is not considered a candidate email message if it doesn't begin with "T:"). Multi-part allowed (multiple names are separated by commas). Names are expanded as explained below (see name ).
C: (Cc: field)
Optional. Multi-part allowed (multiple names are separated by commas). Names are expanded as explained below (see name ).
B: (Bcc: field)
Optional. Multi-part allowed (multiple names are separated by commas). Names are expanded as explained below (see name ).
R: (Reply-To: field)
Optional. No multi-part support (any additional name entry after a comma is just dropped). When multiple "R:" fields are present, only the last one is used. Names are expanded as explained below (see name ).
Use the Reply-To: field to make sure the destination user can send a reply to a regular mailbox instead of directing it back at the SMS gateway.
F: (From: field)
Optional. No multi-part support (any additional name entry after a comma is just dropped). When multiple "F:" fields are present, only the last one is used. Names are expanded as explained below (see name ).
When not provided by the user, the From: field is automatically filled with a default value (the username assigned to the gateway module concatenated with the origin GSM number, followed by the hostname the gateway runs on and the domain). This will be used to allow for replies to be routed back to the sending GSM.
S: (Subject: field)
Optional. The field has to be terminated by a '#' character, to separate it from the body. The Subject field has to be the last one before the message body.
When not provided by the user, a default Subject: field is used, along the lines of An SMS for you from <source GSM number>.
body
The message body.
name
Any email address. Some shortcuts are allowed. If your network infrastructure supports delivering mail to addresses such as, for instance "first_last@your.domain", and if the gateway host is member of your.domain, then all addresses specified without any '@' character in them will automatically get expanded as "address@your.domain". The domain the gateway host is working for can be overridden at compile-time.
Please note that short and fully qualified version of email addresses can be mixed in fields that allow multi-part contents.
text
A text field (for the subject, for instance). As this kind of field can contain whitespaces, please use the '#' character to mark its end.

Files

/var/spool/smslink/inbox
File where the incoming messages will be stored. The file format details are explained in the server module man page. See sms_serv(1) .

/var/spool/smslink/checkpoint
Empty file "touched" by the server module (in order to alter its timestamp) after a mailbox check. The timestamp info of this file is used by sms2mailgw to synchronize its runs with the server module's checks.

Bugs

Quite a few of them maybe, but still less bugs than lacking features at this stage. See the BUGS document, in the sources directory.

See Also

sms_serv(1) , sendsms(1) , gsmdevices(5) , gsmaccess(5)

The INSTALL, TODO and README documents in the sources tree.

Copyright

SMSLink is (c) Les Ateliers du Heron, 1998-2006 by Philippe Andersson <philipa STRUDEL scarlet PUNKT be>. It has been originally written for Scitex Europe, S.A.

Part of the code is (c) Riccardo Facchetti.

The code also includes contributions from Philipp Klaus <pklaus@access.ch>, Andrew Worsley <epaanwo@asac.ericsson.se>, and numerous others. All contributors are acknowledged in the CHANGELOG document, and in the comment headers of the source files they modified.

SMSLink has been released to the public under the GNU GPL.

Home page: <http://smslink.sourceforge.net/ >


Table of Contents