sendEmail-Problem with SMTP-Auth

This forum is for all copfilter version 2 support related questions in English. (IPCop version 2)
Post Reply
andydld
Posts: 6
Joined: 29 Nov 2011 12:33

sendEmail-Problem with SMTP-Auth

Post by andydld » 29 Nov 2011 13:15

Hi,

i just made a fresh install auf IPCop 2.0.2 and Copfilter 2.0.90.
After setup the email-configuration and testing i noticed, i receive no test-mails from Copfilter.

Maybe there's a problem mit SMTP-Auth. If i enable it, i get the error shown down.
The configuration (username, server, password, ...) are correct and tested for example with my backup-script on another computer.
I use a local Mailserver (hMailServer on Windows). All clients and scripts use this Mailserver with SMTP-Auth. So far without problems.

I use SMTP-Auth without SSL/TLS.

A test without SMTP-Auth and changed mailserver-configuration worked.

Maybe someone have an idea what's going wrong.

Best regards,

Andy



messages.log

Code: Select all

Nov 29 11:00:20 ipcop copfilter send testvirus: smtp authentication enabled, using user: MYEMAILADRESS
Nov 29 11:00:20 ipcop copfilter send testvirus: 
Nov 29 11:00:20 ipcop copfilter send testvirus: please wait until scripts finishes 
Nov 29 11:00:20 ipcop copfilter send testvirus: this script only works if you have correctly configured your email address 
Nov 29 11:00:20 ipcop copfilter send testvirus: and smtp server in the copfilter webgui 
Nov 29 11:00:20 ipcop copfilter send testvirus: 
Nov 29 11:00:20 ipcop copfilter send testvirus: Nov 29 11:00:20 ipcop sendEmail[9337]: ERROR => Received: #011502 Unimplemented command.

karesmakro
Site Admin
Posts: 1280
Joined: 09 Dec 2009 21:17

Re: sendEmail-Problem with SMTP-Auth

Post by karesmakro » 29 Nov 2011 13:41

Hello andydld and welcome to copfilter forum!

After you installed the Copfilter 2.0.90 version, did you installed the Copfilter 2.0.x update from http://www.copfilter.org/pg64 ?
Can you please ensure, to make sendmail tests without using special characters!
You can find different sendmail versions in /var/log/copfilter/default/opt/tools/bin too.

Best way would be, first ensure, you are not using any special characters!

Regards

andydld
Posts: 6
Joined: 29 Nov 2011 12:33

Re: sendEmail-Problem with SMTP-Auth

Post by andydld » 29 Nov 2011 15:25

Hi,

thanks for the reply.
The update is installed, too.

I have no special characters within the mail-adresse or within the username or password.

The log of the mailserver shows, that the user is authenticated.
It seems, the "problem" occurs later, after the auth-process.
I see the "unimplemented command"-error on both sides (IPCop und hMailserver).
The test with different sendEmail-Versions changed nothing.

The mailserver-log shows me the "unimplemented command"-error straight after "□MAIL-FROM:".
The different between SMTP-Auth on and off is an "unwanted" □ (is it a line forward, enter/return?) before the "MAIL-FROM:".

A manuell test of sendEmail (described in the wiki) works.
So i think, there's an problem within the script, which calls sendEmail with SMTP-Auth.

Hope that helps.

Best regards,

Andy

karesmakro
Site Admin
Posts: 1280
Joined: 09 Dec 2009 21:17

Re: sendEmail-Problem with SMTP-Auth

Post by karesmakro » 29 Nov 2011 17:56

So if you can manually send mails with sendEmail, I guess, you missed the port settings after the mailserver settings in Copfilter Gui and Email settings.
It's like mailserver.xy:25, or with ip address xxx.xxx.xxx.xxx:<port>
Do you recieve monit status messages (if used?) Monit use it's own way to send mails.

If that does not work for you, can you show me your used pattern, which worked for you (please mask) to authenticate on your Mailserver?

Regards, Kare

andydld
Posts: 6
Joined: 29 Nov 2011 12:33

Re: sendEmail-Problem with SMTP-Auth

Post by andydld » 29 Nov 2011 18:25

Hi,

i changed the mail-config within copfilter with the same sad result.
The port is not the problem, i think so far.
Tested with 25 and 587.

I don't receive mails from monit. I saw a notice, that monit wont use SMTP-Auth.

For the test, if the problem is with or without SMTP-Auth, i disabled SMTP-Auth for "local-to-local e-mail addresses" on my mailserver.

I still see this strange "□MAIL-FROM:" if SMTP-Auth is enabled on both sides, which seems to be wrong ("unimplemented command"-error). Port-Change doesn't change anything or doesn't matter.
If i disable SMTP-Auth on both sides, i see "MAIL-FROM:", which seems to be the right and i receive the test-mail.

Best regards,

Andy

karesmakro
Site Admin
Posts: 1280
Joined: 09 Dec 2009 21:17

Re: sendEmail-Problem with SMTP-Auth

Post by karesmakro » 29 Nov 2011 18:56

Which testmails from Copfilter are affected by this issue? Are this only the testmails from Test & Logs Gui, or do you receive antivirus update notifications?
Please check your global settings for correct value's

Code: Select all

cat /root/copfilter/etc/global_settings | egrep '(SMTP_|_ADR)'
Execute the send_spam_mail.sh, to see more detailed output

Code: Select all

/root/copfilter/tests/spam/send_spam_mail.sh
regards

andydld
Posts: 6
Joined: 29 Nov 2011 12:33

Re: sendEmail-Problem with SMTP-Auth

Post by andydld » 29 Nov 2011 19:21

Hi,

i have to say, the IPCop runs since only 9 hours.
I only received the test-virus-mails. Other test-mails not checked. No update-notification, etc. received so far.
But it could be, i don't received them, because SMTP-Auth is normally enabled on my mailserver.

Here the global_settings:

Code: Select all

EMAIL_ADR=EMAILADDRESS
SENDER_ADR=EMAILADDRESS
SMTP_ATTACHMENT_SCAN=off
SMTP_ATTACHMENT_SCAN_BOUNCE=off
SMTP_ATTACHMENT_SCAN_DISCARD=off
SMTP_AUTH_ENABLE=on
SMTP_AUTH_PASS=PASSWORD
SMTP_AUTH_SECURE=off
SMTP_AUTH_USER=USERNAME
SMTP_DOMAIN=
SMTP_GREYLISTING=off
SMTP_HOST=MAILSERVER
SMTP_MAIL_ADD_BODY=off
SMTP_MAIL_ADD_HEADER=off
SMTP_MAIL_REWRITE_SUBJECT=off
SMTP_SANITIZE_SCAN=off
SMTP_SCAN_BLUE=off
SMTP_SCAN_GREEN=on
SMTP_SCAN_ORANGE=off
SMTP_SCAN_RED=off
SMTP_SPAM_QUARANTINE=on
SMTP_SPAM_QUARANTINE_NOTIFY_USER=off
SMTP_SPAM_SCAN=on
SMTP_SPAM_SCAN_BOUNCE=off
SMTP_SPAM_SCAN_BOUNCE_SCORE_LEVEL=20
SMTP_SPAM_SCAN_DISCARD=off
SMTP_SPAM_SCAN_DISCARD_SCORE_LEVEL=20
SMTP_SPAM_SCAN_QUARANTINE_SCORE_LEVEL=15
SMTP_SPAM_WHITELIST=on
SMTP_VIRUS_ADMINNOTIF=on
SMTP_VIRUS_NOTIFY_USER=off
SMTP_VIRUS_QUARANTINE=off
SMTP_VIRUS_QUARANTINE_REMOVAL_DAYS=14
SMTP_VIRUS_SCAN=on
SMTP_VIRUS_SCAN_BOUNCE=off
SMTP_VIRUS_SCAN_DISCARD=off
SMTP_VIRUS_SCAN_JUST_DELETE=off
It seems to be the same settings i have within the webgui.

Here's the output of send_spam_mail.sh:

Code: Select all

smtp authentication enabled, using user: EMAILADDRESS

please wait until scripts finishes 
this script only works if you have correctly configured your email address 
and smtp server in the copfilter webgui 

Reading message body from STDIN because the '-m' option was not used.
If you are manually typing in a message:
  - First line must be received within 60 seconds.
  - End manual input with a CTRL-D on its own line.

Nov 29 18:15:23 ipcop sendEmail[21219]: Message input complete.
Nov 29 18:15:23 ipcop sendEmail[21219]: ERROR => Received: 	502 Unimplemented command.
SMTP-Auth is enabled on both sites.

I checked mailserver's smtp-log for other smtp-auth communication. All other scripts of mine, mails send by my groupware-server (Tine 2.0), communication to my provider (all requires SMTP-Auth, too) shows a "normal" "MAIL-FROM:", within this little square, which generates the error.

Hope that helps.

Regards,

Andy

karesmakro
Site Admin
Posts: 1280
Joined: 09 Dec 2009 21:17

Re: sendEmail-Problem with SMTP-Auth

Post by karesmakro » 29 Nov 2011 20:28

o.k.

at first, please fill the permitted domains in SMTP Filter on gui and if used, on POP3 Filter too
and 2. download this script, extract it and drop me the ouput by using PM (this shows verbose messages)

Code: Select all

wget http://www.it-connect-unix.de/copfilter/send_mail_check.tgz
tar xvzf ./send_mail_check.tgz
./send_spam_mail.sh

andydld
Posts: 6
Joined: 29 Nov 2011 12:33

Re: sendEmail-Problem with SMTP-Auth

Post by andydld » 29 Nov 2011 22:21

Good evening,

ok, i filled the permitted domains for smtp and pop3.

PM is on the way.

Between i received mail of clam-update-notification.

Auth-SMTP for local email-adresses is currently disabled on my mailserver.

Andy

andydld
Posts: 6
Joined: 29 Nov 2011 12:33

Re: sendEmail-Problem with SMTP-Auth

Post by andydld » 30 Nov 2011 00:10

Hi,

maybe i found the solution.
Deep- and long-time testing is needed.

I replaced sendEmail with the current version 1.56 from

http://caspian.dotconf.net/menu/Software/SendEmail/.

Now with enabled smtp-auth on both sites (ipcop/copfilter and mailserver) the test-mails send and received succesfully.

I found this interesting post at the hmailserver-forum, which explains in detail whats happen:

http://www.hmailserver.com/forum/viewto ... =7&t=15748

Andy

Post Reply