2012/9/5 Raphaël Berlamont <raphael.berlam...@raphux.com> > 2012/9/4 Thomas Sibley <t...@bestpractical.com> > >> Unrelated notes about your template below. >> >> Hmm. Can you wrap /usr/sbin/sendmail with a tiny shell script that >> tee's the input somewhere else and then passes it through to the real >> sendmail? >> >> mv -v /usr/sbin/sendmail{,.real} >> cat /usr/sbin/sendmail >> #!/bin/bash >> exec tee -a /tmp/sendmail-stdin | /usr/sbin/sendmail.real "$@" >> ^D >> chmod a+rx /usr/sbin/sendmail >> > > I've done the test 3 times, same result : logs appears in > "/var/log/maillog", and nothing in "/tmp/sendmail-stdin". I don't even > understand how can this be possible... >
I confirm this behaviour. I slightly modified the script : ############################################ [root@dgilx202 ~]# cat /usr/sbin/sendmail #!/bin/bash TMP_FILE="/tmp/sendmail-stdin" echo "=====NEW SENDMAIL CALL=======" >> "${TMP_FILE}" echo "`date +%Y%m%d-%H%M%S`" >> "${TMP_FILE}" echo "========MESSAGE BEGIN========" >> "${TMP_FILE}" exec tee -a "${TMP_FILE}" | /usr/sbin/sendmail.real "$@" echo "========MESSAGE ENDED========" >> "${TMP_FILE}" echo "`date +%Y%m%d-%H%M%S`" >> "${TMP_FILE}" echo "======END SENDMAIL CALL======" >> "${TMP_FILE}" [root@dgilx202 ~]# ############################################ And with a test, here is what I have in the log fie : ############################################ [root@dgilx202 ~]# tail -f /tmp/sendmail-stdin =====NEW SENDMAIL CALL======= 20120906-154906 ========MESSAGE BEGIN======== ========MESSAGE ENDED======== 20120906-154906 ======END SENDMAIL CALL====== ^C [root@dgilx202 ~]# ############################################ And in the maillog, this what I have : ############################################ Sep 6 15:49:06 dgilx202 postfix/smtpd[19149]: connect from unknown[10.223.2.22] Sep 6 15:49:06 dgilx202 postfix/smtpd[19149]: 3B22B23538: client=unknown[10.223.2.22] Sep 6 15:49:06 dgilx202 postfix/cleanup[19154]: 3B22B23538: message-id=< 4d44666f4f0b2248a2c57dd0af573f930ecd2...@pla122vs151.fr.myfirm.org> Sep 6 15:49:06 dgilx202 postfix/qmgr[1793]: 3B22B23538: from=< raphael.berlam...@myfirm.fr>, size=1803, nrcpt=1 (queue active) Sep 6 15:49:06 dgilx202 postfix/smtpd[19149]: disconnect from unknown[10.223.2.22] Sep 6 15:49:06 dgilx202 postfix/sendmail[19225]: fatal: rt-t...@myfirm.fr(48): No recipient addresses found in message header Sep 6 15:49:06 dgilx202 postfix/local[19155]: 3B22B23538: to=< rt-t...@rt.myfirm.com>, relay=local, delay=0.6, delays=0.02/0/0/0.58, dsn=2.0.0, status=sent (delivered to command: /opt/rt4/bin/rt-mailgate --queue 'Test Queue' --action correspond --url https://rt.myfirm.com) Sep 6 15:49:06 dgilx202 postfix/qmgr[1793]: 3B22B23538: removed ############################################ So I can now tell that sendmail IS called, but nothing is piped in, or it crashs before RT can pipe anything in it... Idea ? -- Raphaël Berlamont