[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New to list + SMTP authentication when sending email




On 22/07/10 02:48 PM, Schmiechen wrote:
According to (RFC 4409 I think)  a email sent from a domain other than the
business own true domain is now technically spam.

Currently the design intent of Ledgersmb is to support multiple businesses in
its DB hence one install of code supports several different businesses.
Each business has a unique DB different from the ledgersmb admin Db. Each
business has a "defaults table". Mail prefs should be stored there.

There is one user apache on the linux system running ledgersmb and sending
mail.
Each company using the ledgersmb system has a unique website/mail solution
that is not in the same domain or network as the Ledgersmb server.

Most businesses have dedicated mail servers they rent or maintain themselves.
It is more practical security to have the accounting server in the office and
not share with the mail server in a data canter.
Also some mail providers flag mail from DSL lines as spam.

I think to send out the most professional looking invoices and such Ledgersmb
should act as a email client, and have the option send mail to a smtp host on
port 587.  That way each business can send from there own email server.

The patch we are talking about is really small, I tried this in Mailer.pm:

    if ( ${LedgerSMB::Sysconfig::smtphost} ) {
         if ( ${LedgerSMB::Sysconfig::smtpauthmethod} ){
             $smtp = Net::SMTP::TLS->new( ${LedgerSMB::Sysconfig::smtphost},
                 ${LedgerSMB::Sysconfig::smtpport},
                 ${LedgerSMB::Sysconfig::smtpuser},
                 ${LedgerSMB::Sysconfig::smtppass});
             $smtp->mail($self->{from});
             $smtp->to($self->{to});
             $smtp->cc($self->{cc});
             $smtp->bcc($self->{bcc});

             $smtp->data();
             $smtp->datasend( $msg->as_string() );
             $smtp->dataend();
             $smtp->quit;

             return $!;
/end code

Net::SMTP::TLS does not have the auth function that Ryans patch was using.
I am not sure what "Net::SMTP::TLS->" should point to.
It seems like the option is new.
Assuming you have installed Net::SMTP::TLS from cpan.

Thanks for all the comments.

Cheers
Turtle

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Ledger-smb-devel mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-devel

I have done some testing with Net::SMTP::TLS with code very similar to above. I have liked the results.

The constructor for Net::SMTP::TLS has the parameter NoTLS which I set to true when the SMTP server does not have TLS but still has authentication. Authentication works for the one email account I have that doesn't require TLS. According to the documentation "CRAM-MD5 will be used if available, followed by LOGIN, followed by PLAIN" (please see the CPAN documentation for Net::SMTP::TLS for the full description under "TLS and AUTHentication").

Would this be sufficient going forward? Again, I have liked the results and as said it is a small patch that should be very maintainable.


Ryan MacFarlane