SSMTP MTA with attachments built in Switchfin |
|
Sunday, 28 February 2010 23:01 |
As you know Switchfin has built in SMTP mail transfer agent (MTA) called SSMTP. Hawever it is not a trivial task to send e-mail containing attached file from the system without real SMTP client.
Fortunately there is a simple solution which we have implemented in the Switchfin trunk. File to be attached is first base64 encoded using uuencode (busybox). Then it is pretty trivial to resemble the MIME header/foother and send the result to SSMTP MTA.
The current implementation is intended for attaching tiff images but can be used to attach any file type. Usage:
root@br4:~> ./bin/mailfile.sh image.tif
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
Keep in mind that before using SSMTP you need to configure your SMTP server settings on the hardware target. The esiest way is to do this in the GUI. Go to Voicemail -> SMTP Settings and enther the IP address/port of your SMTP server. For my network address is 192.168.1.2 and port 25.
Cheers! Dimitar
|