Comcast blocks ports and will provide fake response to erroneous DNS queries so they're not my first choice for an ISP. I appear to be getting normal error responses to bad Name Server requests. That's good. I think it's because they activated a defunct account and it still had the opt-out from Comcast's enhanced DNS.
Port 25 is blocked, inbound and outbound. My mail server functions that needed to accept inbound connections got moved to a different server with a different ISP. However I still needed to process locally generated emails: server logs, alerts, web look-ups.
I'm using postfix for email services the changes were fairly straight forward. In the main.cf file:
smtp_tls_cert_file = /etc/postfix/postfix-cert.pem smtp_tls_key_file = /etc/postfix/postfix.key smtp_tls_loglevel = 6 smtp_tls_note_starttls_offer = yes smtp_tls_security_level = may smtp_sasl_auth_enable = yes smtp_sasl_security_options = relayhost = [smtp.comcast.net]:submission smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_password_maps
The cert and key lines were already there. Bump the loglevel so that you can enough detail about the errors. Once this is working, put the loglevel back to 1. You DO want to encrypt your email transmissions. It's not that hard. NOTE: the empty security_options line is needed. Otherwise you will see the error message: No worthy mechs found.
The relayhost line specifies the ISP's email server. If you are also using Comcast just copy it verbatim. Finally you need to supply your credentials for your ISP. I used smtp_sasl_password_maps as the file name - shamelessly stolen from the postfix documentation. The file name tells you that we are creating a mapping between keys and values. The key is the EXACT value specified for relayhost. The value will be the credentials for that host, i.e. username:password.
My file contains a single line that looks like:
[smtp.comcast.net]:submission username:password
with white space (a tab in this case) separating the key and the value. Your username is NOT user@comcast.net. It is simply user.
NEWALIASES=/usr/bin/newaliases
PDIR=/etc/postfix
ADIR=/var/spool/amavisd
POSTMAP=/usr/sbin/postmap
ETC=/etc
# NOTES
#
# sendmail -bv someone@somedomain
# will provide a delivery status report showing how that address would be handled
#
all: $(ETC)/aliases.db $(PDIR)/virtual.db $(PDIR)/access.db \
$(PDIR)/smtp_sasl_password_maps.db $(ADIR)/virtual-domains \
$(PDIR)/reload.done
$(ETC)/aliases.db: $(ETC)/aliases
$(NEWALIASES)
$(PDIR)/virtual.db: $(PDIR)/virtual
$(POSTMAP) $^
$(PDIR)/access.db: $(PDIR)/access
$(POSTMAP) $^
$(PDIR)/generic.db: $(PDIR)/generic
$(POSTMAP) $^
$(PDIR)/smtp_sasl_password_maps.db: $(PDIR)/smtp_sasl_password_maps
$(POSTMAP) $^
$(ADIR)/virtual-domains: $(PDIR)/virtual-domains
cp $^ $@
$(PDIR)/reload.done: $(PDIR)/virtual-domains $(PDIR)/main.cf $(PDIR)/smtp_sasl_password_maps.db
xargs -i ./missing.sh {} virtual < virtual-domains
touch $(PDIR)/reload.done
service postfix reload
# check for domains with no address handling
check:
xargs -i ./missing.sh {} virtual < virtual-domains
This makes it easy to keep the hashed files uptodate. I also have a little script to make sure that I've included all my virtual domains in the virtual file.\
# cat missing.sh grep -q $1 $2 || echo $1
I wrote this hoping to save others some time and effort. The places where I wasted a lot of time were:
- smtp_sasl_security_options =
- trying user@comcast.net when it must be user