-2

After changing the Postfix default port from 25 to 26 (MySQL uses port 25), I can now send out mail from my box. But I can't get mail in. My mail.log shows the sent mail making it out just fine, but shows nothing coming in...and I've replied to each of the outgoing mails.
I'm new to this and have no idea what needs to be shown to receive help here. Please tell me what I need to provide and I'll promptly post it. Thank you.

A portion of mail.cf:

myhostname = mydomain.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = mydomain.com, localhost.com, , localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all

And a portion of mail.log:

Jun 30 22:34:28 mydomain postfix/pickup[11158]: 4E9511A3378: uid=0 from=<root>
Jun 30 22:34:28 mydomain postfix/cleanup[11202]: 4E9511A3378: message-id=<20150701023428.4E9511A3378@mydomain.com>
Jun 30 22:34:28 mydomain postfix/qmgr[11159]: 4E9511A3378: from=<root@mydomain.com>, size=393, nrcpt=1 (queue active)
Jun 30 22:34:28 mydomain postfix/smtp[11204]: 4E9511A3378: to=<roven@some.com>, relay=mx01.gmx.net[212.227.17.4]:25, delay=0.61, delays=0.01/0/0.3/0.3, dsn=2.0.0, status=sent (250 Requested mail action okay, completed$
Jun 30 22:34:28 mydomain postfix/qmgr[11159]: 4E9511A3378: removed
Jun 30 22:37:32 mydomain postfix/pickup[11158]: 88E971A3378: uid=0 from=<root>
Jun 30 22:37:32 mydomain postfix/cleanup[11211]: 88E971A3378: message-id=<20150701023732.88E971A3378@mydomain.com>
Jun 30 22:37:32 mydomain postfix/qmgr[11159]: 88E971A3378: from=<root@mydomain.com>, size=328, nrcpt=2 (queue active)
Jun 30 22:37:32 mydomain postfix/smtp[11213]: connect to dfwit.co[2604:180::d873:9679]:25: Connection refused
Jun 30 22:37:33 mydomain postfix/smtp[11213]: 88E971A3378: to=<admin@dfwit.co>, relay=dfwit.co[167.88.120.164]:25, delay=0.75, delays=0.01/0/0.51/0.23, dsn=2.0.0, status=sent (250 2.0.0 Ok: queued as 27FAC26C2AA7)
Jun 30 22:37:34 mydomain postfix/smtp[11214]: 88E971A3378: to=<someone@mail.com>, relay=mx01.gmx.com[74.208.5.27]:25, delay=2.1, delays=0.01/0.01/0.47/1.6, dsn=2.0.0, status=sent (250 Requested mail action okay, co$
Jun 30 22:37:34 mydomain postfix/qmgr[11159]: 88E971A3378: removed
Jun 30 22:41:57 mydomain postfix/pickup[11158]: B0C351A3378: uid=1010 from=<admin>
Jun 30 22:41:57 mydomain postfix/cleanup[11241]: B0C351A3378: message-id=<20150701024157.B0C351A3378@mydomain.com>
Jun 30 22:41:57 mydomain postfix/qmgr[11159]: B0C351A3378: from=<admin@mydomain.com>, size=293, nrcpt=1 (queue active)
Jun 30 22:42:00 mydomain postfix/smtp[11243]: B0C351A3378: to=<someone@mail.com>, relay=mx01.gmx.com[74.208.5.27]:25, delay=2.5, delays=0.01/0/0.62/1.9, dsn=2.0.0, status=sent (250 Requested mail action okay, compl$
Jun 30 22:42:00 mydomain postfix/qmgr[11159]: B0C351A3378: removed

I changed the port back to 25 in /etc/postfix/master.cf I then sent out an e-mail. This what the mail.log shows now:

Jul  1 01:05:46 underworld postfix/master[11846]: fatal: bind 0.0.0.0 port 25: Address already$
Jul  1 01:05:56 underworld dovecot: master: Warning: Killed with signal 15 (by pid=11873 uid=0$
Jul  1 01:05:56 underworld dovecot: master: Dovecot v2.1.7 starting up (core dumps disabled)

And then I have this to offer:

root@underworld:~# netstat -tulpn4
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1964/sshd      
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      4148/sendmail: MTA:
tcp        0      0 127.0.0.1:953           0.0.0.0:*               LISTEN      1857/named     
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      2645/smbd      
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      11878/dovecot  
tcp        0      0 0.0.0.0:8067            0.0.0.0:*               LISTEN      2748/ircd      
tcp        0      0 0.0.0.0:6697            0.0.0.0:*               LISTEN      2748/ircd      
tcp        0      0 185.34.216.166:7050     0.0.0.0:*               LISTEN      9126/eggdrop   
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      2451/mysqld    
tcp        0      0 127.0.0.1:587           0.0.0.0:*               LISTEN      4148/sendmail: MTA:
tcp        0      0 0.0.0.0:6667            0.0.0.0:*               LISTEN      2748/ircd      
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      2645/smbd      
tcp        0      0 185.34.216.166:6668     0.0.0.0:*               LISTEN      8880/eggdrop   
tcp        0      0 185.34.216.166:6669     0.0.0.0:*               LISTEN      2728/eggdrop   
tcp        0      0 0.0.0.0:143             0.0.0.0:*               LISTEN      11878/dovecot  
tcp        0      0 185.34.216.166:32277    0.0.0.0:*               LISTEN      9676/eggdrop   
tcp        0      0 81.4.108.50:53          0.0.0.0:*               LISTEN      1857/named     
tcp        0      0 185.34.216.166:53       0.0.0.0:*               LISTEN      1857/named     
tcp        0      0 127.0.0.2:53            0.0.0.0:*               LISTEN      1857/named     
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      1857/named     
udp        0      0 0.0.0.0:44637           0.0.0.0:*                           8880/eggdrop   
udp        0      0 0.0.0.0:56956           0.0.0.0:*                                                     

Is sendmail suppose to be disabled now that I'm using Postfix and Dovecot?

Okay, I tried to remove sendmail:

root@underworld:~# apt-get remove sendmail
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'sendmail' is not installed, so not removed

So if it isn't installed, why wld it be shown in the above post using port:25?


Updated: 07/01/2015

My mail.log shows:

Jul  1 17:24:30 underworld postfix/smtpd[13684]: connect from dfwit.co[167.88.120.164]
Jul  1 17:24:30 underworld postfix/smtpd[13684]: AF9D21A41EE: client=dfwit.co[167.88.120.164]
Jul  1 17:24:30 underworld postfix/cleanup[13679]: AF9D21A41EE: message-id=<55945A82.9090905@dfwit.co>
Jul  1 17:24:30 underworld postfix/qmgr[12253]: AF9D21A41EE: from=<ceo@dfwit.co>, size=969, nrcpt=1 (queue active)
Jul  1 17:24:30 underworld postfix/smtpd[13684]: disconnect from dfwit.co[167.88.120.164]
Jul  1 17:24:30 underworld postfix/local[13687]: AF9D21A41EE: to=<root@underworld.chat>, relay=local, delay=0.11, delays=0.1/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")
Jul  1 17:24:30 underworld postfix/qmgr[12253]: AF9D21A41EE: removed
Jul  1 17:27:51 underworld postfix/anvil[13686]: statistics: max connection rate 1/60s for (smtp:167.88.120.164) at Jul  1 17:24:30
Jul  1 17:27:51 underworld postfix/anvil[13686]: statistics: max connection count 1 for (smtp:167.88.120.164) at Jul  1 17:24:30
Jul  1 17:27:51 underworld postfix/anvil[13686]: statistics: max cache size 1 at Jul  1 17:24:30

To me, this seems to show I have mail. But I have absolutely no idea how to view it.

fmc
  • 103
  • 4

2 Answers2

2

Of course you can't get mail in. You don't have a mail server listening on port 25! Servers trying to deliver you mail are getting a MySQL server instead of a mail server.

Restore both services to the correct ports.

Michael Hampton
  • 237,123
  • 42
  • 477
  • 940
  • I didnt set MySQL to port 25. It was done by default when i installed it. That said, I have no idea how to change it to another port. – fmc Jul 01 '15 at 04:33
  • Okay, I found where I'm suppose to edit the /etc/my.cnf file. But that file's not there. I logged in to MySQL with no issues though. Isn't that the file I edit to change the MySQL port back to 3306? – fmc Jul 01 '15 at 04:47
  • 1
    Why do you say that MySQL is running on port 25, then? That is certainly not the default and no distribution does that. – Michael Hampton Jul 01 '15 at 04:58
  • Please see my initial post, now edited with more information. Thank you. – fmc Jul 01 '15 at 05:16
  • It looks like you forgot to remove sendmail when you installed postfix. – Michael Hampton Jul 01 '15 at 05:18
  • Please see my initial post, now edited with more information. Thank you again, Michael. – fmc Jul 01 '15 at 06:00
  • I guess this just isn't meant to be. I'm back to being able to send only...still can't receive anything. Thanks for your help, Michael. – fmc Jul 01 '15 at 06:23
1

There is so called "Well Known Ports" assigned to the services supposed to be available to everyone. If you want others to have access to your service you have to be compliant with port assignment. There is no standard mechanisms to inform others that you have moved MTA to another port. They'll try port 25 and nothing else.

Sure, if you want to set up infrastructure for private use only, you cat move services to any port you want. You know where the service resides now and can link sofwares in the proper way. Often some services are moved to the different ports for security reasons. Say, sshd can be moved to port 12345 instead of 22 because there is a lot of brute-force tools that flood this service with requests. As far as service port is nonstandard/unknown, brute-forcers can't flood it.

But if you want to build public service like receiving postfix, you have to use standard ports.

Kondybas
  • 6,864
  • 2
  • 19
  • 24
  • In my initial post, I made a mistake: MySQL wasn't using port 25; sendmail was. My bad. I corrected my mistake. But the thing is, I still cant receive mail. I can send it out fine. No problems. But nothing comes back in when i reply to the sent mails. Maybe I'm doing it wrong. All I know to do is type 'mail' and enter, and it tells me I have no mail for root...or any other acct I might be in trying to receive sent mail replies to. root@underworld:~# mail No mail for root – fmc Jul 01 '15 at 21:33
  • I've updated my initial post with the tail-end of my mail.log – fmc Jul 02 '15 at 00:26
  • Saved by Alpine! – fmc Jul 02 '15 at 10:05