Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I and a friend of mine have setup two Postfix mail servers on our laptops. We succeeded in sending mail to a real network (to some Gmail accounts) from our computers; that was the easy part.

We now want to send an email from one laptop to the other; both laptops are in the same network (they're using the same WIFI) and they both have Postfix installed on them (OSes of laptops are Ubuntu).

We tried to send email like this:

rcpt to: postmaster@[IP Address]

Yet, we have the same IP (when we check on sites like this), since we are on same network. We aren't network veterans, either.

Here is the question: is it possible to send email from one laptop to the other, in the same network? If it is so, how could it be done?

Moreover:

  • my computer's local IP: 192.168.174.128
  • friends local IP: 192.168.200.128

When I try to send an email via Postfix this command does it right:

rcpt to: username@[192.168.174.128]

But, it isn't working when I try to send email to my friend's Postfix:

rcpt to: username@[192.168.200.128]

He can't receive the mail that I sent.

share|improve this question
    
Why you are not using /etc/hosts file ? –  Rahul Patil Jul 10 '13 at 7:12
    
Is there any online resource you recommend me to read about /etc/hosts file, sir? I am kind of a passionate newbie about networking and linux systems. –  Ekrem Doğan Jul 10 '13 at 7:14
    
Please check my ans and let me know, if you are facing any issue. –  Rahul Patil Jul 10 '13 at 7:20
add comment

2 Answers

up vote 2 down vote accepted

You have two options:

  1. You can setup your Internet DNS Server with BIND
  2. OR You can Specify, your IP with hostname in /etc/hosts file

Example: I'm assuming that you have hosted laptop1.local, laptop2.local as virtual domain:

192.168.174.128 laptop1.local
192.168.200.128 laptop2.local

One more thing, whenever you are sending mail just watch the mail log using:

tail -f /var/log/mail.log

If you want to force Postfix to refer to /etc/hosts, then set the following parameters in main.cf:

lmtp_host_lookup = native
smtp_host_lookup=native
#disable_dns_lookups = yes
ignore_mx_lookup_error = yes

Also, don't forget to reload Postfix after making changes in main.cf.

share|improve this answer
    
I edited hosts file. Should I send email to username@laptop2.local right now? rcpt to: username@laptop2.local –  Ekrem Doğan Jul 10 '13 at 7:27
    
Yes, you are right.. –  Rahul Patil Jul 10 '13 at 7:28
    
@EkremDoğan - Rahul is correct, look in your mail.log file, you should see connection attempts being made by your server to deliver the mail to your friends mail server. You should see messages that the message was sent successfully if it's working correctly. –  slm Jul 10 '13 at 7:29
    
I am assuming that, you have hosted laptop1.local,laptop2.local as virtual domain –  Rahul Patil Jul 10 '13 at 7:30
    
I tried all you said above, I am afraid I do something wrong. Here is the related part of mail.log file: Jul 10 00:35:32 ubuntu postfix/smtp[13168]: 18DCD633D6: to=<ozturk@laptop2.local> relay=none, delay=26, delays=25/0.05/0.19/0, dsn5.4.4, status=bounced (unable to look up host laptop2.local: Name or service not known) a bit down: sender non-delivery notification –  Ekrem Doğan Jul 10 '13 at 7:43
show 6 more comments

Have you added [192.168.200.128] to $mydestination in postfix comfiguration?

It seems to work according to some reports https://www.zimbra.com/forums/administrators/21994-solved-correct-zmlocalconfig-e-syntax-new-postfix-parameter.html

share|improve this answer
    
I did right after you said, but it didnt work in my case –  Ekrem Doğan Jul 10 '13 at 7:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.