Linux Sendmail automation and Comcast.net, How to setup?

Posted by Jiltin     19 June, 2009    7,519 views   

email_diagram.gif Did you face this issue “550 5.7.1 [BL21] Connections not accepted from IP addresses on Spamhaus PBL”?

Follow the note, you will resolve the issue. I got it working in 10 minutes!

Yahoo says (http://help.yahoo.com/l/au/yahoo7/mail/postmaster/550-bl21.html) “In our continuing efforts to protect our users from unsolicited email, Yahoo! Mail does not accept SMTP connections from dynamic or residential IP addresses, as determined by the Spamhaus PBL. If you are seeing this error message, please do not retry sending your message using the same IP address. Instead, please contact your ISP for information on which SMTP server you are authorized to use for your outbound email.

If you think that your IP address has been listed in error, you or your email administrator should contact Spamhaus. Once your IP is de-listed by Spamhaus, Yahoo! Mail will automatically unblock your IP within 48 hours”.

Recently Comcast changed it’s sending mail port from port 25 to port 587 for some (???) end users. It got a little long and detracted from the main subject of this page.

I’m now also able to use Gmail with sendmail. This is my current working setup.

Now for Sendmail, it’s a lot more complicated than just changing a mail sending port number from 25 to 587. There are things to check and lots of little configuration changes to make. Before you start wondering why are you going through this exercise remember that with power comes responsibility. Sendmail is very power. So lets start with the files you will need to change:

* /etc/mail/sendmail.mc
* /etc/mail/auth/client-info

This is where the files are on my Linux box (Fedora FC 6). Changes I made to /etc/mail/sendmail.mc (added to the end of the file):

dnl # Changes I made to /etc/mail/sendmail.mc
define(`SMART_HOST’,`smtp.comcast.net’)
define(`RELAY_MAILER_ARGS’, `TCP $h 587′)
define(`ESMTP_MAILER_ARGS’, `TCP $h 587′)
define(`confAUTH_MECHANISMS’, `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN’)dnl
FEATURE(`authinfo’,`hash /etc/mail/auth/client-info’)dnl

FEATURE(`no_default_msa’,`dnl’)dnl
FEATURE(`smrsh’,`/usr/sbin/smrsh’)dnl
FEATURE(`mailertable’,`hash -o /etc/mail/mailertable.db’)dnl
FEATURE(`virtusertable’,`hash -o /etc/mail/virtusertable.db’)dnl
FEATURE(redirect)dnl
FEATURE(always_add_domain)dnl
FEATURE(use_cw_file)dnl
FEATURE(use_ct_file)dnl

MASQUERADE_AS(`comcast.net’)dnl
FEATURE(masquerade_envelope) FEATURE(genericstable, `hash -o /etc/mail/genericstable’)
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain’)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl

Later I’ll explain the virtusertable and mailertable entries. I needed all of that so other devices throughout my network can send email to my local machines or to users on the internet.

Changes I made to /etc/mail/submit.mc (added to the end of the file):

FEATURE(`msp’, `[127.0.0.1]‘)dnl

If you don’t have an /etc/mail/auth directory, as root, create one like this:

# mkdir -p /etc/mail/auth
# chmod 700 /etc/mail/auth

You won’t have the next client-info files so you’ll have to create it (with you favorite Unix editor). Change the permissions on the client-info file like this:

# chmod 600 client-info

So as user_id@comcast.net I made the following entry in /etc/mail/auth/client-info:

# cat /etc/mail/auth/client-info
AuthInfo:smtp.comcast.net “U:smmsp” “I:user_id” “P:password” “M:PLAIN”
AuthInfo:smtp.comcast.net:587 “U:smmsp” “I:user_id” “P:password” “M:PLAIN”

Remember to replace user_id with your Comcast email ID (your email addresse without the @comcast.net) and password with your email password. Also make sure that the client-info file has tight permissions so nobody can read your password.

How to compile it into a db file:

# cd /etc/mail/auth
# makemap -r hash client-info.db < client-info

And finally make sure your running the latest cf files since your mc file changes:

# cd /etc/mail
# make

And lastly restart sendmail:

# service restart sendmail

Changing the sender on outgoing email

One of the things I wanted to do was to correct the sender’s email address that was being used on outgoing email. I frequently have processes that send email and run as ‘other’ users on my server. What I’d like to see is instead of this:

* cookie!cookie!asterisk@comcast.net

I’d rather see this:

* ncherry@linuxha.com

That way if the mail ends up in the wrong place at least the person can reply and let me know that my mail was accidently received by them. The good news is that it’s not hard to do with Sendmail. Just add these lines to your /etc/mail/sendmail.mc file:

GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain’)dnl

Now edit the /etc/mail/genericsdomain file and add the entries you want changed, like this:

cookie!cookie!asterisk ncherry@linuxha.com

Now compile it into a db file:

# cd /etc/mail
# makemap -r hash genericstable.db < genericstable

And finally make sure your running the latest cf files since your mc file changes:

# cd /etc/mail
# make

And lastly restart sendmail:

# service restart sendmail

Linux, Sendmail and Gmail

So far I haven’t attempted this with Gmail. I did have Sendmail working with my 1 and 1 web service for this site. Unfortunately when my home server crashed and it took out something (yes I have it backed up). You’ll need to use the alternate port 587 or 456, you need to have TLS correctly setup (I think this is my current problem with 1 and 1) and you’ll need to correctly setup your AuthInfo files. This means you’ll have to have OpenSSL installed, which I think is normally installed with most Linux distributions.

Incoming Mail (POP3) Server – requires
SSL:
pop.gmail.com

Use SSL: Yes
Port: 995

Outgoing Mail (SMTP) Server – requires
TLS:

smtp.gmail.com (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)

Port: 465 or 587

Account Name: your Gmail username (including @gmail.com)
Email Address: your full Gmail email address (username@gmail.com)
Password: your Gmail password

Notes:

For now this was a rush job to get this out while I still remember what I did. I’d also like to have a backup (Gmail) so if I run into further problems I can use Gmail instead. Lastly I’ll try to document what I did to change the return address from ncherry!cookie!cookie@comcast.net to ncherry@comcast.net. That really annoyed me for a while. I’m guessing that many others haven’t run into this problem as they’re probably not using UUCP. I’m not really using it but I do use .uucp as my home local domain. I have a DNS that resolves the entire .uucp domain (that’s in my home :-) .

Latest:
* The SMTP Server is: smtp.comcast.net

* Click the click here for advanced sending options button. The port number should be 465 and the only boxes that should be checked are SMTP Server Requires Authentication and Save Password

Under Receiving Mail,the port number should be 110

Following Google Searches Lead To This Post: emails not going from sendmail on port 587
comcast sendmail
550 5.7.1
mailertable port 587
sendmail configure + use gmail + fedora 11
email diagram
Client does not have permissions to send as this sender
linux smtp setup fedora
comcast smarthost mail smtp.comcast.net
change smtp port sendmail in linux
sendmail server configuration in redhat
sendmail mailertable ssl
UNIX sendmail fedora 11
oracle R12:configure sendmail
sendmail smarthost 587 configuration
fedora sendmail smart host port 587 requires authentication
sendmail smtp comcast fedora
comcast smtp sendmail block
ssl tsl sendmail howto realy authinfo smarthost
how to send mail from linux server via comcast.net
smart host sendmail
1 and1 sample scripts sendmail
bash script sendmail smtp server
send email from linux on comcast network
sending comcast email linux
https://ssl.smarthost.se
comcast email setup for mc
sendmail fedora 11 gmail problem
comcast dynamic dns sendmail gmail
fedora 11 sendmail comcast configure
sendmail en centos
config sendmail asteirsk via host
simple diagram of the steps in sending email
configure comcast smarthost port 587
fedora sendmail comcast
diagram comcast business
fedora sendmail client setup
outbound email sends wrong ip address sendmail
apache smtp sendmail diagram
asterisk sendmail settings
bash send mail via smarthost
fedora 11 sendmail through smtp gmail
fedora comcast smtp
mailertable ssl port
spamhaus port 995
linux sendmail port +995
smtp.gmail.com spamhaus pbl
does comcast.net use SSL
how to open sending email /etc/mail/sending from oracle application
configure smarthost with auth sendmail fedora 10
oracle send mail ssl
configure smtp in sendmail – FC 11
fedora sendmail gmail howto
linux sendmail “sender name” config
gmail smarthost sendmail outgoing sender
configure sendmail in fedora for gmail
comcast business sendmail configuration
sendmail gmail sendmail.mc
centos sendmail smtp using gmail
sendmail mailertable ’smtp.gmail.com’
sendmail comcast genericstable
configure fedora 11 sendmail
configure sendmail fedora 11 comcast
sendmail accidently deleted authinfo
how to configure linux comcast network setting
fedora Sendmail setup “smtp server”
diagram comcast internet setup
“unix shell script” diagram
AuthInfo:smtp.gmail.com “I:user_id” “P:password” “M:PLAIN” AuthInfo:smtp.gmail.com:587 “U:smmsp” “I:user_id” “P:password” “M:PLAIN”
comcast hd box diagram

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Unix Tags : ,

Comments
February 12, 2010

Thanks, this was just the information I was looking for.

Take another look at the genericsdomain information you show. You “say” to edit the genericsdomain file, but then to turn the genericstable file into a hash. That was enough to confuse me. Cheers. Henk

Posted by Henk
Leave a comment

(required)

(required)