Postfix Error

Issues related to applications and software problems
Post Reply
alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Postfix Error

Post by alex3105 » 2018/08/12 22:45:42

Dear forum, surfing I found this link to configure postfix to send notifications of Centos to Exchange but errors appear to me .. unfortunately I am not an expert in Centos .. but I would appreciate it if you can help me solve it ..

Aug 12 17:27:25 localhost postfix/cleanup[7944]: 4161680279BC: message-id=<20180812222725.4161680279BC@host.domain.tld>
Aug 12 17:27:25 localhost postfix/qmgr[7881]: 4161680279BC: from=<root@domain.tld>, size=442, nrcpt=1 (queue active)
Aug 12 17:27:55 localhost postfix/smtp[7948]: connect to 192.168.32.24[192.168.32.24]:25: Connection timed out
Aug 12 17:27:55 localhost postfix/smtp[7948]: 4161680279BC: to=<user1ctx@liteon.com>, relay=none, delay=30, delays=0.1/0.03$

I have enabled port 25:

[root@localhost nagios]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens33
sources:
services: ssh dhcpv6-client http
ports: 80/tcp 25/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:

[root@localhost nagios]# systemctl status postfix.service -l
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/usr/lib/systemd/system/postfix.service; enabled; vendor preset: disabled)
Active: active (running) since dom 2018-08-12 17:26:32 -05; 18min ago
Process: 7787 ExecStop=/usr/sbin/postfix stop (code=exited, status=0/SUCCESS)
Process: 7803 ExecStart=/usr/sbin/postfix start (code=exited, status=0/SUCCESS)
Process: 7801 ExecStartPre=/usr/libexec/postfix/chroot-update (code=exited, status=0/SUCCESS)
Process: 7799 ExecStartPre=/usr/libexec/postfix/aliasesdb (code=exited, status=0/SUCCESS)
Main PID: 7879 (master)
Tasks: 3
CGroup: /system.slice/postfix.service
├─7879 /usr/libexec/postfix/master -w
├─7880 pickup -l -t unix -u
└─7881 qmgr -l -t unix -u

ago 12 17:27:55 localhost.localdomain postfix/smtp[7948]: 4161680279BC: to=<user1ctx@liteon.com>, relay=none, delay=30, delays=0.1/0.03/30/0, dsn=4.4.1, status=deferred (connect to 192.168.32.24[192.168.32.24]:25: Connection timed out)
ago 12 17:31:32 localhost.localdomain postfix/qmgr[7881]: 33FB080279BE: from=<root@domain.tld>, size=442, nrcpt=1 (queue active)
ago 12 17:31:32 localhost.localdomain postfix/qmgr[7881]: 87AA180279BA: from=<root@domain.tld>, size=438, nrcpt=1 (queue active)
ago 12 17:32:02 localhost.localdomain postfix/smtp[8165]: connect to 192.168.32.24[192.168.32.24]:25: Connection timed out
ago 12 17:32:02 localhost.localdomain postfix/smtp[8165]: 33FB080279BE: to=<user1ctx@liteon.com>, relay=none, delay=2481, delays=2451/0.04/30/0, dsn=4.4.1, status=deferred (connect to 192.168.32.24[192.168.32.24]:25: Connection timed out)
ago 12 17:32:02 localhost.localdomain postfix/smtp[8166]: connect to 192.168.32.24[192.168.32.24]:25: Connection timed out
ago 12 17:32:02 localhost.localdomain postfix/smtp[8166]: 87AA180279BA: to=<user1ctx@liteon.com>, relay=none, delay=2524, delays=2494/0.03/30/0, dsn=4.4.1, status=deferred (connect to 192.168.32.24[192.168.32.24]:25: Connection timed out)
ago 12 17:36:32 localhost.localdomain postfix/qmgr[7881]: 4161680279BC: from=<root@domain.tld>, size=442, nrcpt=1 (queue active)
ago 12 17:37:02 localhost.localdomain postfix/smtp[8411]: connect to 192.168.32.24[192.168.32.24]:25: Connection timed out
ago 12 17:37:02 localhost.localdomain postfix/smtp[8411]: 4161680279BC: to=<user1ctx@liteon.com>, relay=none, delay=577, delays=547/0.02/30/0, dsn=4.4.1, status=deferred (connect to 192.168.32.24[192.168.32.24]:25: Connection timed out)


Best Regards,

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Postfix Error

Post by hunter86_bg » 2018/08/13 03:59:29

Obviously , the server won't allow you to connect.
Does the exchange require any authentication ?
Does it use encryption ?

alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Re: Postfix Error

Post by alex3105 » 2018/08/13 17:23:40

Hunter86_bg .. respect Does the exchange require any authentication ? as valid..???
I do not use encription..


Greetings..

alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Re: Postfix Error

Post by alex3105 » 2018/08/13 20:39:02

I insisted again to try to make it work and now I have this result in the events:


Aug 13 15:30:26 localhost postfix/pickup[25661]: 0ACE18184FB8: uid=1000 from=<nagios>
Aug 13 15:30:26 localhost postfix/cleanup[26252]: 0ACE18184FB8: message-id=<20180813203026.0ACE18184FB8@myserverexchange.mydomain.com>
Aug 13 15:30:26 localhost postfix/qmgr[1291]: 0ACE18184FB8: from=<nagios@mydomain.com>, size=711, nrcpt=1 (queue active)
Aug 13 15:30:26 localhost postfix/smtp[21058]: warning: host 192.168.32.24[192.168.32.24]:25 greeted me with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:26 localhost postfix/smtp[21058]: warning: host 192.168.32.24[192.168.32.24]:25 replied to HELO/EHLO with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:26 localhost postfix/smtp[21058]: 0ACE18184FB8: to=<nagios@localhost.mydomain.com>, orig_to=<nagios@localhost>, relay=192.168.32.24[192.168.32.24]:25, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for 192.168.32.24 loops back to myself)
Aug 13 15:30:26 localhost postfix/cleanup[32568]: 0C7E58184FDE: message-id=<20180813203026.0C7E58184FDE@myserverexchange.mydomain.com>
Aug 13 15:30:26 localhost postfix/bounce[1992]: 0ACE18184FB8: sender non-delivery notification: 0C7E58184FDE
Aug 13 15:30:26 localhost postfix/qmgr[1291]: 0C7E58184FDE: from=<>, size=2605, nrcpt=1 (queue active)
Aug 13 15:30:26 localhost postfix/qmgr[1291]: 0ACE18184FB8: removed
Aug 13 15:30:26 localhost postfix/smtp[21075]: warning: host 192.168.32.24[192.168.32.24]:25 greeted me with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:26 localhost postfix/smtp[21075]: warning: host 192.168.32.24[192.168.32.24]:25 replied to HELO/EHLO with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:26 localhost postfix/smtp[21075]: 0C7E58184FDE: to=<nagios@mydomain.com>, relay=192.168.32.24[192.168.32.24]:25, delay=0, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for 192.168.32.24 loops back to myself)
Aug 13 15:30:26 localhost postfix/qmgr[1291]: 0C7E58184FDE: removed
Aug 13 15:30:31 localhost postfix/pickup[25661]: A95AC8184FB8: uid=1000 from=<nagios>
Aug 13 15:30:31 localhost postfix/cleanup[26252]: A95AC8184FB8: message-id=<20180813203031.A95AC8184FB8@myserverexchange.mydomain.com>
Aug 13 15:30:31 localhost postfix/qmgr[1291]: A95AC8184FB8: from=<nagios@mydomain.com>, size=710, nrcpt=1 (queue active)
Aug 13 15:30:31 localhost postfix/smtp[21058]: warning: host 192.168.32.24[192.168.32.24]:25 greeted me with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:31 localhost postfix/smtp[21058]: warning: host 192.168.32.24[192.168.32.24]:25 replied to HELO/EHLO with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:31 localhost postfix/smtp[21058]: A95AC8184FB8: to=<nagios@localhost.mydomain.com>, orig_to=<nagios@localhost>, relay=192.168.32.24[192.168.32.24]:25, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for 192.168.32.24 loops back to myself)
Aug 13 15:30:31 localhost postfix/cleanup[32568]: AAA7B8184FDE: message-id=<20180813203031.AAA7B8184FDE@myserverexchange.mydomain.com>
Aug 13 15:30:31 localhost postfix/bounce[1992]: A95AC8184FB8: sender non-delivery notification: AAA7B8184FDE
Aug 13 15:30:31 localhost postfix/qmgr[1291]: AAA7B8184FDE: from=<>, size=2604, nrcpt=1 (queue active)
Aug 13 15:30:31 localhost postfix/qmgr[1291]: A95AC8184FB8: removed
Aug 13 15:30:31 localhost postfix/smtp[21075]: warning: host 192.168.32.24[192.168.32.24]:25 greeted me with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:31 localhost postfix/smtp[21075]: warning: host 192.168.32.24[192.168.32.24]:25 replied to HELO/EHLO with my own hostname myserverexchange.mydomain.com
Aug 13 15:30:31 localhost postfix/smtp[21075]: AAA7B8184FDE: to=<nagios@mydomain.com>, relay=192.168.32.24[192.168.32.24]:25, delay=0, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for 192.168.32.24 loops back to myself)
Aug 13 15:30:31 localhost postfix/qmgr[1291]: AAA7B8184FDE: removed

Greetings.

alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Re: Postfix Error

Post by alex3105 » 2018/08/13 20:40:43

I used the following link for the configuration

http://www.techspacekh.com/configuring- ... -centos-7/

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Postfix Error

Post by hunter86_bg » 2018/08/16 04:04:47

If you don't use encryption/ aithentication, it should work.
Is it working, as I didn't have enough time to read the logs?

alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Re: Postfix Error

Post by alex3105 » 2018/08/16 14:25:55

No, it still does not work ... will you have a link where you can guide me to configure it ...?

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Postfix Error

Post by hunter86_bg » 2018/08/18 09:50:33

Paste your config and we can check it.
Also we will need the following information:
1. FQDN of CentOS 7
2. IP that matches the CentOS FQDN
3. FQDN of the exchange server
3. IP that matches the Exchange Server FQDN

Code: Select all

grep -Ev "^$|^#" /etc/postfix/main.cf

alex3105
Posts: 6
Joined: 2018/08/12 22:33:31

Re: Postfix Error

Post by alex3105 » 2018/08/23 19:55:01

A thousand apologies for the delay.

Hostname Centos 7
localhost
IP
10.1.100.235
Hostname servidor Exchange 2010
mailcorreo
IP
192.168.32.24


[root@localhost nagios]# grep -Ev "^$|^#" /etc/postfix/main.cf

queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
myhostname = mailcorreo.mydomain.com
mydomain = mydomain.com
myorigin = $mydomain
inet_interfaces = localhost
inet_protocols = ipv4

local_transport = error: entrega local desactivada
mydestination =

unknown_local_recipient_reject_code = 550
mynetworks = 10.1.100.0/24,172.16.0.0/24,127.0.0.0/8
relayhost = 192.168.32.24
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2

debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
ddd $daemon_directory/$process_name $process_id & sleep 5
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.10.1/samples
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
[root@localhost nagios]#

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: Postfix Error

Post by hunter86_bg » 2018/08/28 13:09:30

As per /usr/share/doc/postfix-*/README_FILES/STANDARD_CONFIGURATION_README
null client should be set by changing the following in the main.cf:

myhostname = hostname.example.com (yourcase localhost.mydomain.com)
myorigin = $mydomain
relayhost = $mydomain (your case you can use relayhost = [ 192.168.32.24 ] ).
inet_interfaces = loopback-only
mydestination =
Note: using [ip or FQDN] means that your postfix will relay no matter if there is a mail record or not for this host.

Once you setup your postfix like this , it won't accept e-mails from other systems but will relay all e-mails locally to your exchange.
Once you verify that relaying is working (check 'postqueue -p' and /var/log/maillog for details) then you can change the previous configuration by adding :

Code: Select all

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
and

Code: Select all

mynetworks = 10.1.100.0/24, 172.16.0.0/24, 127.0.0.0/8
Then you will try sending e-mail from another server that was defined as null client (with relay to your 'localhost.mydomain.com' CentOS 7 server).

Post Reply