Cannot form correctly the FORM part of the header when sending mail

A

alex23

Missing "nss-config-dir" variable.
. . . message not sent.
Missing "nss-config-dir" variable.
. . . message not sent.
Missing "nss-config-dir" variable.
. . . message not sent.
Missing "nss-config-dir" variable.
. . . message not sent.
Missing "nss-config-dir" variable.
. . . message not sent.
Missing "nss-config-dir" variable.
. . . message not sent.

is what iam receivign as error output

You haven't set the configuration value 'nss-config-dir'.

You're welcome.
 
P

Piet van Oostrum

Nikos, if you can't use the smtp server at mail.superhost.gr, or if that
has the same restrictions I may have a solution for you. This is a bit
off-topic on the Python list/group, s I will throw in a line of Python
code to make it on-topic :)

I suppose you have the following reasons to want to have the original
email address in the message: (1) so that you can see who sent the
message, (2) so that you can reply to the original sender.
Let's say that the from address was (e-mail address removed)

Problem 1 can be solved in two ways:
(a) Just put the email address in front of the subject line, like:

Subject: (From (e-mail address removed)) Original subject line

(b) This solution is a bit more tricky.
- Get a separate email address that you use for these messages, like
(e-mail address removed). Register this as one of your email addresses in
gmail. For this it must be a real email address that belongs to you,
not a fake address. When it is registered with gmail, gmail will not
change it if found in a From header. Make sure that Thunderbird DOES
NOT KNOW that this email address belongs to you (i.e. don't use this
email address for normal work). Gmail will send you a message to this
address to verify that it belongs to you so you must access it through
some other means, like a web interface.

- Now in the generated email you put the original sender in the comment
and your new email address as the real address like:

From: "(e-mail address removed)" <[email protected]>

Because Thunderbird doesn't know (e-mail address removed) it will display the
other one, (e-mail address removed). Make sure that the email address doesn't
contain a quote character. Better still check that only legal characters
are used.

Problem 2 can easily be solved by adding a Reply-To header with the
original from address. Gmail will not change this.

So the code becomes something like:

MESSAGE = "From: \"{0}\" <[email protected]>\r\n" "Reply-To: {0}\r\n" "To: {1}\r\n" "Subject: (From {0}) {2}\r\n\r\n{3}\r\n".format(FROM, TO, SUBJECT, MESSAGE)

In my opinion a better solution would be to filter your mesaage through
procmail or similar on your receiving computer. For example put the from
address in an X-From header and let the filter replace the From header
with the address from the X-From.
 
F

Ferrous Cranus

Στις 6/9/2013 7:48 πμ, ο/η Piet van Oostrum έγÏαψε:
hotmail.com. Register this as one of your email addresses in
gmail. For this it must be a real email address that belongs to you,
not a fake address. When it is registered with gmail, gmail will not
change it if found in a From header.

Hello Piet,

I'am not sure what you mean by registering a mail address with GMail.
Do you mean to add more that one mail account addresses within my GMail
account?

If you mean that i must tell you that in the pop settinsg inside my
gmail.com account i use (e-mail address removed) and (e-mail address removed) as
other sending nad retrival mail accounts.

Is this what you mean?

So the code becomes something like:
MESSAGE = "From: \"{0}\" <[email protected]>\r\n" "Reply-To: {0}\r\n" "To: {1}\r\n" "Subject: (From {0}) {2}\r\n\r\n{3}\r\n".format(FROM, TO, SUBJECT, MESSAGE)

If you mean the above then i just have tried, but still not mail gets send.


MESSAGE = "From: \"{0}\" <[email protected]>\r\n" "Reply-To:
{0}\r\n" "To: {1}\r\n" "Subject: (From {0}) {2}\r\n\r\n{3}\r\n".format(
FROM, TO, SUBJECT, MESSAGE )
MESSAGE = MESSAGE.encode('utf-8')

# open Gmail's SMTP server
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()

# next, log in to the server
server.login("(e-mail address removed)", "my_password")


Please elaborate further, thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,102
Messages
2,570,645
Members
47,245
Latest member
ShannonEat

Latest Threads

Top