FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » setup a mailing list using Gmail SMTP (is it possible?)
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
setup a mailing list using Gmail SMTP [message #168527] Tue, 14 May 2013 18:41 Go to next message
zarbula is currently offline  zarbula   United States
Messages: 1
Registered: May 2013
Location: Salt Lake City
Karma: 0
Junior Member
I hope I'm writing this in the correct forum, however I'm getting issues trying to get FudForum to accept SMTP mail from a Gmail source.

getting the error:
550-5.7.1 [2607:f8b0:4001:c03::232 11] Our system has detected that this
550-5.7.1 message is not RFC 2822 compliant. To reduce the amount of spam sent
550-5.7.1 to Gmail, this message has been blocked. Please review
550 5.7.1 RFC 2822 specifications for more information. oy9si435122icb.30 - gsmtp

This is when it's attempting to deliver the email. Is there some change I can make to resolve this issue?
Re: setup a mailing list using Gmail SMTP [message #168528 is a reply to message #168527] Tue, 14 May 2013 19:14 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I see lots of users complaining about this all over the Internet.

For example:
http://webapps.stackexchange.com/questions/42771/emails-sent-to-gmail-domai n-suddenly-not-rfc-2822-compliant-possible-to-bypass

In this case the problem was fixed by updating the sendmail installation on the server:
http://wordpress.org/support/topic/gmail-rejected-with-rfc-2822-not-complia nt
Re: setup a mailing list using Gmail SMTP [message #168731 is a reply to message #168528] Tue, 09 July 2013 07:09 Go to previous messageGo to next message
selva is currently offline  selva
Messages: 1
Registered: July 2013
Karma: 0
Junior Member
I am also facing the same problem. For a year it was working fine. Recently it stopped working and giving the above same error? was it solved?

thanks
Re: setup a mailing list using Gmail SMTP [message #169217 is a reply to message #168527] Wed, 11 September 2013 00:54 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

I am getting this error. I was running postfix on a Debian 5 machine, so upgraded to Debian 6 (old-stable) after reading this, but the error continues.

I find it only happens when FUDforum sends an email to a gmail account, if I send an email using the same mail server or even forward on the failed email notice from gmail to the intended gmail user, it works fine. Which leads me to think it is something FUDforum is doing in the way it is composing it's emails.

Thoughts?



Re: setup a mailing list using Gmail SMTP [message #169218 is a reply to message #169217] Wed, 11 September 2013 01:12 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Actually my error message is:

"Please ensure the message is RFC 5322 compliant"

Just got this from hotmail too now.

I send emails to hotmails users (my fiancee uses hotmail) using this mail server all the time, so I am again looking at FUDforums way of composing emails.
I do need to upgrade my FUDforum install, maybe there is a fix for this formatting in the new version...
Re: setup a mailing list using Gmail SMTP [message #169219 is a reply to message #169218] Wed, 11 September 2013 02:05 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

I am trying to see the headers of the emails hotmail is rejecting from FUDforum. I sent an email from the forum to myself and it has these headers.

Return-Path:
X-Original-To:
Delivered-To:
Received:
X-Spam-Checker-Version:
X-Spam-Level:
X-Spam-Status:
Received:
Subject:
Date: Wed, 11 Sep 2013 11:05:
To:
From:
X-Mailer:
From:
Errors-To:
X-Mailer:
MIME-Version:
Content-Type:
Content-Transfer-Encoding:
Reply-To:
Reply-To:
Message-Id:


I am not sure if the double-up of Reply-To is the culprit.

https://moodle.org/mod/forum/discuss.php?d=235943
Re: setup a mailing list using Gmail SMTP [message #169220 is a reply to message #169219] Wed, 11 September 2013 02:07 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Ok I have just found an email that was rejected by Gmail with same error as OP.

It is lacking any Reply-To headers....
Re: setup a mailing list using Gmail SMTP [message #169221 is a reply to message #169220] Wed, 11 September 2013 02:08 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Right so the rejected emails from Hotmail and Gmail have the rejected email attached.
Both the Hotmail and Gmail rejected emails are missing Reply-To headers.

I'll go through these emails and see what other headers might be the issue too.

Re: setup a mailing list using Gmail SMTP [message #169225 is a reply to message #169221] Wed, 11 September 2013 03:19 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Here is the issue it seems. 2 headers are causing issue. The missing return-path is on FUDforum AFAIK. The missing "from" in one of the received headers is the mail server. So I am checking into the latter.


Using this online message syntax checker pasting in a rejected email that was generated from FUDforum...


MIME Lint v1.1.0 2012-09-08 is a strict syntax validator for Internet 
messages including MIME, RFC 5322, DSN (RFC 3464) and MDN (RFC 3798) elements 
which has be run on the attached message.  The result follows:

-----------
WARNING: line too long in header 'Received:' at line 1
ERROR: Missing mandatory item 'from' in header 'Received' at lines 3-4
UNKNOWN: unknown header 'X-Spam-Checker-Version' at line 5
UNKNOWN: unknown header 'X-Spam-Level' at line 6
UNKNOWN: unknown header 'X-Spam-Status' at lines 7-8
WARNING: line too long in header 'Received:' at line 11
UNKNOWN: unknown header 'X-Mailer' at line 16
WARNING: duplicate header 'From' at line 17
WARNING: use SMTP MAIL FROM/return-path instead of non-standard errors-to in 
         header 'Errors-To' at line 18
UNKNOWN: unknown header 'X-Mailer' at line 19
ERROR: missing mandatory header 'return-path' lines 1-23
OK: found part text/plain line 25
WARNING: Content-Transfer-Encoding mislabelled as 8-bit when 7-bit suffices, 
         line 26
-----------

Output lines begin with 'OK:' for informational messages, 'UNKNOWN:' for 
unregistered/unfamiliar extensions which may be incorrect, 'WARNING:' for 
poor usage which is either likely to cause problems or fails the 'generate 
conservative protocol' principle, and 'ERROR:' for standards violations.  If 
your result contains only 'OK:' results, your message passed MIME Lint v1.1.0 
2012-09-08 validation.

There is no guarantee that this validator is free of bugs itself, so feel 
free to contact <chris(dot)newman(at)oracle(dot)com> if you think you found an error in 
the validator or have a good idea to enhance the validator.
Re: setup a mailing list using Gmail SMTP [message #169226 is a reply to message #169225] Wed, 11 September 2013 04:40 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Doing some further header parsing, I think it is the missing Return-Path header that is tripping up my FUDforum.

Looking deeper I see this (wsp04 is my only theme I am using):

include/theme/wsp04/iemail.inc: $header = 'From: '. $from ."\nErrors-To: ". $from ."\nReturn-Path: ". $from ."\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION']. $extra_header. $header


So Return-Path should be included and be between Errors-To and X-Mailer.

But a sample of headers my FUDforum is sending sees it missing.

Received:
Received:
X-Spam-Checker-Version:
X-Spam-Level:
X-Spam-Status:
Received:
Subject:
Date: Wed, 05 Jun 2013 10:34:
To:
From:
X-Mailer:
From:
Errors-To:
X-Mailer:
MIME-Version:
Content-Type:
Content-Transfer-Encoding:
Message-Id:

Re: setup a mailing list using Gmail SMTP [message #169229 is a reply to message #169226] Wed, 11 September 2013 06:34 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
The headers you see are not necessarily all coming from FUDforum. Your MTA may also add/change headers before the message leaves your server.

Add something like this to send_email() in iemail.inc.t and recompile your theme to log headers:
logaction(_uid, 'SEND EMAIL', 0, 'To=['. implode(',', (array)$to) .']<br />Subject=['. $subj .']<br />Headers=['. str_replace("\n", '<br />', htmlentities($header)) .']<br />Message=['. $body .']');
Re: setup a mailing list using Gmail SMTP [message #169230 is a reply to message #169229] Wed, 11 September 2013 07:52 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

naudefj wrote on Wed, 11 September 2013 16:34
The headers you see are not necessarily all coming from FUDforum. Your MTA may also add/change headers before the message leaves your server.

Add something like this to send_email() in iemail.inc.t and recompile your theme to log headers:
logaction(_uid, 'SEND EMAIL', 0, 'To=['. implode(',', (array)$to) .']<br />Subject=['. $subj .']<br />Headers=['. str_replace("\n", '<br />', htmlentities($header)) .']<br />Message=['. $body .']');



Great! Thanks.
Where does it log to?
Re: setup a mailing list using Gmail SMTP [message #169231 is a reply to message #169230] Wed, 11 September 2013 08:12 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

naudefj,

I am adding that line right near the end of that function (send_email) just above the return 1; line. But when I compile the theme it disapears (I think it is being moved up to inside the if (defined('fud_debug')) { stanza (or that was already there).

I am confused as to what rebuilding that theme is doing here.
Re: setup a mailing list using Gmail SMTP [message #169265 is a reply to message #169231] Sun, 15 September 2013 20:27 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Bump
Re: setup a mailing list using Gmail SMTP [message #169271 is a reply to message #169265] Mon, 16 September 2013 17:13 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
You need to add it to iemail.inc.t in the forum's 'src/' directory.
If you add it to files in your 'theme/' directory, it will be overwritten as indicated by the README file.
Re: setup a mailing list using Gmail SMTP [message #169274 is a reply to message #168527] Mon, 16 September 2013 22:23 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Oh ok. Thanks. And where will this additional line log the headers?

Thanks.
Re: setup a mailing list using Gmail SMTP [message #169275 is a reply to message #169274] Tue, 17 September 2013 04:57 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
It will go into the error log.
See documentation at Error Log Viewer.
Re: setup a mailing list using Gmail SMTP [message #169278 is a reply to message #168527] Tue, 17 September 2013 13:41 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   Australia
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Thanks.

Not showing up there for me.

The way I am trying to trigger it, is to find a user with a gmail account in the Admin page. Click "Send E-Mail" and type a test email and click Send Email.

I am getting the failed delivery bounce back emails in my inbox (I am the postmaster) but nothing related is showing in the Error Log.

I'm running FudForum 3.0.3

Re: setup a mailing list using Gmail SMTP [message #169280 is a reply to message #169278] Wed, 18 September 2013 05:39 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
The "Send E-Mail" you see in the User Administration System is a simple HTML mailto link.
If you click on it, your system should lunch an e-mail program to compose and send the mail, thus it cannot be a FUDforum issue.
Re: setup a mailing list using Gmail SMTP [message #169281 is a reply to message #169280] Wed, 18 September 2013 06:46 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Not for me on 3.0.3

It takes me to the below page. Filling out and clicking "E-mail" uses the systems configured MTA (my email server) to send an email to the users configured email address (in this case gmail) and I then get a failed delivery email from my mail server due to RFC 2822 gmail or RFC 5322 hotmail (RFC 5322 superceeds 2822, same core RFC though). I then forward the email to the users email address (using the same email server) and it sends fine. It does point to the way FUDforum is composing email headers.


index.php?t=getfile&id=6358&private=0
  • Attachment: fudforum.png
    (Size: 24.26KB, Downloaded 2413 times)
Re: setup a mailing list using Gmail SMTP [message #169297 is a reply to message #169281] Fri, 20 September 2013 00:27 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Bump
Re: setup a mailing list using Gmail SMTP [message #169302 is a reply to message #169297] Fri, 20 September 2013 16:17 Go to previous messageGo to next message
naudefj is currently offline  naudefj   
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
OK, it's not always a link. You obviously have "Allow E-mail" enabled and I don't.

However, that screen uses the exact same send_mail() function. You should be able log mail with the logaction() function described above. If you're having problems enabling it, let me know via e-mail so I can login to your site to check it out.
Re: setup a mailing list using Gmail SMTP [message #169305 is a reply to message #169302] Mon, 23 September 2013 00:23 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

naudefj wrote on Sat, 21 September 2013 02:17
OK, it's not always a link. You obviously have "Allow E-mail" enabled and I don't.

However, that screen uses the exact same send_mail() function. You should be able log mail with the logaction() function described above. If you're having problems enabling it, let me know via e-mail so I can login to your site to check it out.


It doesn't seem to be logging when I send an email. Just had a new user join now (I have emailed the failed delivery to him myself).

The Error log shows this:

[Error] Information
[Message Sent to User] You should receive instructions in your e-mail in the next few minutes.
[User IP] 101.170.127.245
[Requested URL] http://forums.wspirates.com/index.php?t=reset
[Post-Data] <looks like a long hash>
[Referring Page] https://forums.wspirates.com/index.php?t=reset&S=XXXX


Not recording Headers though.

Thanks for the offer. I'll PM you my email address.

Thanks again.

Re: setup a mailing list using Gmail SMTP [message #169306 is a reply to message #169305] Mon, 23 September 2013 00:24 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Oh I can't see a way to PM you Sad
Re: setup a mailing list using Gmail SMTP [message #169307 is a reply to message #169306] Mon, 23 September 2013 00:59 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

It doesn't seem to matter what I put in the iemail.inc.t file, it is not executed. I am checking and what I am adding is being added to <DATA>/include/theme/wsp04/iemail.inc once I compile it. and wsp04 is the current and only active theme.

I am trying to simply write to a file and that is not doing anything. Feels like this send_email function is not being called.

Edit, I just put some simple code to write to a file at the top of the file (but below the <?php) and it did not run.
I think my email sending on the forum doesn't use this iemail.inc file. Maybe this is part of the problem.


Re: setup a mailing list using Gmail SMTP [message #169308 is a reply to message #169307] Mon, 23 September 2013 03:28 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Running through the RFC5322 lint header checking site (referenced earlier)....

This is the result of the emails sent from the forum

UNKNOWN: unknown header 'Delivered-To' at line 3
ERROR: Missing mandatory item 'from' in header 'Received' at lines 4-5
UNKNOWN: unknown header 'X-Spam-Checker-Version' at line 6
UNKNOWN: unknown header 'X-Spam-Level' at line 7
UNKNOWN: unknown header 'X-Spam-Status' at lines 8-9
WARNING: nested comments unwise in header 'Received' at lines 10-15
UNKNOWN: unknown header 'X-Mailer' at line 20
WARNING: duplicate header 'From' at line 21
WARNING: use SMTP MAIL FROM/return-path instead of non-standard errors-to in 
         header 'Errors-To' at line 22
UNKNOWN: unknown header 'X-Mailer' at line 23
WARNING: duplicate header 'Reply-To' at line 28
OK: found part text/plain line 31
WARNING: Content-Transfer-Encoding mislabelled as 8-bit when 7-bit suffices, 
         line 33


And when pasting in an email I have sent (to a gmail) address using my thunderbird desktop client, using the same smtp server:

UNKNOWN: unknown header 'Delivered-To' at line 3
ERROR: Missing mandatory item 'from' in header 'Received' at lines 4-5
UNKNOWN: unknown header 'X-Spam-Checker-Version' at line 6
UNKNOWN: unknown header 'X-Spam-Level' at line 7
UNKNOWN: unknown header 'X-Spam-Status' at lines 8-9
WARNING: nested comments unwise in header 'Received' at lines 10-15
WARNING: line too long in header 'User-Agent:' at line 19
UNKNOWN: unknown header 'User-Agent' at line 19
UNKNOWN: unknown header 'X-Forwarded-Message-Id' at line 25
OK: found default part text/plain line 27



So looking at that, it seems from the 'duplicate header' line onwards is where the forums headers diverge.


UNKNOWN: unknown header 'X-Mailer' at line 20
WARNING: duplicate header 'From' at line 21
WARNING: use SMTP MAIL FROM/return-path instead of non-standard errors-to in 
         header 'Errors-To' at line 22
UNKNOWN: unknown header 'X-Mailer' at line 23
WARNING: duplicate header 'Reply-To' at line 28
OK: found part text/plain line 31
WARNING: Content-Transfer-Encoding mislabelled as 8-bit when 7-bit suffices, 
         line 33


So there's a few things there. Are we duplicating the "Reply-To" header in FUDforum?
Re: setup a mailing list using Gmail SMTP [message #169309 is a reply to message #169308] Mon, 23 September 2013 04:16 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

UPDATE: I made a change to the headers that are constructed by the send_email function in iemail.inc and so far, so good.

--- /tmp/iemail.inc-orig        2013-09-23 04:14:00.680024261 +0000
+++ /tmp/iemail.inc     2013-09-23 04:13:43.409824908 +0000
@@ -63,7 +63,8 @@
        if (strpos($header, 'MIME-Version') === false) {
                $extra_header = "\nMIME-Version: 1.0\nContent-Type: text/plain; charset=utf-8\nContent-Transfer-Encoding: 8bit". $header;
        }
-       $header = 'From: '. $from ."\nErrors-To: ". $from ."\nReturn-Path: ". $from ."\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION']. $extra_header. $header;
+       //$header = 'From: '. $from ."\nErrors-To: ". $from ."\nReturn-Path: ". $from ."\nX-Mailer: FUDforum v". $GLOBALS['FORUM_VERSION']. $extra_header. $header;
+       $header = $extra_header. $header;
 
        $body = str_replace("\r", '', $body);
        if ($munge_newlines) {



I am suspecting the duplication of the From field might have been it. I am still testing.

Re: setup a mailing list using Gmail SMTP [message #169310 is a reply to message #169309] Mon, 23 September 2013 04:27 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Looks good! Smile
Now, I haven't tested with hotmail yet, but I am hoping it is solved too.

I noticed the email I sent (with only the word body) in the body came through like this in my email client:

MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Reply-To: david(at)dward(dot)us
Reply-To: david(at)dward(dot)us

body



Re: setup a mailing list using Gmail SMTP [message #169311 is a reply to message #169310] Mon, 23 September 2013 04:31 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Just sent an email from the forum to a hotmail user (joined today and I forwarded his confirmation email) and no bounce back.

Very happy here. Looks to be solved.

I am surprised I am the only one with this issue and need to patch FUDforum (3.0.3) to solve it.

Re: setup a mailing list using Gmail SMTP [message #169319 is a reply to message #169311] Wed, 25 September 2013 16:57 Go to previous messageGo to next message
cpreston is currently offline  cpreston   United States
Messages: 160
Registered: July 2012
Location: Oceanside
Karma: 6
Senior Member
Just checking... Are you/we saying this problem does not exist in 3.0.5?
Re: setup a mailing list using Gmail SMTP [message #183103 is a reply to message #169319] Wed, 09 October 2013 03:56 Go to previous messageGo to next message
DaveQB is currently offline  DaveQB   
Messages: 109
Registered: January 2006
Location: Sydney
Karma: 0
Senior Member

Not sure. You'd have to check the iemail.inc that comes with that version for the patch I have posted in this forum.

Re: setup a mailing list using Gmail SMTP [message #186514 is a reply to message #183103] Sun, 31 August 2014 20:32 Go to previous message
demaglio is currently offline  demaglio   Italy
Messages: 7
Registered: August 2014
Karma: 0
Junior Member
Hi, I have this problem with fudforum 3.0.5
I use DaveQB patch and In the source of the mail I have
header
\n
extra header
so I have substitute
if ($header) {
$header = "\n" . str_replace("\r", '', $header);
}
with
if ($header) {
$header = str_replace("\r", '', $header);
}

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: fudform.org account issue
Next Topic: Display a single thread on index page
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 18:54:41 GMT 2024

Total time taken to generate the page: 0.02706 seconds