$ echo $LANG
fr_FR.UTF-8虽然发送方名称中可能有重音,但mail似乎不接受收件人名称中的重音:
mail -s "Test" -r "Denis Bitouzé " "Denis Bitouze " < /dev/null OK,返回(从法语盲翻译):mail: Message content empty; hopes it's correctmail -s "Test" -r "Denis Bitouzé " "Denis Bitouzé " < /dev/null不确定,返回(从法语盲翻译):mail: Impossible to parse the address « Denis Bitouzé » (when expanding « Denis Bitouzé ») : Wrong address syntaxmail收件人名称是否可能包含重音?
发布于 2020-02-12 14:57:13
是的,这是可以发送电子邮件给收件人与重音字符。但是:
Support来自两个发送邮件服务器,接收邮件服务器 and所有在它们之间路由邮件的<#>MUST服务器都支持UTF8 8.
从下面使用gMail发送带有重音字符的电子邮件的测试来看,这意味着gMail具有所需的UTF8支持(即使他们不允许我创建带有重音字符的邮件帐户)来路由此类邮件。
我以前使用Postfix 2.2版本测试了向邮件地址中带有重音字符的收件人发送邮件的情况。不是出于选择,而是因为它是我的邮件服务器的RHEL7回购中最后支持的版本。在向这些帐户发送邮件的所有测试失败后,我在后缀自述中进行了一些挖掘,发现:
...Introduced的Postfix版本3.0,这完全支持UTF-8电子邮件地址和UTF-8消息头值。
因此,对非英语字符的支持在很大程度上似乎是SMTP应用程序本身对该句子的支持。因此,我编写了一个RHEL8AWSVM,并在其上配置了Postfix版本3.3.1,以测试UTF8支持。
我配置了一个电子邮件帐户"tèrrence@test.com“,并从一个gMail帐户发送邮件给它。
您将从发送到该帐户的邮件的标题中得到注释。(注:我在下面的输出中更改了电子邮件服务器、发件人地址和收件人域的名称):
Return-Path:
X-Original-To: tèrrence@test.com
Delivered-To: tèrrence@test.com
Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.196; helo=mail-qk1-f196.google.com; envelope-from=testSender@gmail.com; receiver=
Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(No client certificate requested)
by mail.postfix3server.org (Postfix) with UTF8SMTPS id EA3BB1C226AE
for ; Thu, 12 Mar 2020 16:49:12 +0000 (GMT)
Received: by mail-qk1-f196.google.com with SMTP id p62so7358902qkb.0
for ; Thu, 12 Mar 2020 09:49:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20161025;
h=mime-version:from:date:message-id:subject:to;
bh=+sxzWGIhDj27WByaDTDqzH+gvh5YvxK7AK8RkDc6r3g=;
b=Blu+ cd
wgdA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=+sxz rwK
L7Uw==
X-Gm-Message-State: ANhLgQ2NC aBaUf
X-Google-Smtp-Source: ADFU+v KwMI=
X-Received: by 2002:ae9:dcc1:: with SMTP id q18 88368;
Thu, 12 Mar 2020 09:48:08 -0700 (PDT)
MIME-Version: 1.0
From: Terrence Houlahan
Date: Thu, 12 Mar 2020 16:47:31 +0000
Message-ID:
Subject: Test 1 sending accented characters
To: tèrrence@test.com
Content-Type: multipart/alternative; boundary="0000000000001927fa05a0ab1ec0"
--0000000000001927fa05a0ab1ec0
Content-Type: text/plain; charset="UTF-8"
.请注意上面的一行:
by mail.postfix3server.org (Postfix) with UTF8SMTPS来自接收邮件服务器上带有重音字符的地址的/var/log/maillog:
postfix/smtpd[xxxx]: Anonymous TLS connection established from mail-qk1-f196.google.com[209.85.222.196]: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
policyd-spf[xxxx]: prepend Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.196; helo=mail-qk1-f196.google.com; envelope-from=testSender@gmail.com; receiver=
postfix/smtpd[xxxx]: EA3BB1C226AE: client=mail-qk1-f196.google.com[209.85.222.196]
postfix/cleanup[xxxx]: EA3BB1C226AE: message-id=
mail postfix/qmgr[xxxx]: EA3BB1C226AE: from=, size=6579, nrcpt=1 (queue active)
postfix/virtual[xxxx]: EA3BB1C226AE: to=, relay=virtual, delay=0.32, delays=0.31/0.01/0/0, dsn=2.0.0, status=sent (delivered to maildir)
postfix/qmgr[xxxx]: EA3BB1C226AE: removed因此,您可以使用重音字符发送/接收邮件,但是SMTP服务器链中的条件是对邮件进行路由来解释邮件。我们看到gMAil可以做到这一点,配置正确的后缀服务器(版本3或更高版本)也可以这样做。不过,我的测试仅限于后缀,不能断言其他替代方案的UTF8兼容性。
https://unix.stackexchange.com/questions/567182
复制相似问题