This page describes how to configure sending and receiving mail with Comcast ISP provider. Note, that the same configuration still applies to any corporate network or other ISP providers as well.
It doesn't matter much if your machine uses dial-up PPP connection or has static address on internal network hidden behind firewall. The decisive factor is that in both cases, your ISP provider runs mail server for you. With these assumptions in mind, I have to do the following to make things work for me:
Configuring sendmail can be painfull.
# yum -y install sendmail-cf
Configuration files are stored in /usr/share/sendmail-cf/cf.
We are going to create or edit five database files:
For sendmail to work properly, you need to know your FQDN of your host:
# cd /etc/mail # hostname -f dollar.3rdshift.com
Now create /etc/mail/genericsdomain to hold your fully qualified host name.
# cd /etc/mail # hostname -f > genericsdomain # cat /etc/mail/genericsdomain
dollar.3rdshift.com |
Now create /etc/mail/genericstable and add the following line to translate local e-mail address to the target ISP-assigned sender e-mail address:
vlg@dollar.3rdShift.com 3rdshift@comcast.net |
Add your account to /etc/mail/trusted-users file:
# trusted-users - users that can send mail as others without a warning # apache, mailman, majordomo, uucp, are good candidates vlg |
Edit /etc/mail/local-host-names file and add FQDN of your host.
# local-host-names - include all aliases for your machine here. localhost dollar.3rdshift.com |
To fight the spam, comcast has blocked port 22 and, instead, requires mail client programs to connect to port 587 and authenticate themselves.
The first thing is to find out if you have the correct username and password that will work with comcast. That can be verified out rather easily:
Find canonical name of the comcast SMTP service:
# nslookup smtp.comcast.net Server: 216.231.41.2 Address: 216.231.41.2#53 Non-authoritative answer: smtp.comcast.net canonical name = smtp.g.comcast.net. Name: smtp.g.comcast.net Address: 76.96.62.117
The canonical name happens to be smtp.g.comcast.net.
To find out if your version of sendmail has built in authentication protocol(s):
# /usr/sbin/sendmail.sendmail -d0.1 -bt < /dev/null
Version 8.14.2
Compiled with: DNSMAP HESIOD HES_GETMAILHOST LDAPMAP LOG MAP_REGEX
MATCHGECOS MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6
NETUNIX NEWDB NIS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = dollar
(canonical domain name) $j = dollar.3rdshift.com
(subdomain name) $m = 3rdshift.com
(node name) $k = dollar.3rdShift.com
========================================================
Clearly, SASLv2 protocol is built in
Now, edit /etc/mail/access file and add AuthInfo entries:
# By default we allow relaying from localhost... Connect:localhost.localdomain RELAY Connect:localhost RELAY Connect:127.0.0.1 RELAY AuthInfo:smtp.g.comcast.net "U:3rdshift[AT]comcast.net" "I:3rdshift[AT]comcast.net" "P:YourPasswordHere" AuthInfo:smtp.g.comcast.net:587 "U:3rdshift[AT]comcast.net" "I:3rdshift[AT]comcast.net" "P:YourPasswordHere" |
Both 'U' (user) and 'I' (id) should hold your e-mail address. Don't forget to replace "[AT]" with '@'. Read more about it AUTH related part of sendmail manual.
Make sure access file can be read only by a trusted user:
# chmod 600 /etc/mail/access
Now, we are ready to modify /etc/mail/sendmail.mc configuration file.
To create your *.mc configuration file, use comcast sendmail template, sendmail.mc.comcast, as a starting point.
$ su # cd /etc/mail # wget http://pbxinaflash.net/source/sendmail/sendmail.mc.comcast # cp sendmail.mc.comcast sendmail.mc
Open sendmail.mc in the editor and make following modifications:
define(`SMART_HOST',`smtp.g.comcast.net')dnl define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl define(`confAUTH_OPTIONS', `A')dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl FEATURE(`authinfo',`hash /etc/mail/access')dnl FEATURE(`access_db', `hash -T |
define(`SMART_HOST',`mail.mydomain.com')dnl
tells sendmail to relay all of the outgoing mail to my ISP's mail server.
MASQUERADE_AS(mydomain.com)dnl
FEATURE(`allmasquerade')dnl
FEATURE(`masquerade_envelope')dnl
tells sendmail to masquerade From: to domain mydomain.com. sendmail will convert my initial address `vlg[AT]dollar.3rdshift.com' to `vlg[AT]comcast.net'.
The last pair of lines
FEATURE(genericstable, `hash -o /etc/mail/genericstable')dnl
GENERICS_DOMAIN_FILE(`/etc/mail/genericsdomain')dnl
completes the e-mail address translation. It will transform `vlg[AT]comcast.net' into `3rdshift[AT]comcast.net'.
To generate all database files and configuration file:
# cd /etc/mail # make clean # make
make utility will compile all ".db" files from their sources and convert sendmail.mc into sendmail.cf file.
# /sbin/service sendmail restart
You should see no errors in /var/log/maillog. Try to send an e-mail out and verify its delivery. If authentication with Comcast should fail, sendmail will deliver denial reply from comcast to the 'root' user. Login as 'root' and examine the reply for further assistance.
[Up]For starters, fetchmailconf configuration tool will do most of the job. It is useful in autodetecting the protocol type your used by your ISP's mail server. The resultant configuration file ~/.fetchmailrc should have 0600 permissions and will look similar to this:
set logfile "/home/vlg/Mail/fetchmail.log"
#set syslog
set postmaster "vlg"
set bouncemail
set properties ""
set daemon 5
poll sz-pop.mail.comcast.net with proto POP3 and options no dns uidl
user 3rdshift there with password MyPassword is vlg
here options fetchall
antispam 571 550 501 554
|
Apparently, fetchall option is very important. Otherwise, not all messages will be delivered to your local machine with POP3 server. Also, it should come last in the line. Otherwise, default values for other options that follows might be assumed.
For PPP dial-up networks it might be wiser to start it when connection is established and bring it down when connection is torn apart. The commans for staring is:
fetchmail -d 180
This will run fetchmail as a daemon process, polling mail server
every 3 minutes.
To stop fetchmail:
fetchmail -q
To run fetchmail from cron job, schedule the following command with crontab -e :
0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,48,54,57 0-23 * * * fetchmail -d0 -s -t 30 -f /home/vlg/.fetchmailrc > /dev/null 2>&1 |
That is to say: Run fetchmail polling every 3 minutes around the clock, with [-t 30] connection timeout of 30 seconds to ISP's mail server, [-s] in silent mode, [-d0] not as a daemon, [-f fname] using my configuration file.
That's pretty much it. Enjoy reading your mail!
[Up]Configure Evolution for local delivery:
There are tons of those, but very few I found are down to the point:
Last updated: Sun, 04 Jan 2009 20:30:02 -0500
Copyright © 2000-2009
Vladislav Grinchenko
All rights reserved