| Both sides previous revision Previous revision Next revision | Previous revision |
| lwc:linux:sympa [2025/12/05 11:41] – John Harrison | lwc:linux:sympa [2025/12/15 07:54] (current) – John Harrison |
|---|
| - 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 ==== |
| * ''Admin'' -> ''Edit List Config'' -> ''DKIM/DMARC/ARC'' | * ''Admin'' -> ''Edit List Config'' -> ''DKIM/DMARC/ARC'' |
| * ''New From name format (phrase)'' -> set to ''Name'' | * ''New From name format (phrase)'' -> set to ''Name'' |
| | * consider increasing max message size: |
| | * ''Admin'' -> ''Edit List Config'' -> ''Sending/Receiving Setup'' |
| | * ''Maximum message size (max_size)(default)'' -> ''20971520'' |
| | * allow subscribers to view who is subscribed: |
| | * ''Who can review subscribers (review)'' -> ''Restricted to subscribers (private)'' |
| | * create a list template to change the defaults for a new list: |
| | <code> |
| | # make a home for the new default override |
| | sudo mkdir -p /etc/sympa/create_list_templates |
| | # copy from the original default |
| | sudo cp -r /usr/share/sympa/default/create_list_templates/discussion_list /etc/sympa/create_list_templates/ |
| | # edit to your heart's content: |
| | sudo emacs -nw /etc/sympa/create_list_templates/discussion_list/config.tt2 |
| | </code> |
| |
| ==== Prettying it up ==== | ==== Prettying it up ==== |
| </code> | </code> |
| |
| | ==== Null Sender ==== |
| | === Defining the problem === |
| | * Sympa uses null sender (<>) when sending automated administrative messages like "post rejected: you aren't a member of the list" |
| | * Amazon SES rejects null sender on SMTP relay (all my testing confirmed this and their AI FAQ thingie says this as well) |
| | * Sending direct (skipping Amazon SES relay) fails too at least for gmail, who blocks null sender from my server address and accepts other addresses from the same server IP |
| | * I tried many many attempts to get Postfix to replace the null sender with noreply@ and after hours of this gave up |
| | === Workaround === |
| | //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 ''no-reply@'' instead of null. In the file: |
| | <code> |
| | #change |
| | ($return_path eq '<>' ? '' : $return_path), '--', @rcpt; |
| | #to |
| | ($return_path eq '<>' ? 'no-reply@SYMPA_SUBDOMAIN' : $return_path), '--', @rcpt; |
| | </code> |
| | * write a simple script to make sure you are notified if ''Mailer.pm'' ever gets updated: |
| | <code> |
| | #!/bin/bash |
| | |
| | FILE="/usr/share/sympa/lib/Sympa/Mailer.pm" |
| | TARGET_MD5="<PUT MD5 HERE>" |
| | |
| | |
| | # Check if the file exists |
| | if [ ! -f "$FILE" ]; then |
| | /usr/bin/echo "Error: File '$FILE' not found." |
| | /usr/bin/logger -t checkMailer "Error: File '$FILE' not found." |
| | /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 |
| | fi |
| | |
| | # Get the md5 of the file |
| | MD5=$(md5sum /usr/share/sympa/lib/Sympa/Mailer.pm | awk {'print $1'}) |
| | |
| | # Compare the md5 to the target |
| | if [ "$MD5" == "$TARGET_MD5" ]; then |
| | /usr/bin/echo "INFO: md5 for $FILE matches target." |
| | /usr/bin/logger -t checkMailer "INFO: md5 for $FILE matches target." |
| | /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 |
| | /usr/bin/echo "WARNING: md5 for $FILE does NOT match target." |
| | /usr/bin/logger -t checkMailer "WARNING: md5 for $FILE does NOT match target." |
| | /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 |
| | |
| | </code> |
| | * ''chmod 755'' and set up a daily cron for the script |
| | * set Sympa to dump any bounced emails to noreply@: |
| | * in ''/etc/sympa/aliases.sympa.postfix'' add ''no-reply: "|/bin/true"'' |
| | * ''sudo postalias /etc/sympa/aliases.sympa.postfix'' |
| | * ''sudo postfix reload'' |
| | === Oh wait but we aren't done: Admin email is passing Google DKIM but failing Outlook DKIM === |
| | Outlook is pretty unhappy with ''Content-Type: multipart/report''. To fix this: |
| | * change ''/etc/sympa/mail_tt2/delivery_status_notification.tt2'' from ''Content-Type: multipart/report'' to ''Content-Type: text/plain'' |
| | * //To make it look pretty, you will definitely want make some other changes to the template as well// |
| ==== Misc ==== | ==== Misc ==== |
| * 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." |