QUIRK IPBX 13-13.7 RASPI Sendmal via Gmail instructions have wrong syntaxes

SMTC

Member
Joined
Jan 22, 2009
Messages
190
Reaction score
13
From NERDVITTLES
http://nerdvittles.com/?p=21255

Here are the steps to modify SendMail to use an existing Gmail account as a SmartHost. Log into your RasPi as root and issue the following commands:

cd /etc/mail
hostname -f > genericsdomain
touch genericstable
makemap -r hash genericstable.db < genericstable
mv sendmail.mc sendmail.mc.original
wget http://incrediblepbx.com/sendmail.mc.gmail
cp sendmail.mc.gmail sendmail.mc
mkdir -p auth
chmod 700 auth
cd auth


OK to here. The "\"'s below DON'T work as a cut/paste into Putty. You'll need to edit your client-info files to remove the slashes.

echo AuthInfo:smtp.gmail.com \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" > client-info
echo AuthInfo:smtp.gmail.com:587 \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" >> client-info
echo AuthInfo:smtp.gmail.com:465 \"U:smmsp\" \"I:user_id\" \"P:password\" \"M:PLAIN\" >> client-info
nano -w client-info

When the nano editor opens the client-info file, change the 3 user_id entries to your Gmail account name without @gmail.com and change the 3 password entries to your actual Gmail password. Save the file: Ctrl-X, Y, then ENTER.

Now issue the following commands. In the last step, press ENTER to accept all of the default prompts:

chmod 600 client-info
makemap -r hash client-info.db < client-info
cd ..
make


The SED commands below don't work. I had to add a preceding \ in front of the /cf. Also had to add a "g" option at end before quote.
i.e.
sed -i 's/sendmail-cf/sendmail\/cf/g' /etc/mail/sendmail.mc
and so on for each of the other files.


sed -i 's|sendmail-cf|sendmail/cf' /etc/mail/sendmail.mc
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/sendmail.mc
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/Makefile
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/sendmail.cf
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/databases
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/sendmail.mc.gmail
sed -i 's|sendmail-cf|sendmail/cf|' /etc/mail/sendmail.cf.errors
sendmailconfig

Finally, stop and restart SendMail and then send yourself a test message. Be sure to check your spam folder!

/etc/init.d/sendmail stop
/etc/init.d/sendmail start
apt-get install mailutils -y (already existing in my install)
echo "test" | mail -s testmessage [email protected]
 
Last edited by a moderator:

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
19,206
Reaction score
5,228
Just an FYI that the backslashes above work fine in SSH which now is available on ALL platforms including Windows so... ditch Putty.
 

SMTC

Member
Joined
Jan 22, 2009
Messages
190
Reaction score
13
Thanks @wardmundy about just trying the Windows SSH.

BUT, the first sed stmt still has a delimiter missing and is a duplicate of second.

The install scripts are great at getting things up. I find however managing the re-entry of:
  1. RASPI and Asterisk and SIP environment tweaks
  2. Re-doing all the trunks
  3. routes
  4. extensions
  5. IVR trees
  6. and all the various audio files
is really slowing me down to get to a finish line. Also lost are the mailbox greetings and any stored user messages.

Bottom line, upgrades are akin to experiencing a total system loss and replacement. My old environment was just peachy except for the loss of GV trunk.

Perhaps I don't do this often enough to know what editors to use, how to cut and paste easily from old environment to the new and maybe to NOT try and use the RASPI console with USB Keyboard and HDMI output since there is no "@" sign on the US keyboard in the default UK mode that trashes the script when setting up certain of the passwords!

I don't mind doing it, but sometimes its just remembering how to do it and where to find stuff again. Just a lot more GOTCHAS than I'd hoped for.

But alas, I am not complaining! The price is right, the tech is pretty cool and as my wife keeps saying I can ditch the whole thing and just use my cell phone.

Chive on!
J
 

Members online

Forum statistics

Threads
25,825
Messages
167,849
Members
19,250
Latest member
mark-curtis
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top