Replace IP address with name in headers

From MozillaZine Knowledge Base
Jump to navigationJump to search
This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

As part of sending a message the SMTP server sends a HELO or EHLO command to Thunderbird. If your PC is behind a NAT box or a router it may send your PC's IP address instead of a rfc2822 compliant "fully qualified domain name" (FQDN) in its reply. Whichever value it sends is included in the messages headers. There are several reasons why you might not want it to send a IP address.

1. Protect your privacy.
If the IP address is 127.x.x.x, 192.168.x.x, 172.{16-31}.x.x, or 10.x.x.x its a non-routable IP address that is meaningless outside of your local network. It could only be exploited if somebody manages to break into your router, DSL or cable modem. If its a Internet address that doesn't make you anymore vulnerable since your IP address is going to get periodically remotely scanned by people trying to break into your system anyways, but it reveals more information about you, especially if you're using a static IP address.
2. If the recipient's mail server uses the Sender Policy Framework (SPF) it may classify your message as spam because it can't find the corresponding SPF record. It might be able to use an Internet IP address in brackets instead of a FQDN, but it can't use a non-routable IP address like [127.0.0.1] or [192.168.1.1]
3 If the recipient's mail server uses a default SpamAssassin configuration it will add +4 to the spam score, which may cause it to classify your message as spam.
4. Some SMTP servers require a FQDN and will return an error message such as:
Unknown error has occured. Account 'mail.orcon.net.nz'. Server. 'mail.orcon.net.nz' Protocol: SMTP, server responce. '550 Invalid HELO/EHLO must contain a FQDN or IPv6 literal in []'. Port 25. Secure(SSL); No, Server Error. 550, error number: 0x800CCC69
Risposta del server: 554 5.5.2 <fcozzinb>: Helo command rejected: need fully-qualified hostname

You can workaround this problem by adding a mail.smtpserver.smtp*.hello_argument setting to set a FQDN using the Config Editor

1. Press the Config Editor button at Tools > Options -> Advanced -> General .
2. Type smtp in the filter edit field
3. Find which SMTP server you need to specify the outgoing name for. It might be easiest to find it by looking for the account name in one of the description settings. For example if its for a Fastmail account you might find:
mail.smtpserver.smtp1.description user set String Fastmail
You want to find the number appended to "smtp". In this case its 1. You could also search for the SMTP server by looking for the server name in the hostname fields. For example, if you have a Gmail account you might find:
mail.smtpserver.smtp5.hostname user set String smtp.gmail.com
In this case its 5.
4. Right click in the window and select New -> String and then enter mail.smtpserver.smtp*.hello_argument as the name of the setting (replace * with the number you found for the SMTP server) and the name you want to use. It can be whatever.you.want.com but if it uses the domain name of your SMTP server that prevents a "forged hello" penalty by SpamAssassin. [1] For example, use John.Smith.gmail.com if you're using a Gmail SMTP server.

External Links