Linux Home

(Last updated: Tuesday, April 17, 2007)

Linux, Sendmail and

Last updated: Tuesday, April 17, 2007

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

I'm now also able to use Gmail with sendmail. For more details on that setup see my Linux, Sendmail and Google mail page. 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 responsibilty. Sendmail is very power. So lets start with the files you will need to change:

  • /etc/mail/
  • /etc/mail/auth/client-info

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

    dnl # Changes I made to /etc/mail/
    define(`RELAY_MAILER_ARGS', `TCP $h 587')
    define(`ESMTP_MAILER_ARGS', `TCP $h 587')
    FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

    FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
    FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
    FEATURE(masquerade_envelope) FEATURE(genericstable, `hash -o /etc/mail/genericstable')

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/ (added to the end of the file):

    FEATURE(`msp', `[]')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 I made the following entry in /etc/mail/auth/client-info:

    # cat /etc/mail/auth/client-info "U:smmsp" "I:user_id" "P:password" "M:PLAIN" "U:smmsp" "I:user_id" "P:password" "M:PLAIN"

Remember to replace user_id with your Comcast email ID (your email addresse without the 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!

I'd rather see this:


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/ file:


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


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:
Use SSL: Yes
Port: 995
Outgoing Mail (SMTP) Server - requires TLS: (use authentication)
Use Authentication: Yes
Use STARTTLS: Yes (some clients call this SSL)
Port: 465 or 587
Account Name: your Gmail username (including
Email Address: your full Gmail email address (
Password: your Gmail password


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! to 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 :-).