postfix instance
Hello
I was configured the posfix on two ip address postfix status postfix/postfix-script: the Postfix mail system is running: PID: 19218 postfix-second/postfix-script: the Postfix mail system is running: PID: 19287 but when i run the netstat command like this netstat -nlp | grep 2525 tcp 0 0 xx:xx:xx:xx:2525 0.0.0.0:* LISTEN 19218/master but my second ip address listen port not shown plese help me how can i resolve this issues |
You have 2 nic cards?
Edit, ok forget this question :study: http://www.postfix.org/MULTI_INSTANCE_README.html |
Thanks for your reply
i followed step which u mentioned this link http://www.postfix.org/MULTI_INSTANCE_README.html still my second postfix instance not working telnet info.thinknote.in 2525 Trying xx.xx.xx.12... telnet: connect to address xx.xx.xx.12: Connection refused can you please resolve this issues |
Quote:
|
Maybe strace -p ..... (on the 2nd PID); also lsof!
Post diff of the 2 config files Does -second work *IF run ALONE*? data_direcotry *MUST* be different! *maybe* experiment with using port 225 (instead of 2525 [ms-v-worlds]) (telnet localhost 2525? ifconfig -a to check both ip's...) |
I assigned the port 2525 in master.cf file on both postfix instance
there is two ip address xx.xx.xx.96 xx.xx.xx.12 first postfix instance (xx.xx.xx.96) working fine telnet xxxxxxxx.in 25 Trying xx.xx.xx.96... telnet: connect to address xx.xx.xx.96: Connection refused [root@QVM730 ~]# telnet xxxxxxxx.in 2525 Trying xx.xx.xx.96... Connected to xxxxxxxx.in. Escape character is '^]'. 220 host.xxxxxxxx.in ESMTP Postfix (2.10.1) ehlo xxxxxxxx.in 250-host.xxxxxxxx.in 250-PIPELINING 250-SIZE 10240000 250-VRFY 250-ETRN 250-ENHANCEDSTATUSCODES 250-8BITMIME 250 DSN mail from:conatct@xxxxxxxx.in 250 2.1.0 Ok rcpt to:harshml26@gmail.com 250 2.1.5 Ok data 354 End data with <CR><LF>.<CR><LF> hjasbdsajd . 250 2.0.0 Ok: queued as 0C7FD2006179CF quit 221 2.0.0 Bye Connection closed by foreign host. second postfix instance xx.xx.xx.12 not working telnet info.xxxxxxxx.in 2525 Trying xx.xx.xx.12... telnet: connect to address xx.xx.xx.12: Connection refused here is config file of the both postfix first one is xx.xx.xx.96 In main.cf file queue_directory = /var/spool/postfix myhostname = host.xxxxxxxx.in mydomain = xxxxxxxx.in myorigin = $mydomain inet_interfaces = xxxxxxxx.in mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = xx.xx.xx.96/28, 127.0.0.0/8 In master.cf file xx.xx.xx.96:2525 inet n - n - - smtpd second postfix queue_directory = /var/spool/postfix-xx.xx.xx.12 myhostname = info.xxxxxxxx.in mydomain = info.xxxxxxxx.in myorigin = $mydomain inet_interfaces = info.xxxxxxxx.in mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = xx.xx.xx.12/28, 127.0.0.0/8 In master.cf file xx.xx.xx.12:2525 inet n - n - - smtpd postfix status postfix/postfix-script: the Postfix mail system is running: PID: 958 postfix-xx.xx.xx.12/postfix-script: the Postfix mail system is running: PID: 1027 |
For inet_interfaces setting, did you try using IP instead of hostname?
mydomain should be domain part of hostname (eg: thinkxxxx.xx) |
i done which u mentioned still facing the same issues
in inet_interfaces setting inet_interfaces = xx.xx.xx.12 mydomain = xxxxxxxx.in telnet info.xxxxxxxx.in 2525 Trying xx.xx.xx.12... telnet: connect to address xx.xx.xx.12: Connection refused |
could you post output with
Code:
ifconfig -a Code:
iptables -L -v -n |
[root@QVM730 ~]# ifconfig -a
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.96 netmask 255.255.255.0 broadcast xx.xx.xx.255 inet6 fe80::5052:4ff:fe00:1103 prefixlen 64 scopeid 0x20<link> ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) RX packets 29517 bytes 3096759 (2.9 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 18001 bytes 2803988 (2.6 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.12 netmask 255.255.255.0 broadcast xx.xx.xx.255 ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) eth0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.84 netmask 255.255.255.0 broadcast xx.xx.xx.255 ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 35 bytes 2900 (2.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 35 bytes 2900 (2.8 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 .................................... [root@QVM730 ~]# iptables -L -v -n Chain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 14544 1826K ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED 2 300 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 419 33859 INPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0 419 33859 INPUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0 419 33859 INPUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0 43 3919 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 183 10720 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target prot opt in out source destination 0 0 ACCEPT all -- * * 0.0.0.0/0 0.0.0.0/0 ctstate RELATED,ESTABLISHED 0 0 ACCEPT all -- lo * 0.0.0.0/0 0.0.0.0/0 0 0 FORWARD_direct all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FORWARD_IN_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FORWARD_IN_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FORWARD_OUT_ZONES_SOURCE all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FORWARD_OUT_ZONES all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 ACCEPT icmp -- * * 0.0.0.0/0 0.0.0.0/0 0 0 REJECT all -- * * 0.0.0.0/0 0.0.0.0/0 reject-with icmp-host-prohibited Chain OUTPUT (policy ACCEPT 18165 packets, 2581K bytes) pkts bytes target prot opt in out source destination 18165 2581K OUTPUT_direct all -- * * 0.0.0.0/0 0.0.0.0/0 Chain FORWARD_IN_ZONES (1 references) pkts bytes target prot opt in out source destination 0 0 FWDI_home all -- eth0 * 0.0.0.0/0 0.0.0.0/0 [goto] 0 0 FWDI_home all -- + * 0.0.0.0/0 0.0.0.0/0 [goto] Chain FORWARD_IN_ZONES_SOURCE (1 references) pkts bytes target prot opt in out source destination Chain FORWARD_OUT_ZONES (1 references) pkts bytes target prot opt in out source destination 0 0 FWDO_home all -- * eth0 0.0.0.0/0 0.0.0.0/0 [goto] 0 0 FWDO_home all -- * + 0.0.0.0/0 0.0.0.0/0 [goto] Chain FORWARD_OUT_ZONES_SOURCE (1 references) pkts bytes target prot opt in out source destination Chain FORWARD_direct (1 references) pkts bytes target prot opt in out source destination Chain FWDI_home (2 references) pkts bytes target prot opt in out source destination 0 0 FWDI_home_log all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FWDI_home_deny all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FWDI_home_allow all -- * * 0.0.0.0/0 0.0.0.0/0 Chain FWDI_home_allow (1 references) pkts bytes target prot opt in out source destination Chain FWDI_home_deny (1 references) pkts bytes target prot opt in out source destination Chain FWDI_home_log (1 references) pkts bytes target prot opt in out source destination Chain FWDO_home (2 references) pkts bytes target prot opt in out source destination 0 0 FWDO_home_log all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FWDO_home_deny all -- * * 0.0.0.0/0 0.0.0.0/0 0 0 FWDO_home_allow all -- * * 0.0.0.0/0 0.0.0.0/0 Chain FWDO_home_allow (1 references) pkts bytes target prot opt in out source destination Chain FWDO_home_deny (1 references) pkts bytes target prot opt in out source destination Chain FWDO_home_log (1 references) pkts bytes target prot opt in out source destination Chain INPUT_ZONES (1 references) pkts bytes target prot opt in out source destination 419 33859 IN_home all -- eth0 * 0.0.0.0/0 0.0.0.0/0 [goto] 0 0 IN_home all -- + * 0.0.0.0/0 0.0.0.0/0 [goto] Chain INPUT_ZONES_SOURCE (1 references) pkts bytes target prot opt in out source destination Chain INPUT_direct (1 references) pkts bytes target prot opt in out source destination Chain IN_home (2 references) pkts bytes target prot opt in out source destination 419 33859 IN_home_log all -- * * 0.0.0.0/0 0.0.0.0/0 419 33859 IN_home_deny all -- * * 0.0.0.0/0 0.0.0.0/0 419 33859 IN_home_allow all -- * * 0.0.0.0/0 0.0.0.0/0 Chain IN_home_allow (1 references) pkts bytes target prot opt in out source destination 0 0 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:631 ctstate NEW 0 0 ACCEPT udp -- * * 0.0.0.0/0 224.0.0.251 udp dpt:5353 ctstate NEW 156 12168 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:137 ctstate NEW 28 6552 ACCEPT udp -- * * 0.0.0.0/0 0.0.0.0/0 udp dpt:138 ctstate NEW 8 xx0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:22 ctstate NEW 0 0 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:443 ctstate NEW 1 40 ACCEPT tcp -- * * 0.0.0.0/0 0.0.0.0/0 tcp dpt:80 ctstate NEW Chain IN_home_deny (1 references) pkts bytes target prot opt in out source destination Chain IN_home_log (1 references) pkts bytes target prot opt in out source destination Chain OUTPUT_direct (1 references) pkts bytes target prot opt in out source destination |
Any error in /var/log/mail.log (or /var/log/maillog)?
|
i think no error in mail log
here is mail log Sep 17 14:23:42 QVM730 postfix/smtpd[2660]: disconnect from xxxxxxxx.in[xx.xx.xx.96] Sep 17 16:13:45 QVM730 postfix/postfix-script[2880]: the Postfix mail system is running: PID: 2488 Sep 17 16:13:45 QVM730 postfix-xx.xx.xx.12/postfix-script[2888]: the Postfix mail system is running: PID: 2558 Sep 17 16:14:03 QVM730 postfix/smtpd[2892]: connect from xxxxxxxx.in[xx.xx.xx.96] Sep 17 16:14:58 QVM730 postfix/smtpd[2892]: 808EF2006179BA: client=xxxxxxxx.in[xx.xx.xx.96] Sep 17 16:15:05 QVM730 postfix/cleanup[2895]: 808EF2006179BA: message-id=<20160917161458.808EF2006179BA@host.xxxxxxxx.in> Sep 17 16:15:05 QVM730 postfix/qmgr[2490]: 808EF2006179BA: from=<contact@xxxxxxxx.in>, size=337, nrcpt=1 (queue active) Sep 17 16:15:07 QVM730 postfix/smtp[2896]: 808EF2006179BA: to=<harshmn023@gmail.com>, relay=gmail-smtp-in.l.google.com[64.233.xx.27]:25, delay=47, delays=xx/0.04/0.35/0.84, dsn=2.0.0, status=sent (250 2.0.0 OK 1474128907 o71si4050160lfi.210 - gsmtp) Sep 17 16:15:07 QVM730 postfix/qmgr[2490]: 808EF2006179BA: removed Sep 17 16:15:07 QVM730 postfix/smtpd[2892]: disconnect from xxxxxxxx.in[xx.xx.xx.96] |
When you start the second postfix instance, you use: postfix -c /path/to/2nd_config_directory?
Permissions for the 2nd_config_directory are ok? |
sorry am not getting
i gave the permissions to the both postfix instance can you please explain briefly |
You have set a directory for the second postfix where you put its configuration files?
Also just wondering, xx.xxx.162.96 and xx.xxx.162.12 are public IPs, no? You own both? |
first and second both postfix directory is located in /etc/
[root@QVM730 etc]# cd /etc/ [root@QVM730 etc]# ls acpi dhcp gss magic pear.conf rc.local sudoers adjtime DIR_COLORS host.conf mailcap php.d rdma sudoers.d aliases DIR_COLORS.256color hostname mail.rc php.ini redhat-release sudo-ldap.conf aliases.db DIR_COLORS.lightbgcolor hosts makedumpfile.conf.sample phpMyAdmin resolv.conf sysconfig alternatives dnsmasq.conf hosts.allow man_db.conf php-tcpdf rpc sysctl.conf anacrontab dnsmasq.d hosts.deny mime.types pkcs11 rpm sysctl.d audisp dovecot httpd mke2fs.conf pki rsyslog.conf systemd audit dracut.conf init.d modprobe.d plymouth rsyslog.d system-release avahi dracut.conf.d inittab modules-load.d pm rwtab system-release-cpe bash_completion.d e2fsck.conf inputrc motd polkit-1 rwtab.d tcsd.conf bashrc environment iproute2 mtab popt.d sasl2 terminfo binfmt.d ethertypes issue my.cnf postfix screenrc tmpfiles.d centos-release exports issue.net my.cnf.d postfix-xx.xx.xx.12 securetty tuned centos-release-upstream favicon.png kdump.conf nanorc ppp security udev chkconfig.d filesystems kernel NetworkManager prelink.conf.d selinux vconsole.conf cron.d firewalld krb5.conf networks printcap sensu vimrc cron.daily fonts ld.so.cache nsswitch.conf profile services virc cron.deny fstab ld.so.conf nsswitch.conf.bak profile.d sestatus.conf wgetrc cron.hourly gcrypt ld.so.conf.d ntp protocols shadow wpa_supplicant cron.monthly gnupg libaudit.conf ntp.conf python shadow- X11 crontab GREP_COLORS libnl odbcinst.ini rc0.d shells xdg cron.weekly groff libuser.conf openldap rc1.d skel xinetd.conf crypttab group locale.conf opt rc2.d snmp xinetd.d csh.cshrc group- localtime os-release rc3.d ssh yum csh.login grub2.cfg login.defs pam.d rc4.d ssl yum.conf dbus-1 grub.d logrotate.conf passwd rc5.d statetab yum.repos.d default gshadow logrotate.d passwd- rc6.d statetab.d depmod.d gshadow- machine-id pear rc.d sudo.conf this ip address my own ...this ip address configured in my network [root@QVM730 ~]# hostname -I xx.xx.xx.96 xx.xx.xx.12 xx.xx.xx.84 [root@QVM730 ~]# /sbin/ifconfig eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.96 netmask 255.255.255.0 broadcast xx.xx.xx.255 inet6 fe80::5052:4ff:fe00:1103 prefixlen 64 scopeid 0x20<link> ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) RX packets 259273 bytes 19961183 (19.0 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 59893 bytes 9729447 (9.2 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.12 netmask 255.255.255.0 broadcast xx.xx.xx.255 ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) eth0:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet xx.xx.xx.84 netmask 255.255.255.0 broadcast xx.xx.xx.255 ether 52:52:04:00:11:03 txqueuelen 1000 (Ethernet) lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 0 (Local Loopback) RX packets 79 bytes 5573 (5.4 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 79 bytes 5573 (5.4 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 |
Maybe you should hide/mask your public ips (and mail addresses) on a forum, especially if running mail servers, we never know
So the postfix configuration directory for the 2nd server is /etc/postfix-xx.xxx.162.12 How did you start the 2nd server, like this? postfix -c /etc/postfix-xx.xxx.162.12 |
Thanks for your suggestions keefaz
when i install the postfix by using yum install postfix then its automatically postfix directory created in /etc/postfix and next i changed the some information in main.cf and master.cf like this myhostname = host.xxxxxxx.com mydomain = xxxxx.com myorigin = $mydomain inet_interfaces = xxxxxx.com mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = xx.xx.xx.96/28, 127.0.0.0/8 in master.cf xx.xx.xx.96:2525 inet n - n - - smtpd after that cp -rp /etc/postfix /etc/postfix-xx.xx.xx.12 then another one folder(postfix-xx.xx.xx.12) are created in /etc then i changed information in main.cf and master.cf postfix -c /etc/postfix2 reload |
But /etc/postfix2 exists?
Did you try: postfix -c /etc/postfix-xx.xx.xx.12 Also did you try disabling the firewall just the time to test telnet info.x.x 2525 |
EDIT: sorry, I [Newbie] didn't see all the new posts when I wrote this,
so this may ALL be irrelevant. Quote:
(yet it responds to port 25) (try telnet ...12 25) **I don't know postfix, so I don't know how master.cf works. There also MIGHT be a basic netmask issue: (again, I'm not sure) ifconfig says 255.255.255.0 which is not /28 (in postfix configS) Post netstat -rn; netstat -nlp | grep 25 In addition to the [extreme] debugging technique of strace, I'm wondering if there is a way to 'trace' the relevant net pkts... (I assume all the telnet cmds are being run on the [postfix server] host itself...) |
netstat -nlp | grep 25
tcp 0 0 xx.xx.xx.96:25 0.0.0.0:* LISTEN 6557/master unix 2 [ ACC ] STREAM LISTENING 12562 1/systemd /var/run/dbus/system_bus_socket [root@I ~]# netstat -rn Kernel IP routing table Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 xx.xx.xx.1 0.0.0.0 UG 0 0 0 eth0 xx.xx.xx.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 |
Now, nothing appears to be listening on 2525!
Check ( with ps -ax) to see that the second is running. Then use strace -p ... to see what it's doing. Can you try running *only* the second one (without the 1st running) & telnet to it (both 25 and 2525)... (I'm not sure how to tell if the netmask might be a problem; hopefully another LQ'er can comment on this. i.e., is the mynetworks.../28 ok? Also, shouldn't the 1st's master.cf have 25, not 2525?) By any chance, did you actually want/need all three eth0 to be /28? |
@Jjanel, you're right on network mask, xx.xx.xx.96/28 excludes xx.xx.xx.96 from the IPs range, but next setting 127.0.0.0/8 allows it from local
|
@Jjanel
i was run the second instance with port 25 and 2525 still in telnet its shows connection refused in second instance(main.cf) my entry is mynetworks = xx.xx.xx.12/28, 127.0.0.0/8 is this correct? |
guys
both postfix instance working fine here is the status postfix/postfix-script: the Postfix mail system is running: PID: 10860 postfix-xx.xx.xx.12/postfix-script: the Postfix mail system is running: PID: 10943 i think this is port issues because in netstat -nlp| grep 25 its showing only one ip address port i.e first ip address second one is not showing can you please tell me how to enable the port on selective ip address |
It's in master.cf file in /etc/postfix-xx.xx.xx.12
<IP>:<Port Number> Could you change mynetworks in main.cf in /etc/postfix-xx.xx.xx.12 and keep only local subnet, just to test mynetworks = 127.0.0.0/8 |
i assigned the mynetworks = 127.0.0.0/8 in main.cf in /etc/postfix-xx.xx.xx.12
but still its doent showing anything [root@I ~]# netstat -nlp | grep 25 tcp 0 0 xx.xx.xx.96:25 0.0.0.0:* LISTEN 11923/master unix 2 [ ACC ] STREAM LISTENING 12562 1/systemd /var/run/dbus/system_bus_socket [root@I ~]# telnet info.xxxxx.in 25 Trying xx.xx.xx.12... telnet: connect to address xx.xx.xx.12: Connection refused how to restart the second postfix instance? service postfix restart ..it will applied for only default postfix |
you can always start it manually (without service command)
# postfix -c /etc/postfix-xx.xx.xx.12 |
postfix -c /etc/postfix-xx.xx.xx.12
postfix-xx.xx.xx.12/postfix-script: error: unknown command: '' postfix-xx.xx.xx.12/postfix-script: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration) |
mmh, maybe: postfix -c /etc/postfix-xx.xx.xx.12 start
|
postfix -c /etc/postfix-xx.xx.xx.12 start
postfix-xx.xx.xx.12/postfix-script: fatal: the Postfix mail system is already running |
I thought you could get away with it, but no. I think you need to use the postmulti command to manage multiple postfix instances,
details are on the link I put on second post http://www.postfix.org/MULTI_INSTANCE_README.html |
All times are GMT -5. The time now is 04:38 AM. |