Sunday, February 14, 2016

Digest for comp.lang.c++@googlegroups.com - 16 updates in 2 topics

alexo <alelvb@inwind.it>: Feb 14 10:40PM +0100

Il 14/02/2016 22:20, Jens Thoms Toerring ha scritto:
 
> from you're screwed. And, sorry, no idea how to do it under
> Windows...
> Regards, Jens
 
Oh!
Really send a message to port 25 is so difficult?
So it seems my only chance is to build the server that listens to my
client program. But who assure me that the firewall doesn't stop that
incoming transmission?
alexo <alelvb@inwind.it>: Feb 14 10:45PM +0100

Il 14/02/2016 21:29, Paavo Helde ha scritto:
>> My clients are too lazy to compile a form from their own with all the
>> infos formatted in a readable way.
 
> I guess you overlooked the body field in the URL.
 
Probably I have not well understood your technique.
Say that I push the send data button in m program to build the message
how can I send it via mail using the mailto string you gave me?
Paavo Helde <myfirstname@osa.pri.ee>: Feb 15 12:15AM +0200

On 14.02.2016 23:45, alexo wrote:
 
> Probably I have not well understood your technique.
> Say that I push the send data button in m program to build the message
> how can I send it via mail using the mailto string you gave me?
 
You run xdg-email with the URL as an argument, or invoke
ShellExecute("open", ...) with this URL, depending on the platform. This
should bring up a new mail window with the default e-mail app configured
for the system, with the pre-filled address, subject and body. The user
just needs to click the send button.
 
When reading other responses about firewalls etc, I'm starting to think
this might be the most robust approach after all.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 14 10:20PM

On Sun, 14 Feb 2016 22:40:37 +0100
alexo <alelvb@inwind.it> wrote:
[snip]
> So it seems my only chance is to build the server that listens to my
> client program. But who assure me that the firewall doesn't stop that
> incoming transmission?
 
You are missing the point. Sending a message to port 25 is not
difficult. There are also many implementations of SMTP servers out
there and it would be ridiculous to code your own: if you need one I
recommend postfix.
 
However, your putative user probably does not have a mail server
running on port 25 on localhost available to them for outgoing mail.
Most consumer users set up their mail client to forward mail directly
to their ISP's SMTP mail relay, and in such cases you would have to
provide some means of allowing your users to do the same (that is, enter
particulars of their mail relay), and then your program can call it up
on port 25 in the ordinary way.
 
If your user does have a mail server running on port 25 on localhost,
with any unix-like system you can get your program to fire up the user's
mailx program (this is the POSIX mail utility).
 
Chris
Paavo Helde <myfirstname@osa.pri.ee>: Feb 15 12:39AM +0200

On 15.02.2016 0:15, Paavo Helde wrote:
>> Say that I push the send data button in m program to build the message
>> how can I send it via mail using the mailto string you gave me?
 
> You run xdg-email with the URL as an argument,
 
Oh, and on Linux of course there should be the ancient 'mail' program
which can be automated even better and does not require user interaction
or X-Windows. I guess from a C or C++ program this can be best launched
by the popen() system call.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 14 11:01PM

On Mon, 15 Feb 2016 00:39:30 +0200
> which can be automated even better and does not require user
> interaction or X-Windows. I guess from a C or C++ program this can be
> best launched by the popen() system call.
 
These days its mailx, according to IEEE Std 1003.1, 2013. However, it
won't help. First, ordinary users do not have mail servers running on
localhost, nor do they normally have sendmail or postfix installed.
Secondly, if they do, mail sent via them will probably be blocked, as
most spam blockers these days will reject mail not coming via a
recognised ISP's mail relay. It so happens that for my own reasons I
do have a mail server running on localhost on my laptop, but it just
forwards on to a recognised mail relay for that reason.
 
The OP's problem is that he does not understand how email works. What
he needs to do is obtain particulars of the user's ISP's mail relay,
or if the user is operating from business premises, of the business's
mail relay. On windows, in cases where a user has Outlook installed
there may well be a system call to obtain the address previously
entered by the user (or by the system administrator) for the purposes of
email she sends via Outlook (I don't know if there is or there isn't,
but it would not surprise me if there is). But that would only work
for users who do have Outlook installed, and there is no equivalent for
the general run of unix-like OSes. My mail client for example requires
me to enter the mail relay into a configuration dialog when I first
start up the program. Microsoft's consumer products do the same.
 
The other thing is that this has nothing to do with C++. The OP would
have the same problem if he were coding with Python, Java, C or any
other language.
 
Chris
Jerry Stuckle <jstucklex@attglobal.net>: Feb 14 06:01PM -0500

On 2/14/2016 5:20 PM, Chris Vine wrote:
> with any unix-like system you can get your program to fire up the user's
> mailx program (this is the POSIX mail utility).
 
> Chris
 
You are missing another point. Even if I do have an smtp server running
on my machine, I can't send email from it. Outbound connections to port
25 are blocked by my ISP. That is true for many ISPs - at least in the U.S.
 
And even if I could use port 25, many MTAs are configured to reject
email from hosts using dynamic IP addresses.
 
I use port 587 to connect to *my* MTA, which is in a data center and has
a static IP address. It also requires authentication and an encrypted
connection.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Jerry Stuckle <jstucklex@attglobal.net>: Feb 14 06:05PM -0500

On 2/14/2016 4:40 PM, alexo wrote:
> So it seems my only chance is to build the server that listens to my
> client program. But who assure me that the firewall doesn't stop that
> incoming transmission?
 
No one does. The ISP can block it any time they wish.
 
In addition, you do NOT want to allow people to relay to other domains
through your server. It won't take long for spammers to find and start
using it, also. If you set up such a server, you must ensure you have
proper authentication in place.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Ian Collins <ian-news@hotmail.com>: Feb 15 12:09PM +1300

Jerry Stuckle wrote:
 
> You are missing another point. Even if I do have an smtp server running
> on my machine, I can't send email from it. Outbound connections to port
> 25 are blocked by my ISP. That is true for many ISPs - at least in the U.S.
 
As Chris said, "Most consumer users set up their mail client to forward
mail directly to their ISP's SMTP mail relay".
 
> And even if I could use port 25, many MTAs are configured to reject
> email from hosts using dynamic IP addresses.
 
Except those to their mail relay, otherwise customers wouldn't be able
to send mail from a regular mail client.
 
--
Ian Collins
Geoff <geoff@invalid.invalid>: Feb 14 03:16PM -0800


>Probably I have not well understood your technique.
>Say that I push the send data button in m program to build the message
>how can I send it via mail using the mailto string you gave me?
 
Paavo's suggestion is the best. You create your order text and create
the URL from it. The mailto: action causes the user's system to invoke
his mail program with the content you create. He can then edit it if
he likes (you'll need to allow for that at your end) and then he
transmits it from his own email account and you never touch TCP within
your application.
 
This has many advantages:
1. You don't have to reinvent the wheel.
2. You never touch a socket or need to learn SMTP.
3. You need not worry about port 25, port 465, SMTP, TCP or SSL.
4. It sends the message via the user's own defined email client and
his authenticated server.
5. You don't have to violate local firewall policies that might
prevent your program from making a connection. This reduces your
support workload when dealing with customers and problems with
your application.
 
... there are more but I'll stop here.
Geoff <geoff@invalid.invalid>: Feb 14 03:22PM -0800

On Sun, 14 Feb 2016 23:01:31 +0000, Chris Vine
 
>hese days its mailx, according to IEEE Std 1003.1, 2013. However, it
>won't help. First, ordinary users do not have mail servers running on
>localhost, nor do they normally have sendmail or postfix installed.
 
I think you misunderstood. The mailto:: URL invokes the users default
mail client, not a server. There is no local server involved and those
services need not exist on the localhost, nor does the mail client
communicate with a localhost socket, it communicates with the user's
own mail server using his own client under his control and under his
own credentials.
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 14 11:35PM

On Sun, 14 Feb 2016 18:01:54 -0500
> running on my machine, I can't send email from it. Outbound
> connections to port 25 are blocked by my ISP. That is true for many
> ISPs - at least in the U.S.
 
Having just discussed it with myself, I can detect no signs of having
missed that. But the point is not that ISPs stop port 25 traffic
leaking out of their system (I have not come across that), but that the
spam blocker of the next ISP in the link will do so.

> I use port 587 to connect to *my* MTA, which is in a data center and
> has a static IP address. It also requires authentication and an
> encrypted connection.
 
That is great, but irrelevant to the OP's issue. I do encrypted
tunnelling from my house in the country (when I am there) to my house
in town, to dispatch my mail remotely.
 
I think you need to resist the temptation to show you are clever.
 
Chris
Jerry Stuckle <jstucklex@attglobal.net>: Feb 14 06:37PM -0500

On 2/14/2016 6:09 PM, Ian Collins wrote:
>> the U.S.
 
> As Chris said, "Most consumer users set up their mail client to forward
> mail directly to their ISP's SMTP mail relay".
 
I know what Chris said. I was addressing his point of using a mail
program on localhost. It will not work on many ISP's.
 
>> email from hosts using dynamic IP addresses.
 
> Except those to their mail relay, otherwise customers wouldn't be able
> to send mail from a regular mail client.
 
Incorrect. Many MTAs are configured to accept mail from other MTAs with
static IPs, but reject mail from dynamic IPs. It has nothing to do with
being able to send mail from a regular mail client.
 
--
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================
Daniel <danielaparker@gmail.com>: Feb 14 02:40PM -0800

> Privacy and private property are under attack here.
 
No it isn't. What's being discouraged here is flouting Wikipedia's rules abut allowed content.
 
Daniel
Mr Flibble <flibbleREMOVETHISBIT@i42.co.uk>: Feb 14 11:16PM

> the lion's mouth. The L-rd will rescue me from every evil
> deed, and will bring me safely to His heavenly kingdom; to
> Him be the glory forever and ever." 2nd Timothy 4
 
Brian,
 
Wikipedia is an encyclopaedia not a website for posting a free
advertisement for a product by its author. Pack it in mate.
 
If you add it again I will remove it again.
 
/Flibble
Chris Vine <chris@cvine--nospam--.freeserve.co.uk>: Feb 14 11:25PM

On Sun, 14 Feb 2016 14:40:31 -0800 (PST)
> > Privacy and private property are under attack here.
 
> No it isn't. What's being discouraged here is flouting Wikipedia's
> rules abut allowed content.
 
More to the point, it is to protect widipedia from people who want to
use it for advertising purposes. If Brian were able to advertise his
business on wikipedia by editing pages, and anyone else were able to do
the same, if would be overcome by mountains of advertising spam.
 
Interestingly the original spam emailers raised the same argument that
Brian now does, against ISPs introduction of spam blocking, also
linking it to the first amendment (in the US). They failed miserably in
the court of law, and of course in the court of public opinion.
 
Brian probably thinks he is exempt from normal morality because he has
been appointed by God. Unfortunately I don't think there can be an
exception on those grounds because there are too many nutjobs who think
the same. You can accommodate the eccentricities of one or two of them
and put up with it for the greater harmony, but not a horde.
 
Chris
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: