This feels like a sendmail problem, but I have a feeling that some part of fetchmail is duplicating some of sendmail's behavior, because when it happens, and I reboot fetchmail, it stops happening - until the next time.
I'm using fetchmail (6.3.17+GSS+RPA+NTLM+SDPS+SSL+HESIOD+NLS+KRB5) on CentOS 6.8 to grab mail from a few mailboxes and send them to an internal Exchange server. The fetchmail config file (with accounts and passwords removed is
set syslog set postmaster "email@example.com" set showdots set bouncemail set properties "" set invisible set no softbounce poll pop.host port 995 proto POP3 timeout 12 user "user1" there with password "..." is firstname.lastname@example.org here ssl sslproto TLS1 user "user2" there with password "..." is email@example.com here ssl sslproto TLS1
And our /etc/mail/mailertable says
So fetchmail usually delivers the mail it fetches from pop.host to the exchange server.
But every once in a while fetchmail starts trying to deliver the mail to local mailboxes (which don't exist). As I said at the top, restarting the fetchmail daemon fixes this, I'd expect restarting sendmail would be what was needed, but it isn't.
It logs lines like this in /var/log/maillog when that happens (I know this is out of sequence, but it looks like procmail logs its message, returns failure, and then fetchmail logs its message
Sep 11 03:50:39 mailer procmail: Unknown user "user1" Sep 11 03:50:39 mailer fetchmail: reading message firstname.lastname@example.org: 14 of 14 (348741 octets) (log message incomplete)
I'm really hoping that someone has seen this before, or if not, could tell me where the code is in the fetchmail source that hands mail it's fetched to sendmail so I could add some more log messages.