omeka / Omeka

A flexible web publishing platform for the display of library, museum and scholarly collections, archives and exhibitions.
http://omeka.org
GNU General Public License v3.0
472 stars 193 forks source link

Offer to set the option to sign an e-mail from whom #1026

Closed vovanshu closed 3 months ago

vovanshu commented 4 months ago

Offer for update GeneralSettings.php Added the option to sign an e-mail from whom. Offer for update UsersController.php Added a condition to use an email signature from who if the option is set.

The reason for this proposal was the problem of a broken signature of an e-mail from whom. Maybe it will be useful to someone, because it turned out to be necessary for us due to the fact that the name of the site cannot be shortened.

When using a long signature in Cyrillic from the site title.

msg1

When using a short signature from a custom field.

msg2

When using a long signature in Latin from the site title.

msg3

zerocrates commented 4 months ago

We've seen an error before that's similar to this but not quite the same.

Can you try a different change for me, keeping your site's original, longer name:

https://github.com/omeka/Omeka/commit/ccd001f85d14b9b1c13e96cdb8f963aabdf6f9b8

This changes the newlines used in longer header values like your problematic From header, and may resolve this problem.

vovanshu commented 4 months ago

I tried the way you suggested to solve our problem, with the signature of the e-mail from whom. But unfortunately, the problem remained, most of all the problem is related to the use of Cyrillic and the long title of the site. PS: Previously I restored the original code without my changes.

screenshot4

screenshot5

zerocrates commented 3 months ago

OK, thank you for trying that.

So, three things:

First, there's already a feature in Omeka that I think will suit your needs: in the file application/config/config.ini there are two settings you can set, mail.force_from and mail.force_from_name. If you set mail.force_from to your desired "From" address and mail.force_from_name to your desired "From" name, that name and address will be used for all outgoing mail. So you should be able to change the problematic From header without having to edit the code like this.

Second, can you paste here in the issue as plain text the exact site name you're using that's causing this problem? I want to try to reproduce the problem, and it will be much easier for me to just copy the Cyrillic than to re-type it.

Third, if you might check: does anything change if you exclude the periods from your site name (that is, "І П" instead of "І.П.")?

vovanshu commented 3 months ago

Thanks for the answer and discussion! I first tried the mail.force_from_name parameter in the file application/config/config.ini. But I did not see the need to use mail.force_from and there was no result. I set all parameters and it works correctly.

When using settings from the site title

1) Електронна бібліотека ПОУНБ ім. І.П. Котляревського 2) Електронна бібліотека ПОУНБ ім ІП Котляревського

When using settings in the file application/config/config.ini

3) Poltava RUSL 4) Полтавська ОУНБ 5) Абвгд ...(does not matter)... 6) Електронна бібліотека ПОУНБ ім. І.П. Котляревського (sending failed) 7) Електронна бібліотека ПОУНБ ім ІП Котляревського

06e1e887-ced1-4c22-a8fd-78201299431a

zerocrates commented 3 months ago

Good to hear that mail.force_from/mail.force_from_name are working for you. I think we'll probably keep with that rather than your change here then.

On your tests with different names: just to make sure I'm reading right,

It looks like neither 1 or 2 worked, 3, 4 and 5 are fine, and it looks like 7 worked also?