Scan-to-Email using a sendmail relay

Last week, I got a printer from Freecycle. It’s a Samsung CLX-3160FN Multi-function colour laser.
I got it because A) it was free, B) it had a scanner, C) it has it’s own NIC, and D) it is toner-compatible with my current laser printer, meaning I can continue to use “compatible” (i.e. £8 vs. £60 for original) toner cartridges.

The scanner part is important, as the only one I have is about 13 years old. It is one of the first ones that was entirely USB powered, but it doesn’t have 64-bit drivers, so the only machines I can use it on are my Ubuntu server or my wife’s aging laptop with the Ubuntu HDD in.

As well as normal scanning, it also has the ability to scan to network (Windows machines using a small program in the taskbar) as well as scanning to Email. This is where the problem started.

The printer has the ability to enter SMTP settings into the web interface to send the email. Unfortunately, it doesn’t have the ability to send to secure SMTP servers such as GMail.

My Ubuntu server, however, does use GMail’s SMTP servers as a sendmail relay, so it can send me Cron Job status updates – notifying me of backups completed or failed as well as output from my rsync jobs.

After a few hours of mucking about, I settled on setting up sendmail to act as a local -> remote SMTP relay, allowing LAN clients to send SMTP connections to the server unsecured, which would then forward them to GMail securely.

To do this, I had to make modifications to /etc/mail/sendmail.mc to allow SMTP connections from Addresses otehr than 127.0.0.1, and then re-make sendmail.cf using M4.

After this, I had issues with the printer failing to send the mail with an AUTH failure – I had missed something somewhere.

Turned out, I hadn’t noticed the “access” file. Which had the line “192.168 RELAY” commented out. Once I uncommented this, the local -> Remote relay worked! Hurrah!

So now I have my Printer successfully sending email.

Share This!

Leave a Reply

Your email address will not be published. Required fields are marked *