** Description changed:

  Ubuntu 24.04.3 LTS
  apticron version: 1.2.8
  
- There is currently a bug in apticron causes emails that are send to be
- rejected by the mail server, instead of reaching the intended recipient,
- when using bsd-mailx.
+ There is currently a bug in apticron that causes emails to be rejected
+ by certain mail servers, instead of reaching the intended recipient.
+ 
+ This happens when the MTA is bsd-mailx.
  
  Currently, the code in the Mailx() function in apticron behaves like
- this: if neither hierloom-mailx nor s-nail, it falls back to bsd-mailx.
+ this: if the MTA is neither hierloom-mailx nor s-nail, it falls back to
+ bsd-mailx.
  
  The issue is that the code that follows (when bsd-mailx is used)
- configures CUSTOM_FROM with a -a.
+ configures CUSTOM_FROM with the option -a.
  
- Instead, the code should use -r, as per the following snippet.
- This is confirmed to work properly.
+ Instead, the code should use the proper option, -r, as per the following
+ snippet (the change affects only one line).
  
+ This is tested and confirmed to work properly.
  
  Here is the existing code:
  
-     # bsd-mailx/mailutils' mailx don't do character set                       
                                                        
-     # conversion, but do not support MIME either.                             
                                                        
-                                                                               
                                                        
-     if [ -n "$CUSTOM_FROM" ] ; then                                           
                                                        
-       /usr/bin/mailx \                                                        
                                                        
-         -a "MIME-Version: 1.0" \                                              
                                                        
-         -a "Content-type: text/plain; charset=UTF-8" \                        
                                                        
-         -a "Content-transfer-encoding: 8bit" \                                
                                                        
-         -a "From: $CUSTOM_FROM" \
-         "$@" < "$MAIL_BODY_FILE"                                              
                                                        
-     else                                                                      
                                                        
-       /usr/bin/mailx -a "MIME-Version: 1.0" \                                 
                                                        
-         -a "Content-type: text/plain; charset=UTF-8" \                        
                                                        
-         -a "Content-transfer-encoding: 8bit" \                                
                                                        
-         "$@" < "$MAIL_BODY_FILE"                                              
                                                        
-     fi 
+     # bsd-mailx/mailutils' mailx don't do character set
+     # conversion, but do not support MIME either.
  
+     if [ -n "$CUSTOM_FROM" ] ; then
+       /usr/bin/mailx \
+         -a "MIME-Version: 1.0" \
+         -a "Content-type: text/plain; charset=UTF-8" \
+         -a "Content-transfer-encoding: 8bit" \
+         -a "From: $CUSTOM_FROM" \
+         "$@" < "$MAIL_BODY_FILE"
+     else
+       /usr/bin/mailx -a "MIME-Version: 1.0" \
+         -a "Content-type: text/plain; charset=UTF-8" \
+         -a "Content-transfer-encoding: 8bit" \
+         "$@" < "$MAIL_BODY_FILE"
+     fi
  
  And here is the fixed code:
  
-     # bsd-mailx/mailutils' mailx don't do character set                       
                                                        
-     # conversion, but do not support MIME either.                             
                                                        
-                                                                               
                                                        
-     if [ -n "$CUSTOM_FROM" ] ; then                                           
                                                        
-       /usr/bin/mailx \                                                        
                                                        
-         -a "MIME-Version: 1.0" \                                              
                                                        
-         -a "Content-type: text/plain; charset=UTF-8" \                        
                                                        
-         -a "Content-transfer-encoding: 8bit" \                                
                                                        
-         -r "$CUSTOM_FROM" \                                                   
                                                        
-         "$@" < "$MAIL_BODY_FILE"                                              
                                                        
-     else                                                                      
                                                        
-       /usr/bin/mailx -a "MIME-Version: 1.0" \                                 
                                                        
-         -a "Content-type: text/plain; charset=UTF-8" \                        
                                                        
-         -a "Content-transfer-encoding: 8bit" \                                
                                                        
-         "$@" < "$MAIL_BODY_FILE"                                              
                                                        
-     fi
+     # bsd-mailx/mailutils' mailx don't do character set
+     # conversion, but do not support MIME either.
+ 
+     if [ -n "$CUSTOM_FROM" ] ; then
+       /usr/bin/mailx \
+         -a "MIME-Version: 1.0" \
+         -a "Content-type: text/plain; charset=UTF-8" \
+         -a "Content-transfer-encoding: 8bit" \
+         -r "$CUSTOM_FROM" \
+         "$@" < "$MAIL_BODY_FILE"
+     else
+       /usr/bin/mailx -a "MIME-Version: 1.0" \
+         -a "Content-type: text/plain; charset=UTF-8" \
+         -a "Content-transfer-encoding: 8bit" \
+         "$@" < "$MAIL_BODY_FILE"
+     fi
+ 
+ Please make sure that this gets fixed, and goes to upstream Debian as
+ well.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2122365

Title:
  Must use -r for mailx when CUSTOM_FROM is configured

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apticron/+bug/2122365/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to