Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Problem with contact form by SMTP and Sendmail  (Read 11496 times)

0 Members and 1 Guest are viewing this topic.

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Problem with contact form by SMTP and Sendmail
« on: November 05, 2012, 04:52:47 PM »

From several weeks I have problem with Contact form. I wrote about my problem here: http://forum.coppermine-gallery.net/index.php/topic,75030.msg363790.html#msg363790

Earlier I used SMTP settings (smtp.poczta.onet.pl:587 + username + password). All was OK till my email operator changed anti-spam protections. After that change all emails sent from my website were stopped. I asked my email operator about this problem and got answer:
Quote
In "From" field must be email address authorized in SPF filter - in this case onet.pl
The problem is in both cases: when checkbox "Use the sender's email address as "from" address" os setting ON and OFF


When I change Email settings to Sendmail I receive email:

Mail delivery failed: returning message to sender

Quote
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  jwidla@onet.eu
    SMTP error from remote mail server after RCPT TO:<jwidla@onet.eu>:
    host mx.poczta.onet.pl [213.180.147.146]: 554 5.7.1 <jwidla@onet.eu>:
    Recipient address rejected: Spf check: fail

------ This is a copy of the message, including all the headers. ------

Return-path: <jwidla@onet.eu>
Received: from nobody by beta2.fc.pl with local (Exim 4.80)
(envelope-from <jwidla@onet.eu>)
id 1TVNiy-0005Ob-Vx
for jwidla@onet.eu; Mon, 05 Nov 2012 15:32:25 +0100
To: jwidla@onet.eu
Subject: Topic
Date: Mon, 5 Nov 2012 15:32:24 +0100
From: "jwidla@onet.eu" <jwidla@onet.eu>
Message-ID: <1567efa6ea430920e3e28b3abbcc9077@car-brochures. one.pl>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.4]
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_1567efa6ea430920e3e28b3abbcc9077"

--b1_1567efa6ea430920e3e28b3abbcc9077
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: 8bit

Ta wiadomo���� zosta��a wys��ana na 2012-11-05 15:32:24 za pomoc�� formularza kontaktowego dost��pnego na http://www.car-brochures.one.pl/contact.php z adresu IP 81.15.192.154
The go���� named "My name" with the email address jwidla@onet.eu said:
Message


--b1_1567efa6ea430920e3e28b3abbcc9077
Content-Type: text/html; charset = "utf-8"
Content-Transfer-Encoding: 8bit

Ta wiadomo���� zosta��a wys��ana na 2012-11-05 15:32:24 za pomoc�� formularza kontaktowego dost��pnego na http://www.car-brochures.one.pl/contact.php z adresu IP 81.15.192.154<br /><br />
The go���� named &laquo;My name&raquo; with the email address jwidla@onet.eu said:<br /><br />
<div style="border:1px solid black">Message</div>



--b1_1567efa6ea430920e3e28b3abbcc9077--


Here is my website: www.car-brochures.one.pl
I Enabled debug mode for everyone.
Now I`m using "Sendmail"

Do you have any idea how to solve the problem?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #1 on: November 20, 2012, 11:17:56 AM »

Quote
In "From" field must be email address authorized in SPF filter - in this case onet.pl

Quote
    SMTP error from remote mail server after RCPT TO:<jwidla@onet.eu>:
    host mx.poczta.onet.pl [213.180.147.146]: 554 5.7.1 <jwidla@onet.eu>:
    Recipient address rejected: Spf check: fail

Please review your Coppermine setting "Gallery administrator email". I assume it's currently jwidla@onet.eu but has to be something like jwidla@onet.pl.
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #2 on: November 20, 2012, 12:07:06 PM »

Address jwidla@onet.eu is correct and is providing by onet.pl
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #3 on: November 20, 2012, 01:04:12 PM »

But your email provider doesn't allow onet.eu addresses as from address. Of course we could hard-code a different email address as sender address (e.g. no-reply@onet.pl) if you don't have a valid @onet.pl address.
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #4 on: November 20, 2012, 02:25:52 PM »

It could work... How to change it?
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #5 on: November 20, 2012, 03:37:31 PM »

Open include/mailer.inc.php, find
Code: [Select]
$sender_email = CPGPluginAPI::filter('cpg_mail_sender_email', $sender_email);and below, add something like
Code: [Select]
$sender_email = 'no-reply@onet.pl';
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #6 on: November 20, 2012, 10:17:50 PM »

Doesn`t work :(

Mistake:
Quote
File: /home/qba/public_html/automobilia/contact.php - Line: 211

Debug mode:
Code: [Select]
USER:
------------------
Array
(
    [ID] => 9a0b80df7a69c07cf2a664c62553914c
    [am] => 1
    [lang] => polish
    [liv_a] => Array
        (
            [0] => 272
            [1] => 302
            [2] => 216
            [3] => 57
            [4] => 214
        )

    [liv] => Array
        (
        )

)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 0
    [user_name] => Guest
    [groups] => Array
        (
            [0] => 3
        )

    [group_quota] => 0
    [can_rate_pictures] => 1
    [can_send_ecards] => 0
    [can_post_comments] => 0
    [can_upload_pictures] => 0
    [can_create_albums] => 0
    [pub_upl_need_approval] => 1
    [priv_upl_need_approval] => 1
    [access_level] => 3
    [disk_max] => 0
    [disk_min] => 0
    [has_admin_access] => 0
    [group_name] => Guests
    [can_create_public_albums] => 1
    [can_see_all_albums] => 0
    [group_id] => 3
    [allowed_albums] => Array
        (
        )

)

==========================
Queries:
------------------
Array
(
    [0] => SELECT name, value FROM cpg15x_config [include/init.inc.php:179] (0 ms)
    [1] => SELECT * FROM cpg15x_plugins ORDER BY priority [include/plugin_api.inc.php:52] (0 ms)
    [2] => SELECT * FROM cpg15x_plugins [plugins/xfeed/include/load_xfdset.php:24] (0 ms)
    [3] => SELECT * FROM cpg15x_plugin_xfeeds [plugins/xfeed/include/load_xfdset.php:34] (0 ms)
    [4] => SELECT * FROM cpg15x_plugins [plugins/enlargeit/include/load_enlargeitset.php:17] (0 ms)
    [5] => SELECT * FROM cpg15x_plugin_enlargeit [plugins/enlargeit/include/load_enlargeitset.php:27] (0 ms)
    [6] => SELECT user_id, time FROM `qba_copp15x`.cpg15x_sessions WHERE session_id = 'feac7883d35ef31782a6ea1f9b586d8c' [bridge/coppermine.inc.php:263] (0 ms)
    [7] => SELECT user_id, user_password FROM `qba_copp15x`.cpg15x_users WHERE user_id = 0 [bridge/coppermine.inc.php:275] (0 ms)
    [8] => SELECT MAX(group_quota) AS disk_max, MIN(group_quota) AS disk_min, MAX(can_rate_pictures) AS can_rate_pictures, MAX(can_send_ecards) AS can_send_ecards, MAX(can_post_comments) AS can_post_comments, MAX(can_upload_pictures) AS can_upload_pictures, MAX(can_create_albums) AS can_create_albums, MAX(has_admin_access) AS has_admin_access, MAX(access_level) AS access_level, MIN(pub_upl_need_approval) AS pub_upl_need_approval, MIN( priv_upl_need_approval) AS  priv_upl_need_approval FROM cpg15x_usergroups WHERE group_id in (3) [bridge/udb_base.inc.php:323] (0 ms)
    [9] => SELECT group_name FROM cpg15x_usergroups WHERE group_id= 3 [bridge/udb_base.inc.php:327] (0 ms)
    [10] => SELECT COUNT(*) FROM cpg15x_categorymap WHERE group_id in (3) [bridge/udb_base.inc.php:340] (0 ms)
    [11] => UPDATE `qba_copp15x`.cpg15x_sessions SET time = 1353442571 WHERE session_id = 'feac7883d35ef31782a6ea1f9b586d8c' [bridge/coppermine.inc.php:320] (222 ms)
    [12] => SELECT aid FROM cpg15x_albums WHERE moderator_group IN (3) [include/init.inc.php:269] (330 ms)
    [13] => SELECT description from cpg15x_albums WHERE aid='' [themes/chaoticsoul/theme.php:1223] (0 ms)
    [14] => SELECT lang_id FROM cpg15x_languages WHERE enabled='YES' [include/init.inc.php:327] (0 ms)
    [15] => SHOW TABLES LIKE 'cpg15x_languages' [include/functions.inc.php:4159] (0 ms)
    [16] => SELECT * FROM cpg15x_languages [include/functions.inc.php:4166] (0 ms)
    [17] => DELETE FROM cpg15x_banned WHERE expiry < '2012-11-20 21:16:12' [include/init.inc.php:441] (0 ms)
    [18] => SELECT null FROM cpg15x_banned WHERE ('83.29.17.168' LIKE ip_addr ) AND brute_force=0 LIMIT 1 [include/init.inc.php:457] (0 ms)
    [19] => SELECT aid FROM cpg15x_albums WHERE (1  AND visibility != 0 AND visibility != 10000 AND visibility NOT IN (3)) [include/functions.inc.php:976] (0 ms)
)

==========================
GET :
------------------
Array
(
)

==========================
POST :
------------------
Array
(
    [sender_name] => Imię
    [sender_email] => walwid.tuning@op.pl
    [subject] => Temat wiadomości
    [message] => wiadomość
    [referer] => index.php?message_id=9c4a833667c151958189a538c9ef0da9&message_icon=info
    [form_token] => aef7107c920d55b1014980a415f4f6de
    [timestamp] => 1353442535
    [submit] => wyślij
)

==========================
COOKIE :
------------------
Array
(
    [cpg15x_ext_stats] => no
    [__utma] => 71931265.1412981766.1349635779.1351190497.1351968045.8
    [__utmz] => 71931265.1351968045.8.8.utmcsr=qba.fc.pl|utmccn=(referral)|utmcmd=referral|utmcct=/garage/
    [b780142ecb7b25722ad1e8f462d46cf8] => d990a7ef6db777ecf8aa9e73c697ce0d
    [8b2efd62c876c01430c6297de390ec34] => 2cf3f10583d00d12354d0a6bf26cc1fd
    [cpg15x_data] => YTo1OntzOjI6IklEIjtzOjMyOiI5YTBiODBkZjdhNjljMDdjZjJhNjY0YzYyNTUzOTE0YyI7czoyOiJhbSI7aToxO3M6NDoibGFuZyI7czo2OiJwb2xpc2giO3M6NToibGl2X2EiO2E6NTp7aTowO2k6MjcyO2k6MTtpOjMwMjtpOjI7aToyMTY7aTozO2k6NTc7aTo0O2k6MjE0O31zOjM6ImxpdiI7YTowOnt9fQ==
)

==========================
               
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #7 on: November 21, 2012, 03:49:22 PM »

Please post the complete error message, not just a part.

I just tested the contact form at your gallery and I got
Quote
Your email has been sent.
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #8 on: November 21, 2012, 04:28:09 PM »

Andre, I changed to "sendmail" option for night time. Now I came back to "smtp" option.

You sent me email whrn was turned on option "sendmail" and it came to my mailbox in this shape:
Code: [Select]
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  jwidla@onet.eu
    SMTP error from remote mail server after RCPT TO:<jwidla@onet.eu>:
    host mx.poczta.onet.pl [213.180.147.146]: 554 5.7.1 <jwidla@onet.eu>:
    Recipient address rejected: Spf check: fail

------ This is a copy of the message, including all the headers. ------

Return-path: <jwidla@onet.eu>
Received: from nobody by beta2.fc.pl with local (Exim 4.80)
(envelope-from <jwidla@onet.eu>)
id 1TbAeL-00063S-7G
for jwidla@onet.eu; Wed, 21 Nov 2012 14:47:34 +0100
To: jwidla@onet.eu
Subject: test
Date: Wed, 21 Nov 2012 14:47:32 +0100
From: "jwidla@onet.eu" <no-reply@onet.pl>
Message-ID: <cf4141c5738767e837212ae78641fee5@www.car-brochu res.one.pl>
X-Priority: 3
X-Mailer: PHPMailer (phpmailer.sourceforge.net) [version 2.0.4]
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_cf4141c5738767e837212ae78641fee5"

--b1_cf4141c5738767e837212ae78641fee5
Content-Type: text/plain; charset = "utf-8"
Content-Transfer-Encoding: 8bit

This email was sent at 2012-11-21 14:47:32 using the contact form at http://www.car-brochures.one.pl/contact.php from the IP address 89.16.137.122
The guest named "test" with the email address test@test.com said:
test


--b1_cf4141c5738767e837212ae78641fee5
Content-Type: text/html; charset = "utf-8"
Content-Transfer-Encoding: 8bit

This email was sent at 2012-11-21 14:47:32 using the contact form at http://www.car-brochures.one.pl/contact.php from the IP address 89.16.137.122<br /><br />
The guest named &laquo;test&raquo; with the email address test@test.com said:<br /><br />
<div style="border:1px solid black">test</div>

--b1_cf4141c5738767e837212ae78641fee5--


Now I`ve changed sending emails by smtp.

Result:
Quote
ErrorFailed to send email. Please try again later.

File: /home/qba/public_html/automobilia/contact.php - Line: 211
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #9 on: November 21, 2012, 06:22:00 PM »

So sendmail works as expected?
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #10 on: November 21, 2012, 07:24:51 PM »

Sendemail works with result as above (not so good)

SMTP doesn`t work
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #11 on: November 21, 2012, 07:41:51 PM »

Sorry, I somehow thought that my email was delivered, which is obviously not the case.

Please attach your modified include/mailer.inc.php file as zip file to your next reply.
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #12 on: November 21, 2012, 09:40:00 PM »

The mailer.inc.zip file
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #13 on: November 27, 2012, 04:26:33 PM »

Open include/mailer.inc.php, find
Code: [Select]
$mail->Sender = $CONFIG['gallery_admin_email'];and replace with
Code: [Select]
$mail->Sender = 'no-reply@onet.pl';
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #14 on: December 08, 2012, 11:12:34 PM »

Unfortunatly still doesn`t work :(
Logged

qba

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 56
Re: Problem with contact form by SMTP and Sendmail
« Reply #15 on: December 08, 2012, 11:16:02 PM »

Quote
Error Failed to send email. Please try again later.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15277
Re: Problem with contact form by SMTP and Sendmail
« Reply #16 on: December 10, 2012, 02:34:05 PM »

Does the PHP function mail works as expected?
Logged
Pages: [1]   Go Up
 

Page created in 0.098 seconds with 20 queries.