mailhog / mhsendmail

sendmail for MailHog
MIT License
253 stars 60 forks source link

silently ignore common sendmail flags (-t and -i) #11

Closed briceburg closed 8 years ago

briceburg commented 8 years ago

Applications by default may invoke sendmail with the -t and -i flags, behavior which mhsendmail supports out-of-box.

We've set mhsendmail as the default system mailer; e.g. in our php Dockerfiles

FROM php:5.6-alpine

...
## sendmail integration
ENV MH_SENDMAIL_SMTP_ADDR="smtp:1025"
RUN [ -e /usr/sbin/sendmail ] && mv /usr/sbin/sendmail /usr/sbin/sendmail.dist ; \
  curl -Lfo /usr/local/bin/mhsendmail \
    https://github.com/BlueAcornInc/mhsendmail/releases/download/v0.3.0-rc1/mhsendmail_linux_amd64 && \
  chmod +x /usr/local/bin/mhsendmail && \
  ln -s /usr/local/bin/mhsendmail /usr/sbin/sendmail

and can work around the issue by configuring the php sendmail path according to your documention. Instead of erroring if these flags are passed; do you think it makes sense to silently continue so we can skip the sendmail path configuration?

Many thanks

langemeijer commented 8 years ago

Commit above adds these flags. If you want to try before this pull request gets merged, you could use my fork. This -i -t change is the only change compared to the master in the original repository.

ian-kent commented 8 years ago

Thanks @briceburg, good suggestion, and thanks @langemeijer for implementing it :+1: