jskywalker Posted October 2, 2010 Share Posted October 2, 2010 i'm trying to filter some messages using procmail when a message contains: 'Out: 401', i want to move it to a folder named 401 when a message contains: 'Out: 403', i want to move it to a folder named 403 etc.. Now i can make lines for every code possible (401, 403, ....., 450, 454) But instead i'd like to maken 1 rule for 4xx and have the foldername based on the found code... To achieve this, i tried to define a variable which should get the found errorcode VAR=`formail -I "" | expand | sed -e 's/.*\(Out: \)\(4..\).*/\2/' -e '/^4/!d' | head -1` :0 B * ^Subject:.*errors .folderwitherrors.${VAR}/ My question is, can above be done in a simpler way ? (and, if YES, how to do it.....) Quote Link to comment https://forums.phpfreaks.com/topic/214976-procmail/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.