sendmail comcast authentication howto.
I wanted to be able to send email from my linux desktop. It turned out that emails from arbitrary IP addresses are not accepted by the majority of recipients' mail gateways anymore - the emails must come from a trusted source to be accepted.
Your favorite ISP or internet mail hosting service could be used to relay outgoing emails, you need to have an account with them to be able authenticate as the source of email. Once authenticated the relay will send your email on your behalf, and it will become much less likely to be rejected. To make this (have a relay accept and forward your email) happen proved to be a very tricky task (at least for me, with 8 years of linux experience, mostly as a user and occasionally as an embedded kernel developer). It took a lot of googling and reading (including some excellent articles on this forum). I spent few hours figuring it all out. There was no one place which would describe how to do it from beginning to end, and some things I discovered were not covered anywhere at all. I was very frustrated with the experience, and hope I can help others to get through this maze quicker. So here goes, yet another howto. Installing on a Ubuntu machine: Code:
kv-a: ~ 4 > cat /proc/version Code:
kv-a: ~ 5 > sudo bash Code:
apt-get instal sendmail Code:
kv-a: ~ 13 > sendmail -d0.1 -bv Now, make sure permissions are as expected, and missing directories are in place: Code:
chmod 0640 /etc/mail/aliases /etc/mail/aliases.{db,pag,dir} Now, root needs to be added to the smmsp group for the startup script to work: Code:
kv-a: /etc/init.d 135 # rcsdiff /etc/group The startup file (/etc/init.d/sendmail) also needs modification, this is how I made it work (without this change start-stop-daemon could not create the PID file for sendmail. A wider context diff mode is chosen in case your version of /etc/init.d/sendmail is different and you can't use this patch directly. The important thing is that the directory where the PID file will be stored must be writable by root. This needs to be done in the script, because it eventually changes this directory's permissions before exiting: Code:
kv-a: /etc/init.d 139 # rcsdiff -C 10 /etc/init.d/sendmail Code:
kv-a: /etc 10 # rcsdiff hosts Phew, we are almost there. Now sendmail needs to be configured. In this setup I used smtp.comcast.net as the relay. The following line had to be added to /etc/mail/access: Code:
kv-a: /etc/mail 144 # rcsdiff /etc/mail/access Now, the actual sendmail configuration: Code:
kv-a: /etc/mail 145 # cat /etc/mail/sendmail.mc Different installations might have cf.m4 in different directories, check where yours is and modify the include() line if needed. Now, I had to restart it so many times that I put all commands in a bare bone shell script (no error checking, watch for console output for anything suspicious). Here is the script: Code:
kv-a: /etc/mail 146 # cat /etc/mail/Build Code:
kv-a: ~ 3 # cd /etc/mail If something goes wrong along the way (and a lot of things could and did for me multiple times) - check out /var/log/mail.*, search google for error messages, and you will get there, good luck! |
Very nice work! So this doesn't get completely buried, how about submitting it as a tutorial or part of the LQ Wiki?
|
Quote:
-- I can't effectively read wide posts in the forum due to some kind of LQ-Konqueror mal-interaction. I suspect a CSS problem, but I don't know enough to be sure. |
guys, thank you for your encouragement, I'll look into adding this to the wiki.
The thing is that I found a lot of info on this forum just googling for keywords like `smtp' and `authentication'. |
That's OK, you took the time to pull together a nice how-to, which I haven't seen. This is something I've been meaning to set up on my server, it just hasn't floated to the top of my to-do list so this will definitely come in handy.
|
All times are GMT -5. The time now is 08:32 PM. |