25-th port is not opened

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

25-th port is not opened

arsen.shnurkov

When I try to start, it writes "ok":

 # /etc/init.d/postfix start
 * Starting postfix  ...                                                                                                                                [ ok ]
but 25-th port is not opened:
# ss -4l
State      Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port   
LISTEN     0      50                                                     127.0.0.1:mysql                                                           *:*       
LISTEN     0      128                                                            *:pop3                                                            *:*       
LISTEN     0      128                                                            *:imap                                                            *:*       
LISTEN     0      128                                                            *:http                                                            *:*       
LISTEN     0      128                                                            *:ssh                                                             *:*       
LISTEN     0      128                                                            *:https                                                           *:*  
I allowed all interfaces:

# postconf -n | grep inet
inet_interfaces = all
inet_protocols = ipv4

# grep «smtp» /etc/postfix/master.cf

smtp      inet  n       -       n       -       -       smtpd -v
smtp      unix  -       -       n       -       -       smtp
relay     unix  -       -       n       -       -       smtp
        -o smtp_fallback_relay=

Logs are empty, here is my syslog-ng setup:

# grep "mail" /etc/syslog-ng/syslog-ng.conf | grep -v "#"
destination mail { file("/var/log/mail/mail.log"); };
destination mailinfo { file("/var/log/mail/mail.info"); };
destination mailwarn { file("/var/log/mail/mail.warn"); };
destination mailerr { file("/var/log/mail/mail.err"); }; 
filter f_mail { facility(mail); };
log { source(src); filter(f_mail); destination(mail); };
log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); };
log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); };
log { source(src); filter(f_mail); filter(f_err); destination(mailerr); }; 

my /etc/postfix/main.cf contains following:

# grep "my" /etc/postfix/main.cf
virtual_mailbox_domains=mysql:/etc/postfix/mysql/mysql-virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql-virtual-maps.cf
virtual_uid_maps = mysql:/etc/postfix/mysql/mysql-virtual-uid.cf
virtual_gid_maps = mysql:/etc/postfix/mysql/mysql-virtual-gid.cf
myhostname = mydomain.ru
mydomain = mydomain.ru
mydestination = localhost
mynetworks = 192.168.9.0/24, 192.168.8.0/24, 192.168.7.0/24, 192.168.6.0/24, 127.0.0.0/8
What I should check in the first place?




Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

/dev/rob0
On Sat, Feb 02, 2013 at 08:00:28AM +0400, arsen.shnurkov wrote:
> When I try to start, it writes "ok":
>
> |  # /etc/init.d/postfix start
>  * Starting postfix  ...                                                                                                                                [ ok ]

That's the distro's init script. See what you get with "postfix -v
start". (But you'll probably need to use the init script in general;
consult your distributor's documentation for their Postfix package.)

> but 25-th port is not opened:
>
> |# ss -4l
> State      Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> LISTEN     0      50                                                     127.0.0.1:mysql                                                           *:*
> LISTEN     0      128                                                            *:pop3                                                            *:*
> LISTEN     0      128                                                            *:imap                                                            *:*
> LISTEN     0      128                                                            *:http                                                            *:*
> LISTEN     0      128                                                            *:ssh                                                             *:*
> LISTEN     0      128                                                            *:https                                                           *:*
> |
>
> |I allowed all interfaces:
>
> # postconf -n | grep inet
> inet_interfaces = all
> inet_protocols = ipv4
> |
>
> # grep «smtp» /etc/postfix/master.cf
>
> |smtp      inet  n       -       n       -       -       smtpd -v
  ^
1. Is this pipe character really there? It should not be.
2. You do NOT want verbose logs. Remove the -v.

> smtp      unix  -       -       n       -       -       smtp
> relay     unix  -       -       n       -       -       smtp
>         -o smtp_fallback_relay=
> |
>
> Logs are empty, here is my syslog-ng setup:

This is what you must fix first.

> |# grep "mail" /etc/syslog-ng/syslog-ng.conf | grep -v "#"
> destination mail { file("/var/log/mail/mail.log"); };

Looks like /var/log/mail/mail.log is the file that should have your
mail.* syslog facility.priority logs. Did you delete it? Try
restarting the syslogd.

> destination mailinfo { file("/var/log/mail/mail.info"); };
> destination mailwarn { file("/var/log/mail/mail.warn"); };
> destination mailerr { file("/var/log/mail/mail.err"); };
> filter f_mail { facility(mail); };
> log { source(src); filter(f_mail); destination(mail); };
> log { source(src); filter(f_mail); filter(f_info); destination(mailinfo); };
> log { source(src); filter(f_mail); filter(f_warn); destination(mailwarn); };
> log { source(src); filter(f_mail); filter(f_err); destination(mailerr); };
> |
>
> my /etc/postfix/main.cf contains following:
>
> |# grep "my" /etc/postfix/main.cf

"postconf -n" is strongly preferred here.

> virtual_mailbox_domains=mysql:/etc/postfix/mysql/mysql-virtual-domains.cf
> virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql-virtual-maps.cf
> virtual_uid_maps = mysql:/etc/postfix/mysql/mysql-virtual-uid.cf
> virtual_gid_maps = mysql:/etc/postfix/mysql/mysql-virtual-gid.cf
> myhostname = mydomain.ru
> mydomain = mydomain.ru
> mydestination = localhost
> mynetworks = 192.168.9.0/24, 192.168.8.0/24, 192.168.7.0/24, 192.168.6.0/24, 127.0.0.0/8
> |
>
> What I should check in the first place?

Until you get the logs working there is little else we can say here.
--
  http://rob0.nodns4.us/ -- system administration and consulting
  Offlist GMX mail is seen only if "/dev/rob0" is in the Subject:
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

James Griffin
In reply to this post by arsen.shnurkov
* arsen.shnurkov <[hidden email]> [2013-02-02 08:00:28 +0400]:

> When I try to start, it writes "ok":
>
> |  # /etc/init.d/postfix start
>  * Starting postfix  ...                                                                                                                                [ ok ]
> |
>
> but 25-th port is not opened:
>
> |# ss -4l
> State      Recv-Q Send-Q                                             Local Address:Port                                                 Peer Address:Port
> LISTEN     0      50                                                     127.0.0.1:mysql                                                           *:*
> LISTEN     0      128                                                            *:pop3                                                            *:*
> LISTEN     0      128                                                            *:imap                                                            *:*
> LISTEN     0      128                                                            *:http                                                            *:*
> LISTEN     0      128                                                            *:ssh                                                             *:*
> LISTEN     0      128                                                            *:https                                                           *:*
> |
>
> |I allowed all interfaces:
>
> # postconf -n | grep inet
> inet_interfaces = all
> inet_protocols = ipv4
> |
>
> # grep «smtp» /etc/postfix/master.cf
>
> |smtp      inet  n       -       n       -       -       smtpd -v
> smtp      unix  -       -       n       -       -       smtp
> relay     unix  -       -       n       -       -       smtp
>         -o smtp_fallback_relay=

Have you enabled the "smtpd" line in the master.cf file - for incoming connections:

smtp inet n - n - - smtpd

This is what enables the smtpd(8) daemon to listen for incoming tcp/25 connections
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

John Allen
In reply to this post by arsen.shnurkov
What I should check in the first place?
I don't see any sign that postfix is running.

How about a simple test to see if it running, most distro have the "service" command so start with

service postfix status

this should tell you if postfix is running or not. if your distro does not have the service command you could try

ps  -A | grep master

this should show you is postfix master process is running, but its not definitive.

have you checked the mail log, and or the syslog to see if there is a problem with postfix.

John A

Today's mighty Oak is yesterday's nut that held it's ground. - Margaret Bailey

Sent using Mozilla Thunderbird



Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

arsen.shnurkov
In reply to this post by /dev/rob0
# postfix -v start
postfix: name_mask: ipv4
postfix: inet_addr_local: configured 5 IPv4 addresses

# ps -e | grep master
#

> Is this pipe character really there? It should not be.

no, it's artefact from mail, there is no such pipe characted in config

> You do NOT want verbose logs. Remove the -v.

ok, will do that later


>> Logs are empty
> This is what you must fix first.

What should I check? I tried to write test messages and they go to log without troubles:

# logger -p mail.warn "Mail warining"
# logger -p mail.info "Mail info"
# logger -p mail.error "Mail error"
# cat /var/log/mail/mail.log
Feb  2 20:08:25 test154 nobody: Mail warining
Feb  2 20:08:32 test154 nobody: Mail info
Feb  2 20:08:39 test154 nobody: Mail error

> Did you delete it?

No

> Try restarting the syslogd.

Did that before.

> "postconf -n" is strongly preferred here.

# postconf -n
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib64/postfix
data_directory = /var/lib/postfix
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
default_destination_concurrency_limit = 10
home_mailbox = .maildir/
html_directory = /usr/share/doc/postfix-2.6.5/html
inet_interfaces = all
inet_protocols = ipv4
local_destination_concurrency_limit = 2
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydestination = localhost
mydomain = mydomain.ru
myhostname = mydomain.ru
mynetworks = 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24, 192.168.3.0/24, 127.0.0.0/8
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.5/readme
sample_directory = /etc/postfix
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
virtual_gid_maps = mysql:/etc/postfix/mysql/mysql-virtual-gid.cf
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = mysql:/etc/postfix/mysql/mysql-virtual-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql/mysql-virtual-maps.cf
virtual_uid_maps = mysql:/etc/postfix/mysql/mysql-virtual-uid.cf

> Until you get the logs working there is little else we can say here.

I think that syslog-ng works properly. It's postfix who doesn't start.

> How about a simple test to see if it running, ps  -A | grep master

no, it isn't running:

# ps  -A | grep master
#

> have you checked the mail log, and or the syslog to see if there is a problem with postfix.

nothing new in these logs
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

John Allen
>> How about a simple test to see if it running, ps  -A | grep master
>no, it isn't running:

There is not much point in looking anywhere for a solution for problems, until you have Postfix running.
Try         "service postfix start"      what happens?

John A
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

Reindl Harald-2


Am 02.02.2013 18:45, schrieb John Allen:
>>> How about a simple test to see if it running, ps  -A | grep master
>>no, it isn't running:
>
> There is not much point in looking anywhere for a solution for problems, until you have Postfix running.
> Try         "service postfix start"      what happens?

if you would have read the thread you would have
seen that sysvinit believes it is started and say OK

/usr/sbin/postfix -c /etc/postfix start
or maybe on older systems before UsrMove
/sbin/postfix -c /etc/postfix start

would be a better chance to get REALLY output


signature.asc (271 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

John Allen
On 02/02/2013 1:16 PM, Reindl Harald wrote:

>
> Am 02.02.2013 18:45, schrieb John Allen:
>>>> How about a simple test to see if it running, ps  -A | grep master
>>> no, it isn't running:
>> There is not much point in looking anywhere for a solution for problems, until you have Postfix running.
>> Try         "service postfix start"      what happens?
> if you would have read the thread you would have
> seen that sysvinit believes it is started and say OK
>
> /usr/sbin/postfix -c /etc/postfix start
> or maybe on older systems before UsrMove
> /sbin/postfix -c /etc/postfix start
>
> would be a better chance to get REALLY output
>
I agree, but it might be a nice idea to see what happens with manual
start. After all there is nothing in the logs that we have been told
about that say it  ever started, no matter what sysvint says.

What we have is :
     nothing listening on port 25, 465(?), 587.
     master does not appear in the output of ps, if Postfix is running I
would assume we should see it
     if you run "ps -A | grep master"

So what evidence is there that it was ever started, has it been added to
the init.
At the moment we have no evidence that it started, and certainly none
that it started successfully.
Reply | Threaded
Open this post in threaded view
|

Re: 25-th port is not opened

arsen.shnurkov

> What we have is :
>     nothing listening on port 25, 465(?), 587.
>     master does not appear in the output of ps, if Postfix is running
> I would assume we should see it
>     if you run "ps -A | grep master"
>
> So what evidence is there that it was ever started, has it been added
> to the init.
> At the moment we have no evidence that it started, and certainly none
> that it started successfully.

The source of error was the old configuration script.
I found this with strace log file - http://bpaste.net/show/74653/

line 229:

execve("/usr/lib64/postfix/postfix-script",
["/usr/lib64/postfix/postfix-script", "start"], [/* 18 vars */]) = -1
ENOEXEC (Exec format error)


Distribution maintainers move directory, but I didn't update script
properly.

Old script has
daemon_directory = /usr/lib64/postfix
now it is
daemon_directory = /usr/libexec/postfix