[plugin settings 0.2] : not RFC 2821 compliant

General discussion about Plugins for Cacti

Moderators: Developers, Moderators

Post Reply
YoannQ
Posts: 7
Joined: Sun Mar 12, 2006 7:10 pm

[plugin settings 0.2] : not RFC 2821 compliant

Post by YoannQ »

I have update plugins/settings/include/mailer.php file

RFC Compliant for EHLO/HELLO

Syntax : EHLO myhostname (not EHLO SMTPhostname)

Replace on line 716

Code: Select all

/* Start SMTP conversation */
                        fputs($smtp_sock, "HELO " . $this->Config["Mail"]["SMTP_Host"] . "\r\n");
with

Code: Select all

/* Start SMTP conversation */
                        fputs($smtp_sock, "HELO " . $_SERVER['SERVER_NAME']. "\r\n");
RFC Compliant for MAIL FROM

Syntax : MAIL FROM: <user@domain.tld> (not MAIL FROM: user@domain.tld)

Replace on line +/- 756

Code: Select all

/* Send mail from */
fputs($smtp_sock, "MAIL FROM: " . $from . "\r\n");
with :

Code: Select all

/* Send mail from */
fputs($smtp_sock, "MAIL FROM: <" . $from . ">\r\n");
RFC Compliant for RCPT TO

Syntax : RCPT TO: <user@domain.tld> (not RCPT TO: user@domain.tld)

Replace on line 764

Code: Select all

/* Send rcpt to */
foreach ($to as $item) {
fputs($smtp_sock, "RCPT TO: " . $item . "\r\n");
with

Code: Select all

/* Send rcpt to */
foreach ($to as $item) {
fputs($smtp_sock, "RCPT TO: <" . $item . ">\r\n");

This is my contribution for today. ;-)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Updated (with a slight modification) as Rev116 in SVN
Reinhard
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um....

I will have to review these issues.

FYI, the "<" & ">" will break the way the mailer class works.

Opps on the HELO line... That would be a bug on my part.. :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Um....

I will have to inspect and update... :)

"<" and ">" probably will not break it, unless the user puts in a formatted email.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
YoannQ
Posts: 7
Joined: Sun Mar 12, 2006 7:10 pm

Post by YoannQ »

Humggg ...

There a problem with EHLO command in my update when poller want send email.

in line 716

Code: Select all

/* Start SMTP conversation */
                        fputs($smtp_sock, "HELO " . $this->Config["Mail"]["SMTP_Host"] . "\r\n");
muste be replaced with

Code: Select all

/* Start SMTP conversation */
                        fputs($smtp_sock, "HELO " . $this->Config["Hostname"]. "\r\n");

In fact $_SERVER['SERVER_NAME'] not exist when php is running from cli.

Sorry.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Yes. That was exactly my simple deviation from your first sugesstion. So no harm done
Reinhard
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Yep,

When I wrote it, I was testing from the CLI. So, that was not an variable that could be used, hence it was not.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest