DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2011-05-13 17:57:16

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Problem sending email (timout) using msmtp and gmail account

Hi all,

I seem to have a problem sending emails using msmtp from a gmail account. It occasionally works but most of the time it times-out.
Your inputs are appreciated.

The error message I keep seeing in the msmtp log:

Code:

May 13 17:47:22 host=smtp.gmail.com tls=on auth=on user=user.name from=user.name@gmail.com recipients=another.user@gmail.com errormsg='cannot connect to smtp.gmail.com, port 587: Connection timed out' exitcode=EX_TEMPFAIL

here's how I set msmtprc for that account:

Code:

account gmail
# certificate file from http://www.geotrust.com/resources/root-certificates/index.html

host smtp.gmail.com
port 587
from user.name@gmail.com
tls on
tls_starttls on
tls_certcheck on
tls_trust_file /ffp/etc/ssl/certs/Equifax_Secure_Certificate_Authority.cer
auth on
user user.name
password my.password
logfile /ffp/var/log/msmtp.log

DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#2 2011-05-14 04:27:57

bound4h
Member
Registered: 2010-04-12
Posts: 209

Re: Problem sending email (timout) using msmtp and gmail account

#!/bin/sh

##
## User-configurable Variables
##

# Where "nail" is installed on your system.
# We need this to actually send the mail, so make sure it's installed
MAILX=/ffp/bin/mailx

# REQUIRED CHANGE #1: you must set SMTP_SERVER
# http://www.host45.com/resources/ispsmtps.php has a list of ISP's smtp servers
SMTP_SERVER=smtp.comcast.net

# REQUIRED CHANGE #2: you must set your email address.
# option A: change "yourname@yourmail.com" here and remove the leading '#' to
# use a real email address
TO_ADDR=email@gmail.com
#
# option B: for an SMS message, set your phone number here and remove the
# leading '#' on the PHONENUM line and your phone provider's TO_ADDR line
#PHONENUM="1234567890"
#TO_ADDR="$PHONENUM@message.alltel.com"      # SMS: Alltel
#TO_ADDR="$PHONENUM@txt.att.net"             # SMS: AT&T (formerly Cingular)
#TO_ADDR="$PHONENUM@myboostmobile.com"       # SMS: Boost Mobile
#TO_ADDR="$PHONENUM@sms.mycricket.com"       # SMS: Cricket Wireless
#TO_ADDR="$PHONENUM@messaging.nextel.com"    # SMS: Nextel (Sprint Nextel)
#TO_ADDR="$PHONENUM@messaging.sprintpcs.com" # SMS: Sprint (Sprint Nextel)
#TO_ADDR="$PHONENUM@tmomail.net"             # SMS: T-Mobile
#TO_ADDR="$PHONENUM@vtext.com"               # SMS: Verizon
#TO_ADDR="$PHONENUM@vmobl.com"               # SMS: Virgin Mobile USA
#TO_ADDR="$PHONENUM@txt.bellmobility.ca"     # SMS: Bell Canada
#TO_ADDR="$PHONENUM@cwemail.com"             # SMS: Centennial Wireless
#TO_ADDR="$PHONENUM@csouth1.com"             # SMS: Cellular Sout
#TO_ADDR="$PHONENUM@gocbw.com"               # SMS: Cincinnati Bell
#TO_ADDR="$PHONENUM@mymetropcs.com"          # SMS: Metro PCS 1
#TO_ADDR="$PHONENUM@metropcs.sms.us"         # SMS: Metro PCS 2
#TO_ADDR="$PHONENUM@qwestmp.com"             # SMS: Quest
#TO_ADDR="$PHONENUM@pcs.rogers.com"          # SMS: Rogers
#TO_ADDR="$PHONENUM@tms.suncom.com"          # SMS: Suncom
#TO_ADDR="$PHONENUM@msg.telus.com"           # SMS: Telus
#TO_ADDR="$PHONENUM@email.uscc.net"          # SMS: U.S. Cellular

###
###  Send the mail...
###

SUBJECT="Torrent Done!"
FROM_ADDR="transmission@localhost.localdomain"

TMPFILE=`mktemp -t mail.XXXXXXXXXX`
echo "This is a test!" > $TMPFILE

$MAILX -v -s "$SUBJECT" \
-S smtp-use-starttls \
-S ssl-verify=ignore \
-S smtp-auth=login \
-S smtp=smtp://smtp.gmail.com:587 \
-S from="$FROM_ADDR" \
-S smtp-auth-user=email@gmail.com \
-S smtp-auth-password=password \
-S ssl-verify=ignore \
"$TO_ADDR" < $TMPFILE

#TMPFILE=`mktemp -t transmission.XXXXXXXXXX`
#echo "Transmission finished downloading \"$TR_TORRENT_NAME\" on $TR_TIME_LOCALTIME" >$TMPFILE
#$MAILX -v -S from="$FROM_ADDR" -S smtp -s "$SUBJECT" -S smtp=$SMTP_SERVER "$TO_ADDR" < $TMPFILE

rm $TMPFILE

This nail script works perfect for me on gmail.  Just modify to fit your settings.  It also allows for text messaging if that's helpful.

Not sure how different it is from what you're asking about, but if you need gmail via SSL, then try it out.

Offline

 

#3 2011-05-14 14:04:11

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Problem sending email (timout) using msmtp and gmail account

Thank you, bound4h, for taking the time and answering my question. I'll try that later (have guests) and report back how it went.

btw, I use these email-sending capabilities from my rsync/snapshot tool, as a post backup action. It's almost feature-complete. I'll post it here in a few days time.


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#4 2011-05-14 16:59:16

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Problem sending email (timout) using msmtp and gmail account

Nope, that didn't do the trick.

Code:

/ # mailx -v -s "Testing 1 2 3" \
> -S smtp-use-starttls \
> -S ssl-verify=ignore \
> -S smtp-auth=login \
> -S smtp=smtp://smtp.gmail.com:587 \
> -S from="DNS-323" \
> -S smtp-auth-user=my.email@gmail.com \
> -S smtp-auth-password=my.password \
> -S ssl-verify=ignore \
> "my.other.email@gmail.com" < /dev/null
Resolving host smtp.gmail.com . . . done.
Connecting to 209.85.143.109 . . .

and after about a couple of minutes...

Code:

could not connect: Connection timed out
"//dead.letter" 10/246

Last edited by scaramanga (2011-05-14 17:00:41)


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#5 2011-05-15 02:07:05

bound4h
Member
Registered: 2010-04-12
Posts: 209

Re: Problem sending email (timout) using msmtp and gmail account

Can you try running is from a script?  Just copying the whole thing into a new mail.sh file then running it?  I'm sure you typed everything right, but running this script in a script file works perfect for me so if we can determine that when you do the same thing and it doesn't work, then it is a connection problem and not a syntax/resource problem.

For example, the from= uses quotes to quote the variable, but you kept the quotes when using a string.  Not sure if mailx cares, but it would rule out a lot if we just ran it as a script first then moved to the next gate.

Last edited by bound4h (2011-05-15 02:08:00)

Offline

 

#6 2011-05-15 12:41:25

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Problem sending email (timout) using msmtp and gmail account

bound4h wrote:

For example, the from= uses quotes to quote the variable, but you kept the quotes when using a string.  Not sure if mailx cares, but it would rule out a lot if we just ran it as a script first then moved to the next gate.

That'll, most probably, have no effect. The shell, in fact, does variable substitutions inside double quotes. What I did is manually perform the action the shell will do anyway (I've been doing plenty of shell scripting).

(a few minutes later) And after trying the shell script I get the same result. I'm starting to think that it is some kind of networking problem.


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

#7 2011-05-18 01:59:57

bound4h
Member
Registered: 2010-04-12
Posts: 209

Re: Problem sending email (timout) using msmtp and gmail account

Sorry man.  If it makes you feel better, and assuming you have the mailx installed as default, the script isn't the problem.

Got a different router you could try out?  Is it possible your ISP is blocking it?  Have you tried getting a non-SSL account to work yet?

Offline

 

#8 2011-05-18 09:31:41

scaramanga
Member
Registered: 2010-08-04
Posts: 251

Re: Problem sending email (timout) using msmtp and gmail account

I managed to get this working using my ISPs email, for the time being.
I was trying to set-up a gmail account for the DNS-323. I haven't given up on that.

I'm using a good ol' WRT54GL flashed with Tomato 1.28. I haven't got a different unit I can use.


DNS-323 HW Rev. C1 FW 1.10 fun-plug 0.5
2 x WD10EARS-00Y5B1 in Standard mode (LCC set to 5 min; Aligned to 4K)
Transmission with Transmission Remote GUI

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB