1

I have Chef-server 12 installed on CentOS 6.6. When I want to remind me a password for user on page https://ip/password-reset/new I don't get any mail and in exim logs I see

2016-04-27 14:52:17 1avQp7-0001iP-0U <= <> R=1avQp6-0001iO-Om U=exim P=local S=1611
2016-04-27 14:52:17 1avQp7-0001iP-0U => opscode <opscode@non_resorvable_fqdn> R=localuser T=local_delivery
2016-04-27 14:52:17 1avQp7-0001iP-0U Completed
2016-04-27 14:53:23 Start queue run: pid=6616
2016-04-27 14:53:23 End queue run: pid=6616

but when I send mail with xmail everything is fine

2016-04-27 14:45:05 1avQi9-0001g2-DL <= user@non_resorvable_fqdn U=ec2-user P=local S=611
2016-04-27 14:45:05 1avQi9-0001g2-DL gmail-smtp-in.l.google.com [2a00:1450:4013:c00::1a] Network is unreachable
2016-04-27 14:45:08 1avQi9-0001g2-DL => user2@gmail.com R=dnslookup T=remote_smtp H=gmail-smtp-in.l.google.com [173.194.65.27] X=UNKNOWN:ECDHE-RSA-AES128-GCM-SHA256:128
2016-04-27 14:45:08 1avQi9-0001g2-DL Completed
2016-04-27 14:49:44 1avQme-0001hE-4B <= <> R=1avQme-0001hD-2t U=exim P=local S=1611
2016-04-27 14:49:44 1avQme-0001hE-4B => opscode <opscode@non_resorvable_fqdn> R=localuser T=local_delivery
2016-04-27 14:49:44 1avQme-0001hE-4B Completed

And I got this mail

2 Answers2

1

Check your chef logs and MTA (exim, postfix, etc) logs and config. In my case, after instaling chef-manage, on Web UI after clicking "reset password" in log /var/log/chef-manage/web/current I found:

[date] INFO -- :   Rendered password_reset_mailer/password_reset.text.erb (1.2ms)
[date] sh: 1: /usr/sbin/sendmail: not found

I installed postfix, and now mails are sent as they should. So I think that in your case exim is problem.

Jack
  • 875
  • 7
  • 9
  • Thanks I installed postfix and switched off SELinux and it's working fine, I Have to find appropriate selinux boolean. (I also had to switch off exim) – MAXIDAVIDPL Jul 05 '16 at 12:14
1

Chef uses the sendmail -t argument when sending mails. This option is interpreted differently accross various implementations of sendmail.

From the exim man page:

-t

When Exim is receiving a locally-generated, non-SMTP message on its standard input, the -t option causes the recipients of the message to be obtained from the To:, Cc:, and Bcc: header lines in the message instead of from the command arguments. The addresses are extracted before any rewriting takes place and the Bcc: header line, if present, is then removed.

If the command has any arguments, they specify addresses to which the message is not to be delivered. That is, the argument addresses are removed from the recipients list obtained from the headers. This is compatible with Smail 3 and in accordance with the documented behaviour of several versions of Sendmail, as described in man pages on a number of operating systems (e.g. Solaris 8, IRIX 6.5, HP-UX 11). However, some versions of Sendmail add argument addresses to those obtained from the headers, and the O'Reilly Sendmail book documents it that way. Exim can be made to add argument addresses instead of subtracting them by setting the option extract_addresses_remove_arguments false.

So to make exim work with Chef server, you add:

extract_addresses_remove_arguments = false

to the main/02_exim4-config_options section of your exim configuration

If you’ve chosen the option to use a single configuration file, your configuration is in:

/etc/exim4/exim4.conf.template (on debian systems)

Then just restart exim and it should work.

See also: https://github.com/mikel/mail/issues/70

Cédric
  • 41
  • 3