Email Notifications Driver using Node/sendmail on a PI

In the Hubitat virtual device, I have my gmail account.

It appears that using SMS will generate these strange numbers; changing each time a text (email) is sent. However, when I use MMS, the text shows it is from my gmail account (always).

So, SMS gives me one unique receipt for every text
MMS gives me one recipient with every text from that contact

How did you get MMS instead of SMS?

You simply email to a different server. See below:

US Cell Providers "Email to Txt" Email Addresses

========================================================
AT&T: {cell number}[at]txt.att.net (SMS), {cell number}[at]mms.att.net (MMS)
T-Mobile: {cell number}[at]tmomail.net (SMS & MMS)
Verizon: {cell number}[at]vtext.com (SMS), {cell number}[at]vzwpix.com (MMS)
Sprint: {cell number}[at]messaging.sprintpcs.com (SMS), {cell number}[at]pm.sprint.com (MMS)
XFinity Mobile: {cell number}[at]vtext.com (SMS), {cell number}[at]mypixmessages.com (MMS)
Virgin Mobile: {cell number}[at]vmobl.com (SMS), {cell number}[at]vmpix.com (MMS)
Tracfone: {cell number}[at]mmst5.tracfone.com (MMS)
Metro PCS: {cell number}[at]mymetropcs.com (SMS & MMS)
Boost Mobile: {cell number}[at]sms.myboostmobile.com (SMS), {cell number}[at]myboostmobile.com (MMS)
Cricket: {cell number}[at]sms.cricketwireless.net (SMS), {cell number}[at]mms.cricketwireless.net (MMS)
Republic Wireless: {cell number}[at]text.republicwireless.com (SMS)
Google Fi (Project Fi): {cell number}[at]msg.fi.google.com (SMS & MMS)
U.S. Cellular: {cell number}[at]email.uscc.net (SMS), {cell number}[at]mms.uscc.net (MMS)
Ting: {cell number}[at]message.ting.com
Consumer Cellular: {cell number}[at]mailmymobile.net
C-Spire: {cell number}[at]cspire1.com
Page Plus: {cell number}[at]vtext.com

4 Likes

That is great info thanks!!!

1 Like

Anyone seeing delays in receiving text via AT&T (sent to <MOBILE_NUMBER>@mms.att.net)? I am sending an email and text - the email gets there right away but the text is delayed by up to 2 hours.

I'm bringing this thread back to life - hopefully to help anyone else whose notifications using this driver stopped working, like mine did.

When I setup sendmail, I created a dummy Gmail account and used the account option to permit "Less Secure App" access to sendmail from my SBC using the dummy account. As of May 30th, 2022, Google has turned off less secure app access. Instead, they require the use of app specific passwords, which is more secure anyway. Here are the steps needed:

  1. Login to the Google account.
  2. Turn on 2-factor authentication. This is needed to generate app-specific passwords
  3. Generate an app specific password for your sendmail needs and copy down the 16-character password.
  4. On your SBC (most often RPi), go to the directory /etc/mail/authinfo
  5. Edit the sendmail authentication file (I called mine gmail-auth) and replace the less secure cleartext password with the 16-character app-specific password.
  6. Recreate the hash database using the command (assuming your authentication file is called gmail-auth):
    makemap hash gmail-auth < gmail-auth
  7. Stop and restart sendmail

Took less than 5 minutes to get it up and running again after I realized that Google had turned off the "less secure app access" option.

3 Likes

I just noticed that I wasn't getting any emails/texts.

Thanks @aaiyar - I will try this.

2 Likes

@ashok:
I tried this, but apparently it's not working, my trace shows:

050 454 4.7.0 Too many login attempts, please try again later. u3-20020a372e03000000b006a323e60e29sm17015075qkh.135 - gsmtp

Could perhaps the problem be that in the sendmail.mc file, there is a line:

define(SMART_HOST',[smtp.gmail.com]')dnl
define(RELAY_MAILER_ARGS', TCP $h 587')dnl
define(ESMTP_MAILER_ARGS', TCP $h 587')dnl
define(confAUTH_OPTIONS', A p')dnl
TRUST_AUTH_MECH(EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl define(confAUTH_MECHANISMS', EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl

Is the word "PLAIN" still appropriate?

You should not have to edit sendmail.mc, or recreate a new sendmail.cf using m4.

From the error that you have posted, the MTA would appear not to be using the new 16-character app password.

Just to confirm:

  1. You edited /etc/mail/authinfo/gmail-auth?
  2. You re-created /etc/mail/authinfo/gmail-auth.db using the command (as root) makemap hash gmail-auth < gmail-auth?
  3. sendmail was restarted?

Can we confirm the usernames and permissions on the relevant files?

Here are mine:

-rw------- 1 root  smmsp    68 Jun  7 15:51 gmail-auth
-rw-r----- 1 smmta smmsp 12288 Jun  7 15:51 gmail-auth.db

And /etc/mail/authinfo should be:

drwx--S--- 2 root smmsp 4096 Jun 7 16:02 authinfo

Also, the structure of /etc/mail/authinfo/gmail-auth should be something like:

AuthInfo: "U:root" "I:your_username@gmail.com" "P:16_character_app_passwd"

BTW, FWIW, my sendmail.mc is identical to yours:

dnl # Default Mailer setup
#
MAILER_DEFINITIONS
define(`SMART_HOST',`[smtp.gmail.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
1 Like

Confirming:

  1. edited /etc/mail/authinfo/gmail-auth
  2. recreated *.db using hash command
  3. sendmail was stopped and then started

Usernames & permissions:
image

gmail-auth is the same as you have it, except that I use "pi" instead of "root"

Does the user "pi" have permission to mail?

OK.
Well, I will change it to "root" and see if that make a difference.

pi might have permission - it can be tested from the command line.

1 Like

Well, I changed it to "root" and got the same error.

1 Like

I am at a loss. There's no error in the 16 character code is there?

1 Like

Question: Should I leave the 2 factor identification on? Or, should I turn it off, once i GENERATED THE APP PASSWORD?

Yes, leave it on.

This is the way it's displayed by Google:
image

1 Like

Yeah, once the password is created, it will not be displayed again.

When you entered the app password, had you kept the spaces? If so, remove them and re-create /etc/mail/authinfo/gmail-auth.db, and restart sendmail.

If that doesn't work, delete that app password, create a new one and try it again. I saved a copy of the app password elsewhere - just in case I made an error in copying it.

Indeed.
I didn't use the spaces. (It's exactly 16 characters).
I created a new one:

Unfortunately, the same result.