Hi Philipp!
On 19/10/11 15:46, Philipp Hartwig wrote:
> msmtpq contains a test
> if [ -f "${FQP}.*" ] ; then # ensure fqp name is unique
> that is supposed to ensure that an existing queue file is not overwritten.
> However this combination of -f and globbing does not seem to work.
>
> $ cd /tmp
> $ touch foo
> $ if [ -f "foo" ]; then echo hi; fi
> hi
> $ if [ -f "foo*" ]; then echo hi; fi
> $
>
> This means that whenever a user sends more than one message per second only
> the last mail will survive.
>
> I've attached a possible fix but one might want to look into how to combine
> tests and globbing correctly.
Thanks for reporting this. You're right, one cannot use globbing in test
-f. One alternative would be to use find:
if test -n "`find . -maxdepth 1 -name "${FQP}*" -print -quit`"; then
echo "found"; fi
However, your patch looks correct for the msmtpq case and is cleaner and
less expensive.
Chris, ok to apply?
Martin
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Ciosco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
msmtp-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/msmtp-users