Cruisers Forum
 


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 25-11-2013, 12:47   #1
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Send a Request mail from OpenCPN ( beta 3.3.1117)

The purpose is to share my (small) experience and to show which setting I use to send GRIB file request mail.
I would be pleased if it helps those who have difficulties.

Although it works perfectly on CQ60 with Windows Vista/Thunderbird or Ubuntu 13.10 and on mini Q10 and with XP/thunderbird, I do not claim it will work on all devices, with all OS, ISPs and Mail system, so it would be nice if someone could share his own experience.

All these tests have been done with an ISP working with authentication on port 587.

1)Windows(Vista or XP and Thunderbird)

- Outside OpenCPN there is nothing more to do except ensure there is a mail system (mine is thunderbird) correctly configured and set as "main" on the device.
also verify if the mapi32.dll is present in c:/windows/system32 (or equivalent for 64b) (otherwise an error message will be the result).

- Inside OpenCPN, there is nothing to do: The sender mail address can be entered, but will not be used. Just don't forget to enter the zyGRIB login and password.

When clicking on "send" button :
if the "main" mail system is not open, OpenCPN opens it and the waiting messages are received.
a remark :if there are many waiting messages, it could take a while. That's why it would be better to create a specific address for this purpose.
Then a new mail page is opened with all mail elements already written thus ready to be sent.

2)Linux (Ubuntu 13.10)

-Outside OpenCPN: a MTA (Mail Transport Agent) has to be installed and correctly configured. Several exist : Sendmail, Exim4, Postfix, sSMTP ...

I tried Sendmail an recently Exim4, but I found them very complex to configure. So I selected ssmtp for his lightness and easiness to be configured

How to install and configure sSMTP:

- 1) Install the ssmtp package.
If another MTA is already installed, it could be requested to uninstall it before installing ssmtp

once it's done you could test by typing this command:
"whereis sendmail"

the answer should be something like that :"/usr/sbin/sendmail"

use this answer in the next command:
"ls -la /usr/sbin/sendmail"

If everything's OK you should get this answer: "/usr/sbin/sendmail → ssmtp" showing that Sendmail function is now connected to ssmtp

- 2) Now there are two files to set:

the first file : /etc/ssmtp/ssmtp.conf ( with root rights )

The typical setting should be:
root=postmaster
AuthUser=yourlogin to your ISP access
AuthPass=yourpasseword to your ISP access
mailhub=yourISPserveurname.yourdomain (for example smtp.orange.fr)
rewriteDomain=yourdomain
FromLineOverride=YES
hostname= the full host-name ( normally automatically entered, but if not you can type the command : "hostname" to get it)

For ISP requiring a TLS connection , it could be necessary to add the line UseTLS=YES or UseSTARTTLS=YES

the second file : /etc/ssmtp/revaliases (with root rights)

Enter this line.
root:yourlogin@yourdomain:yourISPserveurname.yourd omainort

the default port was 25 but now many ISP refuse it and use 587. If you have a mail system, you will find the right value in it.

- Inside OpenCPN :You must enter the sender address : your entire mail address, the one you will use to send mails and receive answers

When you click on the "send" button, the mail is directly sent. You can find the log here : /var/log/mail.log

Jean Pierre
Ptizef is offline   Reply With Quote
Old 25-11-2013, 15:30   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,387
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Ptizef...

Nice tutorial.

This should somehow find its way into the default OCPN user manual as installed by the setup program...with pictures.

Thanks again for all your work on the GRIB PlugIn.
Dave
bdbcat is offline   Reply With Quote
Old 27-11-2013, 07:50   #3
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,523
Images: 2
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Put it under Tracker Documentation, for later addition to Manual.
rgleason is offline   Reply With Quote
Old 27-11-2013, 12:52   #4
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

The drawback with using an MTA on Linux is that it's complicated.
I have Exim4 working, and are looking at postfix (default on Ubuntu).
I'm afraid that this will lead to a lot of user frustration for a minimum gain. Sure its nice to send the request from within O, but to receive the grib you still have to retrieve it from your normal mail program, Thunderbird or similar.
By using the shell script "xdg-email" (that is present on most installations) in the plugin, Linux gets the same interface as Windows, with zero user setup. You send and receive through your normal mail program. The plugin creates the mail, and you only click "send".

Then we have the question of how this needs to be set up(coded) to work on Mac. Any knowledgeable Mac user out there?

Thomas
cagney is offline   Reply With Quote
Old 30-11-2013, 08:52   #5
Registered User

Join Date: Sep 2009
Location: Angers - France
Boat: Beneteau First 29 Ptizef
Posts: 844
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Ok xdg-email works fine on Ubuntu 13.10 and Thunderbird
I don't know if it works with all local mail system. The documentation is relatively poor or unreachable.
Anyway, do we keep the two methods, living the user decide or do we keep only one and witch ?
Jean Pierre
Ptizef is offline   Reply With Quote
Old 02-12-2013, 08:08   #6
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,537
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Quote:
Originally Posted by cagney View Post
Then we have the question of how this needs to be set up(coded) to work on Mac. Any knowledgeable Mac user out there?

Thomas
Here it is for Mac.

Sendmail/Postfix install for Mac

It is not so easy to install this on a Mac since you will need some experience with terminal using. The example below uses an googlemail account and nano as editor:

Step 1
Type in terminal these 6 lines one after another with return:
sudo mkdir -p /Library/Server/Mail/Data/spool

sudo gzip /usr/share/man/man1/{postalias.1,postcat.1,postconf.1,postdrop.1,postf ix.1,postkick.1,postlock.1,postlog.1,postmap.1,pos tmulti.1,postqueue.1,postsuper.1,sendmail.1}

sudo gzip /usr/share/man/man5/{access.5,aliases.5,bounce.5,canonical.5,cidr_tabl e.5,generic.5,header_checks.5,ldap_table.5,master. 5,mysql_table.5,nisplus_table.5,pcre_table.5,pgsql _table.5,postconf.5,postfix-wrapper.5,regexp_table.5,relocated.5,tcp_table.5,t ransport.5,virtual.5}

sudo gzip /usr/share/man/man8/{anvil.8,bounce.8,cleanup.8,discard.8,error.8,flus h.8,local.8,master.8,oqmgr.8,pickup.8,pipe.8,proxy map.8,qmgr.8,qmqpd.8,scache.8,showq.8,smtp.8,smtpd .8,spawn.8,tlsmgr.8,trivial-rewrite.8,verify.8,virtual.8}

sudo /usr/sbin/postfix set-permissions

sudo chmod 700 /Library/Server/Mail/Data/mta

Step 2
Type in terminal another command to start the nano editor with this file:
sudo nano /etc/postfix/sasl_passwd

Type into the nano editor:
smtp.googlemail.com:587 YourAccountname@googlemail.com:YourPassword

Substitute YourAccountname and YourPassword with your data.
Save the file in nano with Ctrl-O and exit with Ctrl-X.

Step 3
Publicate the new file in terminal with this command:
sudo postmap /etc/postfix/sasl_passwd

Step 4
You have to edit the main config file and add at the end the following lines with
this command in Terminal:
sudo nano /etc/postfix/main.cf

This to add:
# Minimum Postfix-specific configurations.
mydomain_fallback = localhost
mail_owner = _postfix
setgid_group = _postdrop
relayhost=smtp.googlemail.com:587

# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options=

# Enable Transport Layer Security (TLS), i.e. SSL.
smtp_use_tls=yes
smtp_tls_security_level=encrypt
tls_random_source=dev:/dev/urandom

Save the file and exit nano as in step 2.

Step 5
Now you can start postfix in terminal with:
sudo postfix start

If an error occurs correct main.cf and start again with:
sudo postfix reload

Step 6
Now you can test your work in terminal with:
date | mail -s test YourAccountname@googlemail.com


Done.
Supplemental
If you want to have started sendmail/postfix each time you start you start
your machine you can add these lines to the launch daemon:
<key>RunAtLoad</key>
<true/>

Do this with this command in terminal:
sudo nano /System/Library/LaunchDaemons/org.postfix.master.plist

After that this file should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label<</key>
<string>org.postfix.master</string>
<key>Program</key>
<string>/usr/libexec/postfix/master</string>
<key>ProgramArguments</key>
<array>
<string>master</string>
<string>-e</string>
<string>60</string>
</array>
<key>QueueDirectories</key>
<array>
<string>/var/spool/postfix/maildrop</string>
</array>
<key>AbandonProcessGroup</key>
<true/>
<key>OnDemand/lt;/key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>

Instead of googlemail in this example you may use any other mail server.
Happy typing.
Gerhard
CarCode is online now   Reply With Quote
Old 02-12-2013, 12:42   #7
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,523
Images: 2
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Wow, Gerhard, thanks for your effort. I am going to copy and post it in Tracker ---> Documentation, so it finds its way into the Manual.

Others please post amendments and improvements to the documentation there, once they are figured out... here or elsewhere.
rgleason is offline   Reply With Quote
Old 04-12-2013, 13:48   #8
Registered User

Join Date: Dec 2005
Location: Helsingborg
Boat: Dufour 35
Posts: 3,891
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

CarCode
Thanks!
I'm afraid that using a mail-server to forward requests to Saildocs is a bit to complicated. Even with lengthy instructions, it will lead to a lot of frustrated Linux & Mac users.
In windows the default is to raise the users email program with a prepared mail ready to send.
The same can be achieved in Linux with xdg-email.
This must be possible in Mac as well, I hope!

Thomas
cagney is offline   Reply With Quote
Old 04-12-2013, 22:06   #9
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,537
Re: Send a Request mail from OpenCPN ( beta 3.3.1117)

Correct Thomas,
and it should be possible to download the grib file directly via the grib plugin as it does like zyGrib which does not need a mailer.
My intention with the tutorial above was to show that it is possible but rather complicated to use a mailer for this task.
Gerhard
CarCode is online now   Reply With Quote
Reply

Tags
enc, opencpn

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 05:00.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.