No registered domain
No IP fixe
The router connected to internet
- Set a domain name for the local network : my_example.com
- Set a A record for the domain
- Set a MX record for the mail server for the domain
Postfix is configured at minima as “Postfix on a local network” documentation
At this first step, postfix is configured to not send mails outside the local network.
Mailbox users are centralized on the mail server.
From a computer ( not the mail server ) I make a test to see if postfix is running at minima.
If by chance I forgot the mail server address, I can always obtain it by the usual command :
dig -t MX my_example.com which return :
~> dig -t MX my_example.com
; <<>> DiG 9.9.9-P1 <<>> -t MX my_example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 54941
;; flags: qr aa rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;my_example.com. IN MX
;; ANSWER SECTION:
my_example.com. 0 IN MX 1 my_mail.my_example.com.
;; Query time: 0 msec
;; SERVER: 192.168.130.230#53(192.168.130.230)
;; WHEN: Sun Jun 17 18:15:01 CEST 2018
;; MSG SIZE rcvd: 85
telnet mailserver.my_example.com 25 220 my_example.com ESMTP ehlo localhost 250........... 250........... 250........... 250........... mail from:some_user 250 OK rcpt to:another_user 2580 OK data 354 ................. this is a test . 250 OK : queued as A7CCEF2900C quit 221 bye Connection closed by foreign host.
Using telnet I give the address and the port because telnet know nothing about what I plain to do.
My question now :
If I use mailx, it seems that I need also to give the smtp adress as in :
mailx -vvv \ -s "Subject: mailx send mail smtp shortname to another_user" \ **-S smtp=192.168.130.80:25 \** -r "some_user" \ another_user <<< "This is a test"
even with user@domain :
mailx -vvv \ -s "Subject: mailx send mail smtp fullname to another_user@my_example.com" \ **-S smtp=192.168.130.80:25 \** -r "some_user@my_example.com" \ another_user@my_example.com <<< "This is a test"
If not, the mail is not sent.
The same apply if I send mail on the computer wher postfix is running.
Is it a mandatory parameter that must be given to mailx ?
Any help is welcome.