Stunnel: How to use your Scanner Email functionality with SSL Email


Gmail is popular by many means, so I have been using Gmail to receive scans from my Brother scanner/printer (MFC6890CDW). Somewhere in 2014 Gmail went to receiving Email encrypted only (using SSL). However, the printer does not support SSL when sending email, it expects a plain SMTP server to listen. There is no elegant way to solve this, so here is what I did: I used a RaspberryPi, which is running some other software for me, as a server to run stunnel4 – s(ecure)tunnel) – which wraps the connection from my sanner to Gmail into SSL. Here are the instructions that worked for me:

  1. Log in to your RaspberryPi and update your packages lists by using:
    sudo apt-get update
  2. Install stunnel4 using
    sudo apt-get install stunnel4
  3. Configure file /etc/stunnel/stunnel.conf, and add the following (one) line at the end of it:
    [SMTP Gmail]
    client = yes
    accept = 0.0.0.0:25
    connect = smtp.gmail.com:465
  4. Generate stunnel.pem key (needed for the encryption) and copying to the desired place by using:
    cd /etc/stunnel/
    sudo openssl genrsa -out key.pem 2048
    sudo openssl req -new -x509 -key key.pem -out cert.pem -days 1095
    sudo su
    cat key.pem cert.pem > /etc/stunnel/stunnel.pem
    exit
    cp /etc/stunnel/stunnel.pem /etc/ssl/certs

Note that this key runs out after 1095 days, so you need to revisit that at some point.

  1. Configuring (a Brother in this case) printer via ControlCenter3: Start ControlCenter3 -> device settings -> remote setup (standard password „access“) -> server settings -> SMTP server -> IP address (that is the IP address of the machine running stunnel) -> SMTP port 25 -> account name „your.name@gmail.com“ -> Account password -> „Your Password“
  2. Start stunnel using /etc/init.d/stunnel start

That did it for me! Good luck!


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert