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]
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: