LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   ISPs SMTP service keeps bouncing mail when I send from my server. (https://www.linuxquestions.org/questions/linux-server-73/isps-smtp-service-keeps-bouncing-mail-when-i-send-from-my-server-913616/)

j.smith1981 11-15-2011 04:02 AM

ISPs SMTP service keeps bouncing mail when I send from my server.
 
I am having real problems sending emails using my ISPs SMTP service.

What I am getting back is exactly this:
Quote:

Nov 15 09:56:49 server postfix/smtp[18716]: 844E23A6EBC: to=<myemailuser@gmail.com>, relay=smtp.virgin.net[62.254.26.212]:25, delay=0.27, delays=0.09/0.03/0.14/0.02, dsn=5.0.0, status=bounced (host smtp.virgin.net[62.254.26.212] said: 555 Refused (external Mail From address). Please enable SMTP authentication to send mail. (in reply to MAIL FROM command))
I have tried the following steps:
http://www.cyberciti.biz/faq/postfix...t-smtp-client/

But this doesn't work, have replaced the username (email) on the steps with my own ISPs email address (which I won't give out here for obvious reasons) and my current password but still no luck.

By doing those steps it just says deffered, can someone help me to overcome this error?

I mean surely if I am a registered user on their network I should be able to send emails surely?

Any feedbacks greatly appreciated,
Jeremy.

catkin 11-15-2011 04:23 AM

Is this on a CentOS 5.5 system?

The linked procedure is for sending via multiple ISPs; unless you are actually using multiple ISPs there are simpler procedures (sorry - no links kept).

Are the logon and port details you are using for smtp.virgin.net known to work, for example from an email client such as Thunderbird?

DaRkBoDoM 11-15-2011 05:14 AM

What are you using to send email?

j.smith1981 11-15-2011 05:21 AM

Yes it was working perfectly until today.

I firstly tried on the hope that it would work (doubtly though) to restart postfix, of course that failed though, as it's their smtp service smtp.virgin.net which says I need to authenticate myself.

This is the config of /etc/postfix/main.cf that used to make this work up to today:
Quote:

relayhost = smtp.virgin.net
I have tried adding following through on the actual Virgin Media's support forums:
http://community.virginmedia.com/t5/...mtp/td-p/66253

What I have come up with is something like (removing my real email address though):
Quote:

relayhost = smtp.virgin.net:465
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
Then /etc/postfix/sasl_passwd looks like:
Quote:

smtp.virgin.net:465 myuser123@my_isp_mail_domain:my_isp_email_password
However this is the error I am getting now:

Quote:

Nov 15 11:19:00 server postfix/smtp[23966]: 303893A65E1: to=<muser@myispdomain.com>, relay=smtp.virgin.net[62.254.26.212]:465, delay=727, delays=716/0.03/11/0, dsn=4.4.2, status=deferred (lost connection with smtp.virgin.net[62.254.26.212] while receiving the initial server greeting)
Any suggestions are really appreciated, sorry it is Centos 5.7 which I am using now, not that is should matter at the moment, but I am using iRedmail email services, that's how postfix was configured, with some amendments to allow me to use my ISPs SMTP service for any domains external to my own host as it where, I should be allowed to use their SMTP service since I hold a valid ISP email account with Virgin precisely shouldn't I?

j.smith1981 11-15-2011 05:34 AM

Quote:

Originally Posted by DaRkBoDoM (Post 4524480)
What are you using to send email?

Postfix it's in the log output what service I am using sorry.

I have even run the postmap as it says in the topic link:
Quote:

you will probably also need to execute postmap /etc/postfix/sasl_passwd which will compile the sasl_password file into a hash-table for postfix to use...
After running postmap on the file I said, is it supposed to show the exact same file details by any chance?

Just wanted to make sure that's worked in its own manner and then really I don't know what to do if it has, any suggestions?

DaRkBoDoM 11-15-2011 05:57 AM

Probably you could:

1. Manually test your remote credentials: http://qmail.jms1.net/test-auth.shtml
2. Use tcpdump to see where your postfix goes wrong
3. Fix the issue

This should took you about an hour to solve the issue.

Anyway, probably it's even not trying auth at all.

On my config, i have this:
Code:

smtp_sasl_security_options = noanonymous
You need to run postmap to generate a /etc/postfix/sasl_passwd.db file, THEN restart postfix.

j.smith1981 11-15-2011 06:29 AM

Right it is obviously contacting the server on smtp.virgin.net.

But it's deffering.

I have gone through the steps on the link you sent me, seems fine to me but I am questioning this part here:
Quote:

AUTH PLAIN AGptczFAam1zMS5uZXQAbm90Lm15LnJlYWwucGFzc3dvcmQ=
235 ok, go ahead (#2.0.0)

If you see this message, you are authenticated. If you see this one instead...

AUTH PLAIN AGptczFAam1zMS5uZXQAbm90Lm15LnJlYWwucGFzc3dvcmQ=
535 authorization failed (#5.7.0)
What my question being should I replace the bit after AUTH PLAIN?

It's just it says too many signals to the smpt.virgin.net could cause me to get blocked and I do not obviously want to do that.

Can you help please?

I mean this is what I get when I run the 'ehlo testing' after 'openssl s_client -crlf -connect smtp.virgin.net:465' command:
Quote:

220 Virgin Media SMTP server ready [ e4c558782VM ].
ehlo test
250-Virgin Media SMTP Proxy at your service.
250-SIZE 35651584
250-8BITMIME
250 AUTH LOGIN PLAIN
Seems fine to me it's got auth login plain hasn't it?

DaRkBoDoM 11-15-2011 06:40 AM

The guide says you can build your secret auth string using

Code:

perl -MMIME::Base64 -e 'print encode_base64("\000jms1\@jms1.net\000not.my.real.password")'
from command line. Obv, replace jms1\@jms1.net and not.my.real.password with your real username and password

j.smith1981 11-15-2011 07:03 AM

Ok I will do that within the next 2 hours.

Thank you though ever so much for your support truly appreciate it!

I mean to be fair this does make some sense in a manner of speaking, tried that stunnel stuff on the community forums for virgin media but of course didn't work.

Will try this though and carry on, so I would use that code generated from that perl command as my password then would I?

Sorry it's just I don't quite get where I should be using that as my password.

DaRkBoDoM 11-15-2011 07:07 AM

Quote:

Originally Posted by j.smith1981 (Post 4524544)
Will try this though and carry on, so I would use that code generated from that perl command as my password then would I?

This code is a "compressed" version of your username and password together.
Also, have you tried smtp_sasl_security_options = noanonymous?

j.smith1981 11-15-2011 08:37 AM

I have enabled what you said yes, still absolutely no effect at all, sorry, with regards to this:
Quote:

Originally Posted by DaRkBoDoM (Post 4524549)
This code is a "compressed" version of your username and password together.
Also, have you tried smtp_sasl_security_options = noanonymous?

Is there a way of viewing what's in the database files and remove rows if necessary?

I am saying that because every time I issue the command say portmap /etc/postfix/<file that has my password for sasl> keeps adding to that one file each time, just wondering if I have entered a wrong character in there and it's taking that value first off.

Is there a command I can use to view what's in there and possibly remove any entries that should not be in there?

I appreciate any replies,
Jeremy.

I ran the command (copy of the whole telnet conversation with smtp.virgin.net):
Quote:

220 Virgin Media SMTP server ready [ e4c558782VM ].
ehlo mail.myhosts.com <replaced with my actual dns MX record>
250-Virgin Media SMTP Proxy at your service.
250-SIZE 35651584
250-8BITMIME
250 AUTH LOGIN PLAIN
AUTH LOGIN PLAIN amF0LnNtaXRoLmNvbUdpbm9sYXgyMg==
334 VXNlcm5hbWU6

DaRkBoDoM 11-16-2011 12:09 PM

Better remove the login string from the previous post.

btw, the command is
Code:

AUTH PLAIN <login_string>
The hasmap is regenerated every time you issue the command, from the text file.


All times are GMT -5. The time now is 02:58 PM.