wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,201
- Reaction score
- 5,219
True to form, Comcast has recently taken to screwing its customers by shutting down port 25 on your cable modem. Other ISPs will no doubt follow suit. This means you not only can't run your own SMTP server on a box such as PBX in a Flash, but you can't even connect through a mail client to your provider's SMTP server to send mail on the traditional port 25. To find out whether your provider has done it to you, issue the following command. If it times out, you lose. Otherwise, you're still OK. Type quit to exit.
[SIZE=-1]
telnet cutedgesystems.com 25[/SIZE]
What you basically need is an SMTP relay host that supports port 587 and 465 mail traffic. We already have documented how to do this with Comcast, but you also can use gMail. Also take a look at this simple way to enable a relay host directly in SendMail.
Configuring gMail to handle the change was painful so I thought I'd document the steps for those of you that get screwed next. When you complete the following steps, outbound emails (including voicemails that have been configured for delivery by email in FreePBX) will be sent from your PBX in a Flash server through SendMail to gMail's secure server on port 587 or 465 for forwarding. You will need your gMail username and password to complete this install.
IMPORTANT: First enable sign in from Less Secure Apps for your Gmail account here.
This tutorial is for PBX in a Flash systems only and assumes you already have performed the email fixup steps outlined in this Nerd Vittles tutorial. If not, do that first. Then log into your server as root and issue the following commands in order:
NOTE: On Ubuntu, Debian, and Raspberry Pi, you may get errors restarting SendMail. If so, execute the following commands and then press Enter for all of the default settings in the last step.
IMPORTANT: BEFORE CONTINUING, Your hostname in /etc/hosts and /etc/hostname MUST be a fully-qualified domain for this SendMail implementation, e.g. raspberrypi3.incrediblepbx.com will work even though it is not resolvable.
Now you should be back in business. Special thanks to Linux Home Automation and this thread for all the helpful information.
Test your new mail setup by sending yourself an email using your email address below. Be sure to check your SPAM folder.
WARNING: This design has not been tested with direct exposure of SendMail to the Internet and should NOT be used without at least the PBX in a Flash firewall in place to block inbound port 25 and 587 and 465 traffic. If you don't heed this advice, you may risk turning your server into an Internet mail relay host in which case you'll probably lose (what's left of) your broadband account for aiding and abetting the proliferation of...
[SIZE=-1]
telnet cutedgesystems.com 25[/SIZE]
What you basically need is an SMTP relay host that supports port 587 and 465 mail traffic. We already have documented how to do this with Comcast, but you also can use gMail. Also take a look at this simple way to enable a relay host directly in SendMail.
Configuring gMail to handle the change was painful so I thought I'd document the steps for those of you that get screwed next. When you complete the following steps, outbound emails (including voicemails that have been configured for delivery by email in FreePBX) will be sent from your PBX in a Flash server through SendMail to gMail's secure server on port 587 or 465 for forwarding. You will need your gMail username and password to complete this install.
IMPORTANT: First enable sign in from Less Secure Apps for your Gmail account here.
This tutorial is for PBX in a Flash systems only and assumes you already have performed the email fixup steps outlined in this Nerd Vittles tutorial. If not, do that first. Then log into your server as root and issue the following commands in order:
Code:
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
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
# Stop here and edit client-info (nano -w client-info) in both lines.
# Replace user_idwith your gMail account name without @gmail.com
# Replace password with your real gMail password
# Be sure to replace the double-quotes shown above if they don't appear in the file!!!
# Save your changes (Ctrl-X, Y, then Enter)
chmod 600 client-info
makemap -r hash client-info.db < client-info
cd ..
yum -y install sendmail-cf
make
service sendmail restart
NOTE: On Ubuntu, Debian, and Raspberry Pi, you may get errors restarting SendMail. If so, execute the following commands and then press Enter for all of the default settings in the last step.
IMPORTANT: BEFORE CONTINUING, Your hostname in /etc/hosts and /etc/hostname MUST be a fully-qualified domain for this SendMail implementation, e.g. raspberrypi3.incrediblepbx.com will work even though it is not resolvable.
Code:
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
Now you should be back in business. Special thanks to Linux Home Automation and this thread for all the helpful information.
Test your new mail setup by sending yourself an email using your email address below. Be sure to check your SPAM folder.
Code:
apt-get install mailutils -y
echo "test" | mail -s testmessage [email protected]
WARNING: This design has not been tested with direct exposure of SendMail to the Internet and should NOT be used without at least the PBX in a Flash firewall in place to block inbound port 25 and 587 and 465 traffic. If you don't heed this advice, you may risk turning your server into an Internet mail relay host in which case you'll probably lose (what's left of) your broadband account for aiding and abetting the proliferation of...
Last edited: