3

I have many forks from smtpd in my process list on my webserver. What does this mean?

Is my mailbox full?

   postfix   2662  0.0  0.9 106336  4856 ?        S    17:37   0:00 smtpd -n 
   smtp -t inet -u -c -o stress yes
   postfix   2800  0.0  0.9 106336  4860 ?        S    15:59   0:00 smtpd -n 
   smtp -t inet -u -c -o stress yes
   postfix   3644  0.0  0.9 106336  4864 ?        S    13:47   0:00 smtpd -n 
   smtp -t inet -u -c -o stress 
   postfix   3732  0.0  0.9 106336  4872 ?        S    14:36   0:00 smtpd -n 
   smtp -t inet -u -c -o stress yes
   postfix   3835  0.0  0.9 106336  4868 ?        S    14:36   0:00 smtpd -n 
   smtp -t inet -u -c -o stress yes
   postfix   4309  0.0  0.9 106336  4864 ?        S    13:48   0:00 smtpd 
   -n smtp -t inet -u -c -o stress 
   postfix   4603  0.0  0.9 106336  4860 ?        S    16:13   0:00 smtpd -n 
   smtp -t inet -u -c -o stress yes
   postfix   4843  0.0  0.9 106336  4864 ?        S    13:49   0:00 smtpd -n 
   smtp -t inet -u -c -o stress 

I have plenty more of these lines in my process list. Output of pstree gives me:

 ├─master─┬─anvil
 │        ├─cleanup
 │        ├─pickup
 │        ├─proxymap
 │        ├─qmgr
 │        └─100*[smtpd]

Edit: Recently I've changed the mysql to listen from localhost to my extern ip. Now I'm getting this error in the mail log:

warning: connect to mysql server 127.0.0.1: Can't connect to MySQL server on   
'127.0.0.1' (111)
May 21 22:23:00 postfix/trivial-rewrite[15741]: fatal: mysql:/etc/postfix/mysql-   
virtual_mailbox_domains.cf(0,lock|fold_fix): table lookup problem
May 21 22:23:01  postfix/smtpd[31036]: warning: problem talking to service rewrite:    
Success
May 21 22:23:01  postfix/smtpd[30757]: warning: problem talking to service 
rewrite:     
Connection reset by peer

It's flooding my log and it's already >600MB. How can I change postfix to listen to my extern ip? I need to connect to mysql from my home location and not from localhost?

2
  • have you tried to look at them with pstree ? Do they come from the same father process ?
    – Coren
    May 21, 2012 at 18:51
  • @Coren: Master is the father? Is 100 too much?
    – Micromega
    May 21, 2012 at 19:04

2 Answers 2

4

smtpd is executed by Postfix to handle incoming mail (either locally, or remotely). If you have 100 running at a time, I suggest your server is handling a lot of mail. If you don't believe you're generating that much mail, it's possible your server is either receiving a lot of mail it bounces, or it's sending a lot of mail you're not aware of.

The default limit for the number of smtpd processes is 100, which you appear to be hitting all the time.

Check the postfix lots to work out what it's doing.

If these are legitimate connections, but you want fewer of them, you can use,

/etc/postfix/main.cf:
    default_process_limit = 10

to change the limit.

Your update shows the issue to be related to connections to MySQL. As well as the other answer, you could just fix MySQL to listen both on 127.0.0.1 and on the external IP address. It would be unusual to stop MySQL listening on local connections.

For MySQL, I would set the bind address to be 0.0.0.0 which forces it to listen on all interfaces, or just comment out the bind-address section in the config file (which achieves the same thing).

1
  • Thanks, I didn't know about listen to 0.0.0.0? Why is this unusually?
    – Micromega
    May 21, 2012 at 23:24
4

The error you quoted from the error log indicates that Postfix is unable to connect to the MySQL server on 127.0.0.1. This is because you told the MySQL server not to listen on 127.0.0.1. The high process count is probably due to repeated failed attempts to query MySQL for virtual-mailbox lookups.

You need to tell Postfix to try to connect to the MySQL server using the address MySQL is actually listening on. If your /etc/hosts file has an entry by hostname then use that. Otherwise use the IP address you configured MySQL to listen on.

Assuming that you have alias_maps = mysql:/etc/postfix/mysql-aliases.cf in Postfix's main.cf file, then you just need to update /etc/postfix/mysql-aliases.cf to say something like this:

hosts = a.b.c.d

Where a.b.c.d is the address you configured MySQL to listen on.

2
  • Yes, thank you. I already updated all my cf files in postix folder. I didn't know postfix is using mysql?
    – Micromega
    May 21, 2012 at 22:55
  • Well that's exactly what the log messages you gave tell us: May 21 22:23:00 postfix/trivial-rewrite[15741]: fatal: mysql:/etc/postfix/mysql- virtual_mailbox_domains.cf(0,lock|fold_fix): table lookup problem May 22, 2012 at 22:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .