Can I receive the IPADDRESS also when using $mail command
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
If you want to know the ip address of your machine do:
ifconfig eth0
If you want to use email to find out someone's ip address:
Run an apache web server. Put one jpg image on the server. Send the person an email with this in it:
href="http://<your ip address>/<directory jpg is in>"
Then, when the person opens the email, in order to display the image it will access your server. It will just look like a picture to them, but you can look in the apache logs and see what ip accessed that image file. That is how you get an ip if all you know is the email address.
Yes using your way I can find out the ip address but cant it be done by using the mail command?
As I had earlier said, when I send a mail using the sendmail on my loopback address to my pop account, the From option in the mail that I receive contains just the machine name...Cant I have my IP ADDRESS also listed...
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
the ip
Quote:
Originally Posted by dsids
Yes using your way I can find out the ip address but cant it be done by using the mail command?
As I had earlier said, when I send a mail using the sendmail on my loopback address to my pop account, the From option in the mail that I receive contains just the machine name...Cant I have my IP ADDRESS also listed...
Thanks
Danish
The ip is in the email header. If you look at the email source you can see it there.
Most mail viewers hide some or all of the mail headers, including the IP address.
Simply said, because most users aren't interested in knowing all computers (hops) that the mail
went through before arriving at it's destination.
With some, viewing the headers is an option.
So, I recommend you start looking at Thunderbird's preferences and settings.
However, making the IP address appear in the mail body requires rewriting of the body.
In theory, only the author of the mail is supposed to alter the body.
So, the only valid option is to actually write a line that contains your IP address in your mails.
Having MTAs (like sendmail, postfix, etc) rewrite mail bodies may be possible, but they're designed to work
with mail headers only, so it's not recommended. If you want such automatic rewriting, maybe you can get your MTA to write the IP address in the Subject header (which is always displayed by all mail viewers, including Thunderbird).
Can you please tell us why you want to look at that information?
If you want mail source statistics, you should look at your MTA configuration. If you want to track down the source of a malicious mail, don't rely only on the IP address. Many "attackers" use spoofing or hijacked computers to do their dirty work.
Being a newbie I wrote a simple script which greps a pattern and mails the output. Now my boss says that he wants to view the ip address of the sender along with the machine name which is mentioned..This script is just for the LAN...
Yes I looked up the thunderbird preferences and found out how to check the mail source..Would you know where in sendmail configuration files would this option of IP ADDRESS be
..I use sendmail sendmail-8.13.1-2
if you're using a command line mailer and a script to write the body can you not just add in a variable which greps ifconfig for the IP, and then just include that variable in the body of the mailer? Just a guess, never tried it. When the script ran it would resolve the variable, and thunderbird would just get a text string, showing the IP of the machine the mail was composed on.
if you're using a command line mailer and a script to write the body can you not just add in a variable which greps ifconfig for the IP, and then just include that variable in the body of the mailer? Just a guess, never tried it. When the script ran it would resolve the variable, and thunderbird would just get a text string, showing the IP of the machine the mail was composed on.
if you're using a command line mailer and a script to write the body can you not just add in a variable which greps ifconfig for the IP, and then just include that variable in the body of the mailer? Just a guess, never tried it. When the script ran it would resolve the variable, and thunderbird would just get a text string, showing the IP of the machine the mail was composed on.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.