Answers to: sendmail on a dynamic IPhttp://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip<p>Hey all,</p> <p>Words can't express how awesome this website is and the the ideals behind it, much appreciated.</p> <p>Anyway, sendmail was always the one thing that I just couldn't figure out. The last time I tried four years ago, I had given up. I'm trying again now on Fedora 12, as it is the only thing left to do until everything is good to go. The built-up dread of this fact has been realized. I need help, here.</p> <p>I've been able to find a few detailed tutorials, but they all presumed you had a static IP. I do not, and I use everydns.net to keep the DNS record updated on a bi-hourly basis. How can I apply the same for, say, mail.mydomain.com?</p> <p>I have to make it clear that I don't fundamentally understand sendmail. I understand the overall basis of email, but I don't fully understand the internal process of SMTP. If anyone could point me in the right direction, I'd really appreciate it.</p>enTue, 04 May 2010 13:02:00 -0400Answer by Wilsonhttp://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/262<p>I configured Postfix and it seems to work great but, using it with a dynamic ip does not cut it. Most dynamic ip are blacklisted and most mail server block incoming mail from these addresses. I tried using something like no-ip.com but, my ip changed too frequently. After an ip changed I had to remove it from the blacklist, that happened every other day so by the time the changes got propagated the ip changed again. Too much work.</p>WilsonTue, 04 May 2010 13:02:00 -0400http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/262Answer by KenJacksonhttp://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/228<p>Gladiator's link captured the SMTP situation very well, "<em>... running a "direct-to-mx" outbound mail server on a dynamic address no longer is practical - too many sites just block mail from dynamic IP addresses. Sigh.</em>"</p> <p>But I use my home Linux PC as my personal secure IMAP server, even though the IP address can, and does, change occasionally. Here's a stripped down version of the script that I run to automatically update it. (I really run one cron script as a regular user to generate it, and a second cron script as root to install it.)</p> <p>It also generates a cert file in the form ip-XX-XX-XX-XX.pem, where the X's are my IP address. I don't currently use it for anything, but it's been my plan to use it for a variety of things, if I ever get to it.</p> <pre><code>#!/bin/sh PKICERT=/etc/pki/tls # Get and verify my home IP address IP="$(curl -s http://jackson.io/ip/)" case "$IP" in ""|*[!0-9.]*) echo "ERROR: Invalid IP address \"$IP\""; exit 1 ;; esac HOMEURL="$(host "$IP" | sed 's/.*pointer //;s/\.$//')" echo $HOMEURL | grep -q pool- || { echo "ERROR getting URL"; exit 1; } # Generate the new general-purpose PEM filename PEM="ip-$(echo $IP | /usr/bin/tr . -).pem" case "$PEM" in ip-*-*-*-*.pem) ;; *) echo "Incorrect name for cert file \"$PEM\"" exit 1 ;; esac # Exit if the existing cert is correct if [ -s "$PKICERT/$PEM" ]; then echo "The existing PEM file is correct" exit 0 fi # Make a new TLS certificate for imapd # # This procedure was developed by looking at the postinstall scriptlet: # rpm -q --scripts uw-imap # This command will dump the resulting pem file: # certtool -i --infile imapd.pem # # Prompts: CountryName, StateName, LocalityName, OrganizationalName, # OrganizationalUnitName, CommonName, EmailAddress # cd /tmp || { echo "Error: Can't cd to /tmp"; exit 1; } rm -f *.pem CERT=imapd.pem MAKEFILE=/etc/pki/tls/certs/Makefile make -f $MAKEFILE $CERT &lt;&lt; EOF &amp;&gt; /dev/null US Maryland Home My Name mydomain.com $HOMEURL me@mydomain.com EOF if [ ! $? ]; then echo ERROR creating key and certificate rm -f $CERT exit 1 fi sed -n '/BEGIN CERT/,/END CERT/p' $CERT &gt; $PEM # Delete old certs /usr/bin/sudo /bin/rm -fv $PKICERT/ip-*.pem $PKICERT/certs/$CERT # Install the new general-purpose cert /usr/bin/sudo /usr/bin/install -v -m600 /tmp/$PEM $PKICERT/ # Install imap cert /usr/bin/sudo /usr/bin/install -v -m600 "/tmp/$CERT" "$PKICERT/certs/" </code></pre>KenJacksonTue, 04 May 2010 02:23:01 -0400http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/228Answer by Ian 1http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/215<p>I totally agree with Keith.</p> <p>Use postfix instead of sendmail. You'll find it much easier to configure and manage.</p> <p>I have postfix operating behind a dynamic IP address, using Zonedit to manage DNS for my domain names. I have smtps, imaps and pops configured for secure remote connections.</p> <p>Happy to help you out with anything relating to postfix :)</p>Ian 1Mon, 03 May 2010 23:13:11 -0400http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/215Answer by Keithhttp://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/203<p>Why use sendmail?</p> <p>Postfix is a superior product IMHO</p>KeithMon, 03 May 2010 21:20:06 -0400http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/203Answer by Gladiatorhttp://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/187<p>Kindly have a look. I hope it'll whelp you.</p> <p><a href="http://bcn.boulder.co.us/~neal/cablemail.html" rel="nofollow">http://bcn.boulder.co.us/~neal/cablemail.html</a></p>GladiatorMon, 03 May 2010 18:50:19 -0400http://linuxexchange.org/questions/174/sendmail-on-a-dynamic-ip/187