File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
ansible/roles/postfix/templates/services Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,20 @@ ORIGINAL_SUBJECT=$(echo "$EMAIL" | mhdr -h subject -)
3333LIST_ID=$( echo " $EMAIL " | mhdr -h list-id -)
3434if [ " $LIST_ID " != " " ]; then
3535 # We don't reply to all mailing list posts.
36- SHOULD_REPLY=$( awk ' BEGIN { srand(); print rand() <= 0.25 }' )
36+ SHOULD_REPLY=$( awk ' BEGIN { srand(); print rand() <= 0.75 }' )
3737 if [ " $SHOULD_REPLY " = " 0" ]; then
3838 echo " fredrick: don't feel like replying to mailing list post (\" $ORIGINAL_SUBJECT \" )."
3939 exit 0
4040 fi
41+
42+ # If we're replying to a mailing list, the recipient should actually be the list address
43+ RECIPIENT=$( echo " $EMAIL " | maddr -a -h x-original-to -)
44+
45+ # If we couldn't find the original recipient, abort here
46+ if [ " $RECIPIENT " = " " ]; then
47+ echo " fredrick: couldn't determine original recipient for mailing list post (\" $ORIGINAL_SUBJECT \" )."
48+ exit 0
49+ fi
4150fi
4251
4352# Construct the reply subject
You can’t perform that action at this time.
0 commit comments