lwc:linux:sympa

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
lwc:linux:sympa [2025/12/07 09:21] John Harrisonlwc:linux:sympa [2025/12/15 07:54] (current) John Harrison
Line 132: Line 132:
   - Site Level: ''/etc/sympa/mail_tt2/''   - Site Level: ''/etc/sympa/mail_tt2/''
   - Default: ''/usr/share/sympa/default/mail_tt2/'' (Lowest Priority)   - Default: ''/usr/share/sympa/default/mail_tt2/'' (Lowest Priority)
 +=== Cascaded Templates for messages sent to the list ===
 +  * have 2 footers, one plaintext (''message.footer'') and one html (''message.footer.mime'')
  
-To customize a template for one specific list, copy the default file into that list's folder and edit it there.+  - List Level: ''/etc/sympa/list_configs/[list_name]/message.footer.mime'' 
 +  - Robot/Domain Level: ''/etc/sympa/lists.lawrencemakers.org/message.footer.mime'' 
 +  - Site/Global Level: /''etc/sympa/message.footer.mime'' 
 +  - Default: ''/usr/share/sympa/default/message.footer.mime''
  
 ==== Unsubscribe Header ==== ==== Unsubscribe Header ====
Line 196: Line 201:
 === Workaround === === Workaround ===
 //yes I know this is a terrible workaround but couldn't figure out anything better// //yes I know this is a terrible workaround but couldn't figure out anything better//
-  * Edit Sympa's ''/usr/share/sympa/lib/Sympa/Mailer.pm'' to use noreply instead of null. In the file:+  * Edit Sympa's ''/usr/share/sympa/lib/Sympa/Mailer.pm'' to use ''no-reply@'' instead of null. In the file:
 <code> <code>
 #change #change
Line 206: Line 211:
 <code> <code>
 #!/bin/bash #!/bin/bash
- 
-#TODO: THIS SHOULD BE CHECKING MD5 INSTEAD OF FILESIZE WHAT WAS I THINKING??? 
  
 FILE="/usr/share/sympa/lib/Sympa/Mailer.pm" FILE="/usr/share/sympa/lib/Sympa/Mailer.pm"
-TARGET_SIZE=FILE_SIZE_OF_Mailer.pm+TARGET_MD5="<PUT MD5 HERE>" 
  
 # Check if the file exists # Check if the file exists
Line 216: Line 220:
     /usr/bin/echo "Error: File '$FILE' not found."     /usr/bin/echo "Error: File '$FILE' not found."
     /usr/bin/logger -t checkMailer "Error: File '$FILE' not found."     /usr/bin/logger -t checkMailer "Error: File '$FILE' not found."
-    /usr/bin/swaks --to ADMIN_EMAIL --h-Subject "checkMailer: FILE NOT FOUND" --body "Error: File '$FILE' not found." --server localhost+    /usr/bin/swaks --from FROM_ADDR --to TO_ADDR --h-Subject "checkMailer: FILE NOT FOUND" --body "Error: File '$FILE' not found." --server localhost
  
     exit 1     exit 1
 fi fi
  
-# Get the size of the file in bytes +# Get the md5 of the file 
-FILE_SIZE=$(/usr/bin/wc -c < "$FILE")+MD5=$(md5sum /usr/share/sympa/lib/Sympa/Mailer.pm | awk {'print $1'})
  
-# Compare the file size to the target size +# Compare the md5 to the target 
-if [ "$FILE_SIZE-eq "$TARGET_SIZE" ]; then +if [ "$MD5== "$TARGET_MD5" ]; then 
-    /usr/bin/echo "INFO: target size for $FILE correct." +    /usr/bin/echo "INFO: md5 for $FILE matches target." 
-    /usr/bin/logger -t checkMailer "INFO: target size for $FILE correct." +    /usr/bin/logger -t checkMailer "INFO: md5 for $FILE matches target." 
-    /usr/bin/swaks --to ADMIN_EMAIL --h-Subject "checkMailer: file size correct" --body "Good news: the file size is correct" --server localhost+    /usr/bin/swaks --from FROM_ADDR --to TO_ADDR --h-Subject "checkMailer: md5 matches" --body "Good news: the md5 of $FILE has not changed" --server localhost
 else else
-    /usr/bin/echo "WARNING: target size for $FILE INCORRECT." +    /usr/bin/echo "WARNING: md5 for $FILE does NOT match target." 
-    /usr/bin/logger -t checkMailer "WARNING: target size for $FILE INCORRECT." +    /usr/bin/logger -t checkMailer "WARNING: md5 for $FILE does NOT match target." 
-    /usr/bin/swaks --to ADMIN_EMAIL --h-Subject "checkMailer: file size INCORRECT" --body "Bad news: the file size is INCORRECT" --server localhost+    /usr/bin/swaks --from FROM_ADDR --to TO_ADDR --h-Subject "checkMailer: md5 does NOT match" --body "Bad news: the md5 of $FILE changed. Update null sender now." --server localhost
 fi fi
 +
 </code> </code>
   * ''chmod 755'' and set up a daily cron for the script   * ''chmod 755'' and set up a daily cron for the script
Line 247: Line 252:
   * It's a good idea to set the domain up with [[https://postmaster.google.com/|Google Postmaster Tools]] for some analytics sending to gmail addresses if you ever need it   * It's a good idea to set the domain up with [[https://postmaster.google.com/|Google Postmaster Tools]] for some analytics sending to gmail addresses if you ever need it
   * There's a list template which sets the defaults for new lists when they are created. It's possible to override with a new template. I did not look further into this.   * There's a list template which sets the defaults for new lists when they are created. It's possible to override with a new template. I did not look further into this.
 +  * completely removing a list needs to happen from the CLI: ''sudo /usr/lib/sympa/bin/sympa.pl --purge_list=LISTNAME@SUBDOMAIN_OF_WEB_UI''
 +  * From [[https://www.sympa.community/manual/customize/basics-templates.html|the documentation]]: "By default, text body of mail template (except attached part described in above) is wrapped. X-Sympa-NoWrap pseudo-header field prevents line wrapping."
  • lwc/linux/sympa.1765120888.txt.gz
  • Last modified: 2025/12/07 09:21
  • by John Harrison