Hello.
I restart an old project of mine.
Mail administration on small local network : 5 Linux users.
Linux user may have up to 3 different mail address from different providers.
Linux user reads and writes their mails from the local network :
http://paste.opensuse.org/18134681
Working conditions:
- No owned domain name
- No fixed IP adress behind the isp dsl modem
- The server on the local network run as DHCP server and dns server using dnsmasq. Postfix is configured and running
- Self signed cert has been generated for postfix and dovecot
- FW is configured
- For the moment, just testing postfix with an isp test account.
- Test mail with the command “telnet” and “mail” on a test user on the mail server machine.
When testing postfix, I started by sending a mail via telnet. I have to modified **/etc/postfix/master.cf ** and /etc/postfix/main.cf because I did not see the startTLS message.
Now postfix try to send mail but connect to my ISP on port 25 which is not
[LEFT] allowed. Here info from ISP site :
Your login “my_user_name” is already authorized to make SMTP authenticated on “smtp.free.fr”.
Only encrypted password authentication methods are accepted. For example the use of SSL (on port 465) or of the ’ MD5 Challenge-Response’ (on port 587).
[/LEFT]
Here test session :
- Postfix start
[CODE[hostname-1:~ # systemctl restart postfix.service
hostname-1:~ # systemctl -l status postfix.service
postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled)
Active: active (running) since Wed 2015-04-22 17:22:19 CEST; 3s ago
Process: 9350 ExecStopPost=/etc/postfix/system/cond_slp deregister (code=exited, status=0/SUCCESS)
Process: 9340 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS)
Process: 9454 ExecStartPost=/etc/postfix/system/cond_slp register (code=exited, status=0/SUCCESS)
Process: 9450 ExecStartPost=/etc/postfix/system/wait_qmgr 60 (code=exited, status=0/SUCCESS)
Process: 9373 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Process: 9370 ExecStartPre=/etc/postfix/system/update_postmaps (code=exited, status=0/SUCCESS)
Process: 9367 ExecStartPre=/etc/postfix/system/update_chroot (code=exited, status=0/SUCCESS)
Process: 9363 ExecStartPre=/etc/postfix/system/config_postfix (code=exited, status=0/SUCCESS)
Process: 9361 ExecStartPre=/bin/echo Starting mail service (Postfix) (code=exited, status=0/SUCCESS)
Main PID: 9447 (master)
CGroup: /system.slice/postfix.service
├─9447 /usr/lib/postfix/master -w
├─9448 pickup -l -t fifo -u
└─9449 qmgr -l -t fifo -u
Apr 22 17:22:18 hostname-1 echo[9361]: Starting mail service (Postfix)
Apr 22 17:22:19 hostname-1 postfix/master[9447]: daemon started – version 2.11.3, configuration /etc/postfix
hostname-1:~ #
- telnet
hostname-1:~ # telnet hostname-1.my-dom-test.nwk 25
Trying 192.168.130.123…
Connected to hostname-1.my-dom-test.nwk.
Escape character is ‘^]’.
220 hostname-1.localdomain ESMTP
ehlo hostname-1.my-dom-test.nwk
250-hostname-1.localdomain
250-PIPELINING
250-SIZE
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM:xxxxxxxxx@free.fr
250 2.1.0 Ok
RCPT TO:xxxxxxxxxx@free.fr
250 2.1.5 Ok
DATA
354 End data with .
subject : Test
This is a test
.
250 2.0.0 Ok: queued as 24699E01A8
quit
221 2.0.0 Bye
Connection closed by foreign host.
hostname-1:~ #
- systemd journal
Apr 22 17:22:18 hostname-1 echo[9361]: Starting mail service (Postfix)
Apr 22 17:22:19 hostname-1 postfix/master[9447]: daemon started – version 2.11.3, configuration /etc/postfix
Apr 22 17:22:47 hostname-1 postfix/smtpd[9470]: initializing the server-side TLS engine
Apr 22 17:22:47 hostname-1 postfix/tlsmgr[9472]: open smtp TLS cache btree:/var/lib/postfix/smtpd_tls_session_cache
Apr 22 17:22:47 hostname-1 postfix/tlsmgr[9472]: tlsmgr_cache_run_event: start TLS smtp session cache cleanup
Apr 22 17:22:47 hostname-1 postfix/smtpd[9470]: connect from hostname-1.my-dom-test.nwk[192.168.130.123]
Apr 22 17:23:37 hostname-1 postfix/smtpd[9470]: 24699E01A8: client=hostname-1.my-dom-test.nwk[192.168.130.123]
Apr 22 17:23:58 hostname-1 postfix/cleanup[9474]: 24699E01A8: message-id=20150422152337.24699E01A8@hostname-1.localdomain
Apr 22 17:23:58 hostname-1 postfix/qmgr[9449]: 24699E01A8: from=xxxxxxxxxxxxx@free.fr, size=409, nrcpt=1 (queue active)
Apr 22 17:23:58 hostname-1 postfix/smtp[9476]: initializing the client-side TLS engine
Apr 22 17:24:02 hostname-1 postfix/smtpd[9470]: disconnect from hostname-1.my-dom-test.nwk[192.168.130.123]
Apr 22 17:24:28 hostname-1 postfix/smtp[9476]: connect to smtp.free.fr[212.27.48.4]:25: Connection timed out
Apr 22 17:24:28 hostname-1 postfix/smtp[9476]: 24699E01A8: to=xxxxxxxxxxxx@free.fr, relay=none, delay=73, delays=43/0.02/30/0, dsn=4.4.1, status=deferred (connect to smtp.free.fr[212.27.48.4]:25: Connection timed out)
**Config :**
Self signed cert (postfix example):
openssl req -new -x509 -days 3650 -nodes -out /etc/ssl/certs/postfix.pem -keyout /etc/ssl/private/postfix.pem
Firewall :
http://paste.opensuse.org/97458654
http://paste.opensuse.org/98962735
Have modified /etc/services because port was not open ( Not sure this was necessary )
smtps 465/tcp # Secure SMTP
smtps 465/udp # Secure SMTP
/etc/postfix/main.cf
http://paste.opensuse.org/46566243
/etc/postfix/master.cf
http://paste.opensuse.org/99236676
Any help is nwelcome.