搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

How to retrieve or change the smtp server by command line?

  • 2 个回答
  • 4 人有此问题
  • 43 次查看
  • 最后回复者为 Elwoodb

more options

Imagine that 200 people in a company use Thunderbird. The SMTP server needs to be changed. So how is it possible to retrieve or change the smtp server by command line? So that we can update the smtp on every 200 account automatically.

Thanks.

Imagine that 200 people in a company use Thunderbird. The SMTP server needs to be changed. So how is it possible to retrieve or change the smtp server by command line? So that we can update the smtp on every 200 account automatically. Thanks.

被采纳的解决方案

I suggest you write a script to search prefs.js in the users' profiles for the relevant smtp server setting. You can then extract the internal numerical identifier and use that to locate the relevant settings.

e.g.

these are all the entries referring to the smtp server for my gmx account.

user_pref("mail.smtpserver.smtp21.authMethod", 3);
user_pref("mail.smtpserver.smtp21.description", "GMX SMTP");
user_pref("mail.smtpserver.smtp21.hostname", "mail.gmx.com");
user_pref("mail.smtpserver.smtp21.port", 465);
user_pref("mail.smtpserver.smtp21.try_ssl", 3);
user_pref("mail.smtpserver.smtp21.username", "???@gmx.co.uk");

I don't know what you wish to change. Grepping for the hostname and changing it in-situ is fairly easy; if you need to adjust other parameters, you'd also need to find all the relevant entries containing, in this example, "smtp21".

A few years ago I'd have done this in C; now I'd use Python. I suspect it could be done with grep, and most definitely with awk or sed, but I've never got to grips with them. ;-)

If you're changing authorization or security options, you'll need to do the homework to understand the relevance of the numerical arguments.

Please ensure Thunderbird is closed down whilst doing this, else it is likely to overwrite your changes.

定位到答案原位置 👍 1

所有回复 (2)

more options

选择的解决方案

I suggest you write a script to search prefs.js in the users' profiles for the relevant smtp server setting. You can then extract the internal numerical identifier and use that to locate the relevant settings.

e.g.

these are all the entries referring to the smtp server for my gmx account.

user_pref("mail.smtpserver.smtp21.authMethod", 3);
user_pref("mail.smtpserver.smtp21.description", "GMX SMTP");
user_pref("mail.smtpserver.smtp21.hostname", "mail.gmx.com");
user_pref("mail.smtpserver.smtp21.port", 465);
user_pref("mail.smtpserver.smtp21.try_ssl", 3);
user_pref("mail.smtpserver.smtp21.username", "???@gmx.co.uk");

I don't know what you wish to change. Grepping for the hostname and changing it in-situ is fairly easy; if you need to adjust other parameters, you'd also need to find all the relevant entries containing, in this example, "smtp21".

A few years ago I'd have done this in C; now I'd use Python. I suspect it could be done with grep, and most definitely with awk or sed, but I've never got to grips with them. ;-)

If you're changing authorization or security options, you'll need to do the homework to understand the relevance of the numerical arguments.

Please ensure Thunderbird is closed down whilst doing this, else it is likely to overwrite your changes.

由Zenos于修改

more options

Many thanks Zenos. I overlooked this file. :-) I'll do a login script that will be executed before TB starts.