On a ubuntu system I have installed postfix and set relayhost and mynetworks in /etc/postfix/main.cf config file.
I can now telnet to port 25 on this server and send an email by issuing the SMTP commands. I ran a test to a gmail account and received the email message ok.
But on the same linux host I installed mail (apt-get mailutils) and ran this command:
mail -s "test email" myname@gmailcom
entered some message text and Ctrl-D and saw no errors but message is never received by recipient.
Do I have to configure the smtp server in mail config somehow? Should I see the messages in some sort of queue waiting to be sent?
Any tips on how to resolve?
Some more info:
my /etc/mailname config file contains the string: mail.mydomain.com and my linux box is not configured with a domain (it is only a test system). Should I change this to just mail? (mail is hostname of box).
I found a mail syntax which allows you to specify the sender which works for me:
mail -s "message 5" -a "From: email@example.com" firstname.lastname@example.org
But I would prefer to fix so I don't need to do that.
Here is the error I see by using mail interactively:
Return-Path: <> X-Original-To: johnny@mail Delivered-To: johnny@mail Received: by mydomain.com (Postfix) id BC328647FF; Sun, 6 Jul 2014 18:04:51 +0100 (BST) Date: Sun, 6 Jul 2014 18:04:51 +0100 (BST) From: MAILER-DAEMON@mydomain.com (Mail Delivery System) Subject: Undelivered Mail Returned to Sender To: johnny@mail Auto-Submitted: auto-replied MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="3EEA5647FE.1404666291/mydomain.com" Message-Id: <20140706170451.BC328647FF@mydomain.com> This is a MIME-encapsulated message. --3EEA5647FE.1404666291/mydomain.com Content-Description: Notification Content-Type: text/plain; charset=us-ascii This is the mail system at host mydomain.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below. For further assistance, please send mail to postmaster. If you do so, please include this problem report. You can delete your own text from the attached returned message. The mail system <email@example.com>: host post.demon.co.uk[184.108.40.206] said: 504 5.5.2 <johnny@mail>: Sender address rejected: need fully-qualified address (in reply to RCPT TO command) --3EEA5647FE.1404666291/mydomain.com Content-Description: Delivery report Content-Type: message/delivery-status Reporting-MTA: dns; mydomain.com X-Postfix-Queue-ID: 3EEA5647FE X-Postfix-Sender: rfc822; johnny@mail Arrival-Date: Sun, 6 Jul 2014 18:04:46 +0100 (BST) Final-Recipient: rfc822; firstname.lastname@example.org Action: failed Status: 5.5.2 Remote-MTA: dns; post.demon.co.uk Diagnostic-Code: smtp; 504 5.5.2 <johnny@mail>: Sender address rejected: need fully-qualified address --3EEA5647FE.1404666291/mydomain.com Content-Description: Undelivered Message Content-Type: message/rfc822 Return-Path: <johnny@mail> Received: by mydomain.com (Postfix, from userid 1000) id 3EEA5647FE; Sun, 6 Jul 2014 18:04:46 +0100 (BST) Subject: msg 10 To: <email@example.com> X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: <20140706170446.3EEA5647FE@mydomain.com> Date: Sun, 6 Jul 2014 18:04:46 +0100 (BST) From: johnny@mail (John Hammond) test message --3EEA5647FE.1404666291/mydomain.com--