I want my logs sent to my mail with logrotate
Solution 1:
try to replace prerotate
with firstaction
. this way your mail command will only be executed one time for all logs defined in a block.
this is the text from the man page:
firstaction/endscript
The lines between firstaction and endscript (both of which must appear on lines by themselves) are executed once before all log files that match the
wildcarded pattern are rotated, before prerotate script is run and only if at least one log will actually be rotated. These directives may only
appear inside a log file definition. If the script exits with error, no further processing is done. See also lastaction.