title: Why after delete some lines by sed, Postfix can't write maillog
body: <p>I want to use cron job, that once per three day will clean and sort maillog.</p>
  
  <p>My job looks like</p>
  
  <pre><code> /bin/sed -i /status=/!d /var/log/maillog | 
      (/bin/grep "status=bounced" /var/log/maillog | /bin/grep -E -o --color "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" | /bin/sort -u &gt;&gt; /root/unsent.log) | 
      (/bin/grep "status=deferred" /var/log/maillog | /bin/grep -E -o --color "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" | /bin/sort -u &gt;&gt; /root/deferred.log) | 
      (/bin/grep "status=sent" /var/log/maillog | /bin/grep -E -o --color "\b[a-zA-Z0-9.-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9.-]+\b" | /bin/sort -u &gt;&gt; /root/sent.log) | 
  /bin/sed -i "/status=/d" /var/log/maillog
  </code></pre>
  
  <p>Job works fine and do 3 step:</p>
  
  <ol>
  <li>Delete from maillog all lines that don't contain "status="</li>
  <li>Sort sent, bounced, deffered in different logs.</li>
  <li>Delete from maillog all lines that contain "status"</li>
  </ol>
  
  <p>After this job my maillog is fully clean and sorted to 3 logs.</p>
  
  <p>But Postfix doesn't want to write next records to maillog.</p>
  
  <p>I delete sed command, and Postfix writes next records fine.</p>
  
  <p>Why sed command blocks maillog after execution cron job?</p>