diff --git a/src/sbbs3/readmail.cpp b/src/sbbs3/readmail.cpp
index 7533bff91f3234f5c3ca2a0184408f91520651cc..529ee4025046b33f676938e17096312ad2f7225a 100644
--- a/src/sbbs3/readmail.cpp
+++ b/src/sbbs3/readmail.cpp
@@ -71,6 +71,14 @@ void sbbs_t::readmail(uint usernumber, int which, long lm_mode)
 	smbmsg_t msg;
 	char search_str[128] = "";
 
+	if(which==MAIL_SENT)
+		act=NODE_RSML;
+	else if(which==MAIL_ALL)
+		act=NODE_SYSP;
+	else
+		act=NODE_RMAL;
+	action=act;
+
 	if(cfg.readmail_mod[0] && !readmail_inside) {
 		char cmdline[256];
 
@@ -119,13 +127,6 @@ void sbbs_t::readmail(uint usernumber, int which, long lm_mode)
 
 	last=smb.status.last_msg;
 
-	if(which==MAIL_SENT)
-		act=NODE_RSML;
-	else if(which==MAIL_ALL)
-		act=NODE_SYSP;
-	else
-		act=NODE_RMAL;
-	action=act;
 	const char* order = (lm_mode&LM_REVERSE) ? "newest" : "oldest";
 	if(smb.msgs>1 && which!=MAIL_ALL) {
 		if(which==MAIL_SENT)