Pear 邮件在 x 标头上添加换行符的问题

发布于 2024-11-01 08:14:24 字数 618 浏览 0 评论 0原文

我想知道这里是否有任何有 PEAR 邮件或 PEAR 邮件队列经验的人可以帮助我解决这个问题。

我正在使用 PEAR 创建批量邮件服务,并添加 X 标头来提供有关人们注册的地点和时间的信息。

所以我正在尝试创建一个与此类似的 X 标头:

X-Subscription: Subscribed on 2010/09/01, via web form, by 92.8.196.121 from http://mydomain.com/signup.htm

但是,在我将标头传递给 PEAR 邮件 mime 和队列之后,它们在某些点处使用换行符进行格式化,因此它们最终看起来像这样:

X-Subscription: Subscribed on 2010/09/01, via web form, by 92.8.196.121 from
     http://mydomain.com/signup.htm

我已经通过创建来测试了这一点一些不同的标题和换行符总是出现在一定数量的字符之后,但我似乎无法在 PEAR 中找到任何会导致这种情况的代码。

这里有人有这方面的经验吗?或者知道我可以解决这个问题的方法吗?

感谢您的关注

I was wondering if anyone here with experience of PEAR mail or PEAR mail queue could help me out with this.

I am working on creating a bulk mailing service using PEAR and am adding X-headers to give information on where and when people signed up.

So am am trying to create a X-header similar to this:

X-Subscription: Subscribed on 2010/09/01, via web form, by 92.8.196.121 from http://mydomain.com/signup.htm

However after I pass the headers to PEAR mail mime and queue they are formatted with a line break at certain points so they end up looking like this:

X-Subscription: Subscribed on 2010/09/01, via web form, by 92.8.196.121 from
     http://mydomain.com/signup.htm

I have tested this by creating a few different headers and the line break always comes after a certain amount of characters but I cannot seem to find any code in PEAR which would cause this.

Does anyone here have any experience of this? Or know of a way I could fix this?

Thanks for looking

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花开柳相依 2024-11-08 08:14:24

根据 RFC 822,将标头拆分为多行的“问题”是正确的行为,“3.1.1. 长标题字段”部分:

为了方便起见,这个概念的字段主体部分
实体可以拆分为多行表示;这
称为“折叠”。一般规则是,无论在哪里
可能是线性空白(不仅仅是 LWSP 字符)、CRLF
紧接着至少一个 LWSP-char 可以改为
已插入。

电子邮件主题长度限制是多少?中所述,RFC 2822 建议将行长度保持为 78。

The "issue" of headers being split onto multiple lines is correct behavior according to RFC 822, section "3.1.1. LONG HEADER FIELDS":

For convenience, the field-body portion of this conceptual
entity can be split into a multiple-line representation; this
is called "folding". The general rule is that wherever there
may be linear-white-space (NOT simply LWSP-chars), a CRLF
immediately followed by AT LEAST one LWSP-char may instead be
inserted.

As described in What is the email subject length limit?, RFC 2822 suggests to keep a line length of 78.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文