Problem using perl script to send mail to XMail

View: New views
4 Messages — Rating Filter:   Alert me  

Problem using perl script to send mail to XMail

by fred-119 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hey guys,

 

I am having a small problem trying to send an email to XMail from a perl script, here is the code:

 

#!/usr/bin/perl -w

use Net::SMTP;

$smtp = Net::SMTP->new('smtp.mydomain.com', Hello => 'myserver.mydomain.com', Timeout => 60);

$smtp->mail(myserver\@mydomain.com');

$smtp->to('me\@mydomain.com');

$smtp->data();

$smtp->datasend("From: myserver\@mydomain.com\n");

$smtp->datasend("To: me\@mydomain.com\n");

$smtp->datasend("Subject: Test 1\n");

$smtp->datasend("\n");

$smtp->datasend("A simple test message\n");

$smtp->dataend();

$smtp->quit;

 

XMail refuses the email :

"mail"  "mail"  "myserverip"  "2009-08-24 13:31:08"   "myserver.mydomain.com" ""      "me\@mydomain.com"  ""      ""      "SNDR=ESYNTAX"      ""      "0"     ""

 

 

I understand that @ must be escaped, but how do we tell Perl to send the string without the \ ?

 

This might be a real noob problem, I don’t know anything about perl.

 

 

Thanks for help,

 

-fred


_______________________________________________
xmail mailing list
xmail@...
http://xmailserver.org/mailman/listinfo/xmail

Re: Problem using perl script to send mail to XMail

by Jonathan Kelly-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message



On Mon, Aug 24, 2009 at 1:35 PM, fred <fred@...> wrote:

Hey guys,

 

I am having a small problem trying to send an email to XMail from a perl script, here is the code:

 

#!/usr/bin/perl -w

use Net::SMTP;

$smtp = Net::SMTP->new('smtp.mydomain.com', Hello => 'myserver.mydomain.com', Timeout => 60);

$smtp->mail(myserver\@mydomain.com');

$smtp->to('me\@mydomain.com');

$smtp->data();

$smtp->datasend("From: myserver\@mydomain.com\n");

$smtp->datasend("To: me\@mydomain.com\n");

$smtp->datasend("Subject: Test 1\n");

$smtp->datasend("\n");

$smtp->datasend("A simple test message\n");

$smtp->dataend();

$smtp->quit;

 

XMail refuses the email :

"mail"  "mail"  "myserverip"  "2009-08-24 13:31:08"   "myserver.mydomain.com" ""      "me\@mydomain.com"  ""      ""      "SNDR=ESYNTAX"      ""      "0"     ""

 

 

I understand that @ must be escaped, but how do we tell Perl to send the string without the \ ?

 

This might be a real noob problem, I don’t know anything about perl.

 

 

Thanks for help,

 

-fred

My perl is rusty but it seems to me the @ doesn't need to be escaped b/c it's encapsulated in quotes.

_______________________________________________
xmail mailing list
xmail@...
http://xmailserver.org/mailman/listinfo/xmail

Re: Problem using perl script to send mail to XMail

by Davide Libenzi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Mon, 24 Aug 2009, fred wrote:

>
> Hey guys,
>
>  
>
> I am having a small problem trying to send an email to XMail from a perl script, here is the code:
>
>  
>
> #!/usr/bin/perl -w
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('smtp.mydomain.com', Hello => 'myserver.mydomain.com', Timeout => 60);
>
> $smtp->mail(myserver\@mydomain.com');
>
> $smtp->to('me\@mydomain.com');
Either this:

'blah@blah'

or this:

"blah\@blah"



- Davide


_______________________________________________
xmail mailing list
xmail@...
http://xmailserver.org/mailman/listinfo/xmail

Re: Problem using perl script to send mail to XMail

by fred-119 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks,

Changed the single quotes to doubles and it works fine with \@

-fred

-----Original Message-----
From: xmail-bounces@... [mailto:xmail-bounces@...]
On Behalf Of Davide Libenzi
Sent: 24 août 2009 13:59
To: XMail Users Mailing List
Subject: Re: [xmail] Problem using perl script to send mail to XMail

On Mon, 24 Aug 2009, fred wrote:

>
> Hey guys,
>
>  
>
> I am having a small problem trying to send an email to XMail from a perl
script, here is the code:
>
>  
>
> #!/usr/bin/perl -w
>
> use Net::SMTP;
>
> $smtp = Net::SMTP->new('smtp.mydomain.com', Hello =>
'myserver.mydomain.com', Timeout => 60);
>
> $smtp->mail(myserver\@mydomain.com');
>
> $smtp->to('me\@mydomain.com');

Either this:

'blah@blah'

or this:

"blah\@blah"



- Davide




_______________________________________________
xmail mailing list
xmail@...
http://xmailserver.org/mailman/listinfo/xmail