5

My friend and I have configured 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 on 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, on 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've sent.

3
  • 1
    Why you are not using /etc/hosts file ? Jul 10, 2013 at 7:12
  • 1
    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. Jul 10, 2013 at 7:14
  • Please check my ans and let me know, if you are facing any issue. Jul 10, 2013 at 7:20

2 Answers 2

5

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.

10
  • I edited hosts file. Should I send email to [email protected] right now? rcpt to: [email protected] Jul 10, 2013 at 7:27
  • Yes, you are right.. Jul 10, 2013 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, 2013 at 7:29
  • I am assuming that, you have hosted laptop1.local,laptop2.local as virtual domain Jul 10, 2013 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=<[email protected]> 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 Jul 10, 2013 at 7:43
0

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

1
  • I did right after you said, but it didnt work in my case Jul 10, 2013 at 7:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .