[ale] Sendnig attachments via Net::SMTP

Chris Fowler cfowler at outpostsentinel.com
Mon Jun 7 16:34:21 EDT 2010


Normally I generate certificate requests using openssl and mail it to
the person requesting it.  I've been working on a simple program to send
the key and the cert as attachments via email.  I have a slight problem.
I see in debug mode of Net::SMTP that I am sending those files but when
we receive them they show up as being 0 bytes, empty.  I'm sure that I'm
not creating the mime types correctly.  The email does show and
attachment but nothing is in those attachments!!!

Enter email address to send CSR: k4fh at k4fh.com
Net::SMTP>>> Net::SMTP(2.29)
Net::SMTP>>>   Net::Cmd(2.26)
Net::SMTP>>>     Exporter(5.58)
Net::SMTP>>>   IO::Socket::INET(1.29)
Net::SMTP>>>     IO::Socket(1.29)
Net::SMTP>>>       IO::Handle(1.25)
Net::SMTP=GLOB(0x955a430)<<< 220 msmailsux.com Microsoft ESMTP MAIL
Service ready at Mon, 7 Jun 2010 16:30:12 -0400
Net::SMTP=GLOB(0x955a430)>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x955a430)<<< 250-XXXXX Hello [A.B.C.D]
Net::SMTP=GLOB(0x955a430)<<< 250-SIZE 30965760
Net::SMTP=GLOB(0x955a430)<<< 250-PIPELINING
Net::SMTP=GLOB(0x955a430)<<< 250-DSN
Net::SMTP=GLOB(0x955a430)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x955a430)<<< 250-STARTTLS
Net::SMTP=GLOB(0x955a430)<<< 250-X-ANONYMOUSTLS
Net::SMTP=GLOB(0x955a430)<<< 250-AUTH NTLM
Net::SMTP=GLOB(0x955a430)<<< 250-X-EXPS GSSAPI NTLM
Net::SMTP=GLOB(0x955a430)<<< 250-8BITMIME
Net::SMTP=GLOB(0x955a430)<<< 250-BINARYMIME
Net::SMTP=GLOB(0x955a430)<<< 250-CHUNKING
Net::SMTP=GLOB(0x955a430)<<< 250-XEXCH50
Net::SMTP=GLOB(0x955a430)<<< 250 XRDST
Net::SMTP=GLOB(0x955a430)>>> MAIL FROM:<blah at blah.com>
Net::SMTP=GLOB(0x955a430)<<< 250 2.1.0 Sender OK
Net::SMTP=GLOB(0x955a430)>>> RCPT TO:<k4fh at k4fh.com>
Net::SMTP=GLOB(0x955a430)<<< 250 2.1.5 Recipient OK
Net::SMTP=GLOB(0x955a430)>>> DATA
Net::SMTP=GLOB(0x955a430)<<< 354 Start mail input; end with
<CRLF>.<CRLF>
Net::SMTP=GLOB(0x955a430)>>> To: k4fh at k4fh.com
Net::SMTP=GLOB(0x955a430)>>> From: SAM Admin <blah at blah.com>
Net::SMTP=GLOB(0x955a430)>>> Subject: CSR request.
Net::SMTP=GLOB(0x955a430)>>> MIME-Version: 1.0
Net::SMTP=GLOB(0x955a430)>>> Content-type: multipart/mixed; 
Net::SMTP=GLOB(0x955a430)>>>    boundary="request"
Net::SMTP=GLOB(0x955a430)>>> --request
Net::SMTP=GLOB(0x955a430)>>> Content-type: text/plain
Net::SMTP=GLOB(0x955a430)>>> Content-Disposition: quoted-printable
Net::SMTP=GLOB(0x955a430)>>> Certificate Data:
Net::SMTP=GLOB(0x955a430)>>>  C=US
Net::SMTP=GLOB(0x955a430)>>>  ST=X
Net::SMTP=GLOB(0x955a430)>>>  L=X
Net::SMTP=GLOB(0x955a430)>>>  O=X
Net::SMTP=GLOB(0x955a430)>>>  OU=Support
Net::SMTP=GLOB(0x955a430)>>>
CN=localhost.localdomain.com/emailAddress=blah at blah.com
Net::SMTP=GLOB(0x955a430)>>> Certificate and private key have been
copied to dir.
Net::SMTP=GLOB(0x955a430)>>> Certication request and private key
attached.
Net::SMTP=GLOB(0x955a430)>>> --request
Net::SMTP=GLOB(0x955a430)>>> Content-Type: application/text;
name="certificate.req"
Net::SMTP=GLOB(0x955a430)>>> Content-Disposition: attachment;
filename="certificate.req"
Net::SMTP=GLOB(0x955a430)>>> -----BEGIN CERTIFICATE REQUEST-----
Net::SMTP=GLOB(0x955a430)>>>
MIIB/DCCAWUCAQAwgbsxCzAJBgNVBAYTAlVTMRQwEgYDVQQIEwtNYXNhY2h1ZXR0
Net::SMTP=GLOB(0x955a430)>>>
+fKauvJGL4TOC4M9qva8w/OOxM9uXjReeLliRgmhjF2iF99kR
Net::SMTP=GLOB(0x955a430)>>>
KmUJPz3phAuHl0JDQoLoTifbDoPsqwIDAQABoAAwDQYJKoZIhvcNAQEEBQADgYEA
Net::SMTP=GLOB(0x955a430)>>>
LkEB28TAQsJY4bCDbLmQ2Xg5HxX031tk17ODsAyfjoAprJAsv71zEhoMx58Us6Jk
Net::SMTP=GLOB(0x955a430)>>> Hw85yDEuV
+M0Yawd0fL51w9YHqNQqvhUplfKveqmMD1ZmVsZIc19aBPvNJ0slP4X
Net::SMTP=GLOB(0x955a430)>>> yuhbAlE747jpLYZXnH0Dq3qDGT8TI+mko
+sw0sN2aaE=
Net::SMTP=GLOB(0x955a430)>>> -----END CERTIFICATE REQUEST-----
Net::SMTP=GLOB(0x955a430)>>> --request
Net::SMTP=GLOB(0x955a430)>>> Content-Type: application/text;
name="key.rsa"
Net::SMTP=GLOB(0x955a430)>>> Content-Disposition: attachment;
filename="key.rsa"
Net::SMTP=GLOB(0x955a430)>>> -----BEGIN RSA PRIVATE KEY-----
Net::SMTP=GLOB(0x955a430)>>>
MIICXQIBAAKBgQDd8bn3o88b6XalFSSL0X7NX76rhrMTVdkHuAvzNXMCQ2FHnceu
Net::SMTP=GLOB(0x955a430)>>> mlxiY81U+9+YeAtPHlDUjjjsvFYePpS4E9rhr7m/3ZE
+fKauvJGL4TOC4M9qva8w

Net::SMTP=GLOB(0x955a430)>>> OiRddqWGF836pu
+NU7teP82nTVKh8psJohy664r1zpzyPbQXYvkYP/7W+tkCQQCi
Net::SMTP=GLOB(0x955a430)>>> NDoRMzGGEHDTePH2xRn5vOgRzSx1di7IXANg7R2q
+uWQZeKY4ILI5eWgblC4blZr
Net::SMTP=GLOB(0x955a430)>>>
5hsyTSdcn7irkhy9YSoJAkARXNJysXXnlV0DV9052B9m/rKX6CDwNIRJzvXLqi+p
Net::SMTP=GLOB(0x955a430)>>> 6rLh7oBobfvub
+/YUKWliJbyBMG0iGkWSWgZ9pjt9vK7
Net::SMTP=GLOB(0x955a430)>>> -----END RSA PRIVATE KEY-----
Net::SMTP=GLOB(0x955a430)>>> --request
Net::SMTP=GLOB(0x955a430)>>> .
Net::SMTP=GLOB(0x955a430)<<< 250 2.6.0
<dcdcee8c-7988-4a55-9839-9fbc58ef8d37 at XXXXXXXXXXXXxx> Queued mail for
delivery
Net::SMTP=GLOB(0x955a430)>>> QUIT
Net::SMTP=GLOB(0x955a430)<<< 221 2.0.0 Service closing transmission
channel






More information about the Ale mailing list