WIP: contrôle cotisation

This commit is contained in:
Adrien Bourmault 2022-09-14 23:47:02 +02:00
parent e34a370810
commit f73833b3e9
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>. # along with this program. If not, see <https://www.gnu.org/licenses/>.
import os, requests, json, datetime, shutil, quopri, subprocess import os, requests, json, datetime, shutil, quopri, subprocess, base64
from requests.auth import HTTPBasicAuth from requests.auth import HTTPBasicAuth
from requests.auth import HTTPDigestAuth from requests.auth import HTTPDigestAuth
@ -105,7 +105,7 @@ def sendmail_with_attachment(headers, data, attachment_header, attachment, endin
msg = bytes(headers + "\n", 'utf-8') \ msg = bytes(headers + "\n", 'utf-8') \
+ quopri.encodestring(bytes(data, 'utf-8')) \ + quopri.encodestring(bytes(data, 'utf-8')) \
+ bytes(attachment_header + "\n", 'utf-8') \ + bytes(attachment_header + "\n", 'utf-8') \
+ base64(attachment) \ + base64.b64encode(attachment) \
+ bytes(ending + "\n", 'utf-8') + bytes(ending + "\n", 'utf-8')
subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg) subprocess.run([SENDMAIL_LOCATION, "-t", "-oi"], input=msg)