- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Hm... Actually I did my own mini-program to send e-mails in C. It would read the e-mail body, rcpt, mail origin, subject et al, and "talk" SMTP by doing plain old socket connection. As the other fellow, I too sent e-mails from telnetting to port 25 back in the old days just for fun.
Oh, how did I learn SMTP commands is something of a kicker ... thanks to the first versions of Eudora. It actually displays the actual commands it is sending when checking or sending email. (Incidentally, this opened the door also for the first generation of e-mail spoofers).
Oh, and muuuuch easier to do it yourself with this method than ... hm... Clickyes??? ow!!! It iis true about idiots getting better at it.
Admin
Er, whas Maxim's predecessor Wile E. Coyote, by any chance?
Admin
Admin
Admin
Avoiding the stupidities ourselves.
1) These WTFs are not due to esoteric minutiae. They are usually due to major cluelessness.
2) A lot of these stupidities happened because of a lack of proper communication. Flaming is one way to have the lack. Basic manners are surprisingly inexpensive and do have a positive payoff.
Sincerely,
Gene Wirchenko
Admin
And how on earth will you distinguish traffic from this IP address, MAC address, computer name and destination SMTP server generated by outlook or by some other application? Please explain me and I'll never ever say a word about networks and TCP/IP protocols...
And about your question: yes I worked with a number of routers and I believe I know how they work. I admit I never dealt with the huge CISCOs that enterprise companies use.
Admin
Hence the "Sincerely"?
I do admit, basic manners are very easy to use and it does make everyday interactions enjoyable. With bad manners, co-workers may shy away, deciding to "work out the solution" rather than asking for help from a rude co-worker, which would lead to many WTFs, ironically.
However, completely shielding someone from realizing that they are severely lacking in a skill area is detrimental to them. Sometimes a nice kick in the pants is warrented.
Have a nice day! :-P
Admin
In the scenario you are describing, you have Outlook <--> Exchange Server <--> Firewall <--> Internet. What happens in this setup is that Outlook communicates directly with the Exchange Server using a different communication protocol (not SMTP, I think it is X.500. I haven't been in Systems for a while so my memory may be failing.). The Exchange Server does the DNS lookup for the destination address, and if it is for a domain that it does not control it sends the email message out to the Internet via SMTP. Since the firewall sees that the SMTP traffic is originating from the Exchange server, it allows the traffic through.
I find it very helpful for programmers to have an understanding of networks, email servers, active directory, etc. It really does foster better communication between the developers and the systems guys who setup/maintain the servers and aides in debugging and often results in a better design.
Larrry
Admin
He propably found that but since he was using VB.NET that didn't help him...
Admin
'Some upstart'. Right. Look at his prior history (hint - Al Gore didn't invent the WWW) and quite what this little upstart's invention has done for society (for better or for worse).
Admin
CheckYes essentially merely clicks 'Yes'
CheckYes Pro mimics YES!!!!!
???
Admin
I did this in Cold Fusion (actually built right in) about 9 years ago, but have also seen it done in a trivial expect script
captcha: chocobot
Admin
Does System.Web.Mail just open a SMTP connection or does it implement a proper mail send queue? What if he wanted to keep a record of sent emails? What if he wanted to retry sending the emails if the SMTP server was temporarily unreachable. I recently configured /etc/init.d/sendmail locally to ensure that I had a proper mail queue rather than attempting to open a raw SMTP connection.
In some ways a standard mail client might be the better option. That said, I cannot think of a worse way to go about interfacing to it.
Admin
SMTP server shouldn't be unavailable if so then you may install a local copy of the MS SMTP server and make it forward the mails through the real SMTP server (and accept connections only from 127.0.0.1).
Keeping a copy of the sent mails is a real WTF on it's on as I said before - to keep some history of what was sent is much better to use a database rather than rely on other application. Also we're talking about a web application not a desktop, so please tell me how people will check what was sent - using remote desktop probably to log on to the serve?
On your question what does this class do - yes it sends the mail through raw smtp connection. You will get an exception if you can't send the mail for some reason (the SMTP server is unreachable, it rejected the sender or recipient etc). However the proper queue is something your server shoud care about and if there's a problem connecting to the server you may notify your user accordingly. Keeping a log (and eventually retrying later) doesn't sound to me like a lot of work...
Admin
Correction - I'm not sure what you understand under RAW smtp connection. System.Net.Mail doesn't allow you to communicate with the server sending commands like "EHLO" etc. You just set what the mail contents should be, specify SMTP server's address, port, etc. and it sends the email - that's all.
Admin
Few application-level mail sending libraries will implment any kind of queue/retry functionality (nor should they, IMHO). The easiest, and usually best, approach is to run a local SMTP relay on each machine (sendmail, IIS SMTP service, whatever), only accepting connections from localhost, and send all mail from your application through that.
It can then take care of all your relay/queue/retry/logging needs without having that functionality reinvented and reimplemented in each of your apps.
Admin
The real WTF is that Outlook is installed on a production server.
Admin
Sorry, I just referred to raw as some kind of API which communicates directly with the STMP server as opposed to a daemon process which implements a mail queue.
I guess the pros and cons of using SMTP vs. a local install of sendmail depends upon the problem at hand.
My boss requested that I write a cron job to check that /etc/init.d/httpd is running and to send an email if it is not running. I insisted that running a such a cron job was a WTF and would not help. It would probably cause just as many problems as it would solve. After much protest, I finally conceeded that I would always send an email at boot time (rc.local). The email would include a check to see if httpd and mysqld started. Because reboot was probably after a UPS fail, there is no guaruntee that the corporate email server has restarted, thus a mail queue is required and a maillog to see reasons why the sending failed.
Admin
Gene Wirchenko's clone
Admin
Admin
I think some people just read the WTF and then post a comment, without bothering to read the previous comments, hence multiple posts of "ClickYes exists!!!111 WTF" and "System.NET.Mail, you out-of-date fool" etc.
Some time back I made a tiny windows app which opens and talks to MSPAINT to compress folders-worth of JPGs. I still use this program.
The real WTF is that people here say "first to post" when they really mean "first to comment"
Admin
AAAAAAHHHH!!!!
I'm BLIND, I'm BLIND!!!
HELP, I CAN'T SEE!!! It was so.... GHASTLY!!!
Can't.... believe.... GAARRRRGLLLL dies with foaming at the mouth
Admin
You authorise a particular set of hosts to talk SMTP to the world on port 25. Then you guard that set of hosts from infection and stupidities like installing Outlook. Securing a small set of authorised hosts is easier than securing the larger set of user accessible workstations/desktops.
You don't care which application is generating the traffic, only if that host is authorised to generate that kind of traffic.
I work at a small ESP, and this is what we recommend to a lot of people who have NATs blocked by us at the IP level for sending viruses/spam.
Admin
If he was coming from a Unix background, he would just have installed Cygwin (or RTFMed).
Unix (and non Windows) admins in general tend to know what they are doing. The popularity of Linux and MCSEs is making this less so.
Admin
Actually, the class must have been somewhat cryptic and undocumented, because I distinctly remember Googling (and I am a competent Googler) and ending up trying to impliment it myself, giving up, finding three other implimentations and trying to get them to work. Hence how I found out in my origional post it was depreciated, because I was thinking "Wa? That wasn't there when I last looked".
Maybe now I can rewrite my application :D
Admin
I'm betting that there are a lot of unpatched outlook apps out there to get around that stupid click yes problem in automation solutions. IT wouldn't be needed except that outlook does all the work putting multi-part attachments back together so nicely but utterly fails to reliably give a return address back through the automation interfaces. Makes it very handy for recieving email, but a bitch to send even the simplest meaninful "thank you, we got it" (esp. if you foolishly applied an outlook patch in the past, oh, 5 or 6 years...)
Admin
How come then Exchange can send email through an SMTP server when the ports are blocked? Am I missing something?
You can send mail using an Exchange server via SMTP on port 25, but you can also use other protocols such as IMAP and MAPI on other ports. IMAP and MAPI communications will get through fine. SMTP will, of course, be blocked.
Most corporate firewalls will block outbound SMTP from all except a few hosts (e.g. Exchange servers), so even though your PC is blocked, you can relay (if allowed) by sending (relaying) your SMTP messages via the Exchange server.
Admin
Looks like you didn't read thoroughly my message, but anyway... My point was, that you cannot distinguish between different applications on a machine. You may permit or deny a machine to communicate through a port to some other machine, but you cannot set a rule to allow Outlook to use port 25 (smtp), but noone else (application). This can be done through a software firewall. Do we agree on that finally?
Using MS Exchange Server is a different issue and googling for 2 minutes gets you to this article http://support.microsoft.com/?id=310206 in other words - there's no excuse to rely on outlook to send your mails and keep what you've sent in the sent items folder - I believe we agreed on that too - there are databases invented last century for this case.
Agreed?
Admin
Exactly. This is what I was debating all the time. So there can be 2 setups:
1. SMTP is blocked and you should communicate to the MS Exchange Server using a different protocol (and class, not System.Net.Mail)
2. SMTP is enabled and you use System.Net.Mail to "talk" to your server.
And in both cases you don't need Outlook to send the email unless you have a software firewall, but even then it shouldn't be an issue - the administrator should allow your application to go through the firewall - it's a well-known application, so thinking of workarounds instead of fixing the firewall settings is a WTF and I'm amazed how many people said that in some cases using Outlook is ok for some occasions. Unless the customer explicitly asked so, but this is applicable only to desktop applications - on a web server it's a big WTF (installing a desktop application, ensuring that there is always a user logged on so this application can run, installing third-party software to "click" popups and so on)
Admin
Oh my God... Why, oh, WHY did you ever consider using Outlook to send or receive email? And probably advise people not to apply the patches? A better source for email worms isn't available. Man you should be decapitated immediately as you're are a threat to all your customers and people you deal with and who think you understand something about computers and software. Receiving email through Outlook??? WHY? Using automation isn't easier than using the protocol itself. Google for 5 minutes and you will find pop3 components to send or recieve the email for most of the platforms (I'm not talking about finding such a code on Prolog, but I would be really surprised to see Prolog "talking" to outlook through automation). So please take try to explain me WHY would you ever use outlook from your application? And what if someone doesn't have outlook because he likes Eudora, Thunderbird or Outlook Express better? Should (s)he install MS Office just to get your program working?
Admin
Oh, I don't know, maybe because the app is an internal corporate app and all users are running Outlook? I think there's a few companies out there that still run MS Office, you know.
Admin
Admin
blinks
Would using a simple image-manipulation library not be quicker to write, faster, and give you more control?
Admin
Not to mention that if the user is already using Paint then it could talk to the wrong one and either mess up their work or at least annoy them to hell.
Admin
Gene,
You seriously need to get over yourself.
Sincerely,
John "Not part of the Gene pool" Smallberries
Admin
And according to the webpage, neither works with Outlook Express (they kindly show you the non-WTF way of getting rid of the annoying prompts instead, which apparently doesn't exist on Outlook proper).
Admin
So what are the advantages of using Outlook+ClickYes instead of System.Net.Mail?
Admin
You are missing the entire point. Yes, if you have .net installed, and are writing the app in .net, and you need to send emails, it makes a lot of sense of use system.net.mail. That is why this post is a WTF.
Not all PC's have .net installed, and not all programmers can work with .net. Some have to write apps in VBA, and sometimes you have to send emails through Outlook -- especially in code written before .net was released. Makes sense, right?. I know in the past there were situations where I had to (as my previous example a few posts back showed), and using VBA and Outlook was a great, easy way to do things. Of course, it was also a great, easy way for viruses to spread, so MS added the security feature. Which ClickYES helped legitimate code send out bulk emails with requiring the user to click YES over and over and over.
Oh, by the way, in case you forgot, here's what you wrote which I replied to:
>>Oh my God... Why, oh, WHY did you ever consider using Outlook to send or receive email?
Admin
Two thoughts: first, how do you prevent viruses and worms from taking advantage of your relay? And second, even if you managed to secure it properly, why would you run a relay on each machine instead of centralizing it onto single (pool of) server(s) where the queues can be maintained (instead of some old email getting stuck in limbo for months without ever being noticed)?
Admin
My only possible guesses at why this solution wasn't found by the original coder:
1) He had never heard of google.
2) His PHB had aggressive WTF web-blocking software installed (e.g. Websense) that made it almost impossible to view any site containing useful information.
3) ... erm ... no , I'm out of ideas.
Admin
I doubt it very much. A UNIX person would be far too lazy to go to such extraordinary effort just to send an email. In the UNIX world, if it's not simple, you're obviously doing it the wrong way.
And every high level programming language under UNIX that I know of has a standard mail/SMTP class.. Net::SMTP in perl, smtplib in Python, System.Web.Mail/System.Net.Mail in Mono.
Admin
Okay, so he had a working solution using CDO, but CDONTS isn't installed in Win2003... A quick google search turns up several pages informing you that CDO for NT Server has been replaced by CDOSYS which exists on Windows 2000 and Windows 2003... Further, even if you only read the first hit, or use the I feel lucky search, you'd find out how to install CDONTS on Win2003...
Some people should seriously be taken out to the barn and have unspeakable things done to them...
Admin
On many systems, the source control system is the easiest way to get code from the development system to the test or deployment systems. There even is an argument for saying that it should be the only way.
So, to test his code on a system that is similar, if not identical, to the deployment system, this guy may have had to check it in.
Admin
Apart from the fact you don't want Outlook te be installed on a server and there are better ways to send mail (SmtpMail class), there is a better way to get rid of annoying security messages in Outlook. For example while synchronising with your PDA or phone.
http://www.mapilab.com/outlook/security/
And it is free, and no I don't have anything to do with this company...
Admin
Damn, oh-my-f*****g-god! This truly beats it all. How the fuck can a developer think like this. HAHA! I would have wanted to see this guy build an smtp server :-)
Admin
Speak a few...
(captcha = "captcha")
Admin
James, meet sarcasm. Sarcasm, this is james, I believe you guys never met.
Yeah except no, even in computer science where you're the most likely to find that kind of behaviour some people also start counting at 1 (Fortran arrays are 1-indexed for example).
Normal people count from 1 onwards, not from 0 onwards.
Admin
Agreed, putting MS Office components on a production server is a major WTF. Suprised that was not mentioned more in the thread.
hmmm... Wonder if MS Office Outlook was installed for this, or if it was already on the server? And if only Outlook or other Office applications were installed?
Also, this approach should only work when a user is logged into the server. (Relatively sure of this, but not verifying!) So he had to log in and leave the account logged in for this to work unattended.
Admin
Haaaaaaaaaaaaaaaaaaah...
This should be mortalized somehow, like a trophy or a statue or something...
This teh best WTF I ever read on this site....
Admin
OSI layers are also numbered starting from 1.