SPF records are used to help ensure that no one sends emails claiming to be from you when they are not (called spoofing). The receiving mail server checks the SPF record for the domain sending the mail. The SPF record identifies all the valid servers that can send mail for that domain. If the mail is from a server not listed, then the mail is rejected. If there is no SPF record for a domain, then there is no check.
To create an SPF record you must add a TXT recrod to your DNS. In your DNS text record, the first field should be:
YourDomainName.com.
note - the trailing period is required
The value field should be:
"v=spf1 a mx ~all"
note - the quotation markes are required
So your SPF record in your DNS looks like this:
YourDomainName.com. IN TXT "v=spf1 a mx ~all"
This SPF record means that only your web server (a) and your mail (MX) server can send mail for YourDomainName.com
Please understand that this will only work if ALL your mail is sent from your webhost using the same IP address as specified. There is NO practical solution for an SPF record if your mail is sent through your ISP, since you have no way to anticiapte what servers your ISP will use to send mail and/or whether they have appropriate SPF records to reference. For example, look for SPF records for rr.com or bellsouth.net and you will not find any. So using the SPF include: option for the ISP name is worthless, since there are no SPF records to include. Using either the ptr: or ip4: option MAY work depending on the servers used.
And if you are on shared host that sends mail from a different IP address than your domain IP address (a and mx), you must specify that server in your SPF record (you could use the ip4: option to specify the IP address).
<img src="http://yourdomain.com/messages.php" style="border: inset 3px;">
Name the script below messages.php.
- - Start Script Here - -
- - End Script Here - -
If you are using a PHP page and want to include the count in a text line rather than display it as an image, you can simply replace the bottom half of the script with this one line:
echo "You have $count messages in your inbox";
To create an SPF record you must add a TXT recrod to your DNS. In your DNS text record, the first field should be:
YourDomainName.com.
note - the trailing period is required
The value field should be:
"v=spf1 a mx ~all"
note - the quotation markes are required
So your SPF record in your DNS looks like this:
YourDomainName.com. IN TXT "v=spf1 a mx ~all"
This SPF record means that only your web server (a) and your mail (MX) server can send mail for YourDomainName.com
Please understand that this will only work if ALL your mail is sent from your webhost using the same IP address as specified. There is NO practical solution for an SPF record if your mail is sent through your ISP, since you have no way to anticiapte what servers your ISP will use to send mail and/or whether they have appropriate SPF records to reference. For example, look for SPF records for rr.com or bellsouth.net and you will not find any. So using the SPF include: option for the ISP name is worthless, since there are no SPF records to include. Using either the ptr: or ip4: option MAY work depending on the servers used.
And if you are on shared host that sends mail from a different IP address than your domain IP address (a and mx), you must specify that server in your SPF record (you could use the ip4: option to specify the IP address).
Display your email message count
This simple script creates an image that can be used on any page to display the number of email maeesages in your inbox. You could even put this on your desktop if you use an html page for your background image. In your html, put an <img> tag for the image, such as the one below. Do not put width or height parameters in the img tag as this will distort the generated image.<img src="http://yourdomain.com/messages.php" style="border: inset 3px;">
Name the script below messages.php.
- - Start Script Here - -
<?php
$server = "mail.yourdomain.com";$user = "XXXXXX";$password = "YYYYYY";$host = "{".$server.":143"."}"."INBOX";$msgstream = imap_open($host, $user, $password);$check = imap_mailboxmsginfo($msgstream);$count = $check->Nmsgs;imap_close($msgstream);// generate display image$width = (strlen($count)*8)+8;$im = @imagecreate($width, 18);$background_color = imagecolorallocate($im,255,255,255);$text_color = imagecolorallocate($im,0,0,0);imagestring($im,4,4,2,$count,$text_color);imagepng($im);imagedestroy($im);?>- - End Script Here - -
If you are using a PHP page and want to include the count in a text line rather than display it as an image, you can simply replace the bottom half of the script with this one line:
echo "You have $count messages in your inbox";
Comments
Post a Comment