PowerProtect smtp_send.py genera l'errore: L'oggetto 'NoneType' non ha l'attributo 'encode'

Summary: PowerProtect Data Manager viene utilizzato per proteggere l'ambiente e "Support > Email Setup" è in fase di configurazione per ricevere notifiche e-mail.

This article applies to This article does not apply to This article is not tied to any specific product. Not all product versions are identified in this article.

Symptoms

L'e-mail di test Email Setup non riesce a indicare la convalida dei dettagli SMTP (Simple Mail Transfer Protocol).

Error
104: Sending the test email failed. Socket error : mailserver.mydomain.com
Verify the SMTP details and try again. 

PowerProtect Data Manager contiene /usr/local/brs/bin/smtp_send.py script per la risoluzione dei problemi relativi a SMTP. Lo script non viene eseguito e genera le seguenti informazioni:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -HOST mailserver.mydomain.com -FROM test_email_address@dell.com -PORT 25 -ARGS True -S "PowerProtect Data Manager test email" -C plain -R test_email_address@dell.com
Traceback (most recent call last):
  File "/usr/local/brs/bin/smtp_send.py", line 338, in <module>
    main()
  File "/usr/local/brs/bin/smtp_send.py", line 308, in main
    outer.attach(MIMEText(args.body, args.content_type))
  File "/usr/lib64/python3.4/email/mime/text.py", line 33, in {}init{}
    _text.encode('us-ascii')
AttributeError: 'NoneType' object has no attribute 'encode' 

Cause

La colonna smtp_send.py La guida mostra che tutti i comandi sono opzionali, ma la maggior parte di essi sono obbligatori:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -h

usage: smtp_send.py [-h] [-HOST MAILSERVER] [-PORT PORT] [-USER USERNAME]
                    [-PASS PASSWORD] [-FROM MAILFROM] [-ARGS USEARGS]
                    [-R RECIPIENTS [RECIPIENTS ...]] [-S SUBJECT]
                    [-C CONTENT_TYPE]
                    [-T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}]
                    [-p TIMEOUT] [--hide] [-F FILENAME | -B BODY]
optional arguments:
  -h, --help            show this help message and exit
  -HOST MAILSERVER      Mail server
  -PORT PORT            Mail port
  -USER USERNAME        Mail username
  -PASS PASSWORD        Mail password
  -FROM MAILFROM        Mail from
  -ARGS USEARGS         Use args
  -R RECIPIENTS [RECIPIENTS ...]
                        Mail recipients
  -S SUBJECT            Mail subject
  -C CONTENT_TYPE       Content Type
  -T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}
                        Message type
  -p TIMEOUT            Timeout in minutes
  --hide                hide to field from recipients
  -F FILENAME, --Files FILENAME
                        File to be attached
  -B BODY, --Body BODY  Message body

Resolution

Tutte le opzioni a cui si fa riferimento devono essere utilizzate durante l'utilizzo di smtp_send.py script invece di affidarsi al "help" Output del comando. Sintassi e output di esempio:

admin@my-ppdm:~> /usr/local/brs/bin/smtp_send.py -HOST mailserver.mydomain.com -FROM test_email_address@dell.com -PORT 25 -ARGS True -T MAIL_BODY_AS_ARGUMENT -S "PowerProtect Data Manager test email" -B "This is a test email from a PowerProtect Data Manager appliance" -C plain -R test_email_address@dell.com
2023-11-08 18:05:10.150515 INFO : Sending email with subject : PowerProtect Data Manager test email
2023-11-08 18:05:10.866943 INFO : sending mail
2023-11-08 18:05:11.071116 INFO : result: {}
admin@my-ppdm:~>

Additional Information

Argomenti obbligatori:
  -HOST MAILSERVER      Mail server
  -FROM MAILFROM        Mail from
  -ARGS USEARGS         Use args
  -R RECIPIENTS [RECIPIENTS ...]
                        Mail recipients
  -S SUBJECT            Mail subject
  -C CONTENT_TYPE       Content Type
  -T {MAIL_BODY_AS_ARGUMENT,MAIL_BODY_AS_ATTACHMENT,MAIL_BODY_FROM_FILE}
                        Message type
  -B BODY, --Body BODY  Message body
Argomenti opzionali:
  -h, --help            show this help message and exit
  -PORT PORT            Mail port
  -USER USERNAME        Mail username
  -PASS PASSWORD        Mail password
  -p TIMEOUT            Timeout in minutes
  --hide                hide to field from recipients
  -F FILENAME, --Files FILENAME
                        File to be attached
Article Properties
Article Number: 000219362
Article Type: Solution
Last Modified: 03 Dec 2025
Version:  3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.