mail from server being blocked?

Discussion in 'Server Operation' started by palkat, Jan 19, 2006.

  1. palkat

    palkat New Member

    This is a head scratcher for me, been fighting with this for a while.
    I got the ISPconfig on a Suse9.3 install and the Uebimaiu webmail that ISPconfig installed works great email AOL users but we have found that PHP programs like Geeklog and Coppermine Photo Gallery to name a couple can send emails to most all servers and people get the emails from them but not AOL and my brother on roadrunner cable back in NewYork.

    I can send emails to AOL and my brother on Roadrunner perfectly and they get all the emails sent directly from the Ubimail webmail on my server but its those pesky php programs they don't get email from.

    I have gone round an dround with the developtboth GEEKLOG and COPPERMINE PHOTO GALLERY and now turn to you all for any input/help on this.

    Why do the PHP programs seem to get blocked by AOL and roadrunner?

    Thanks.
     
  2. themachine

    themachine HowtoForge Supporter

    Most likely you are using the "mail()" funtion in PHP. And most likely you are not creating proper email headers. Reference the following:

    Code:
    <?php
    
    $to = "to@domain.com";
    $from = "from@domain.com";
    $subject = "Subject Line";
    $msg = "Email Content";
    
    $headers = "From: $from\r\n";
    $headers .= "Reply-To: $from\r\n";
    $headers .= "Return-Path: $from\r\n";
    
    mail ($to,$subject,$msg,$headers);
    
    ?>
    

    Its possible that if your emails are not sending with a proper return path then they are being rejected. However AOL can reject emails for whatever reason they choose... and therefore it would be helpful if you could post the *FULL HEADERS* of the email message that is bouncing back. Please turn on *FULL HEADERS* in your email client, and then copy all headers including the bounce error message to the forum and then we can help you further.
     
  3. palkat

    palkat New Member

    THats just it, I don't get anything bounced back either...the messages just seem to vaporize to aol.
     
  4. falko

    falko Super Moderator

    What about the code that produces the mails? Does it generate full headers? Please post this code here (only the code that generates the emails).
     
  5. till

    till Super Moderator

    Please have a look at the mail log and post the lines that appear when you send an email to AOL with the PHP application.
     
  6. palkat

    palkat New Member

    Here is the code from one program where it will not deliver to AOL. this is GEEKLOG and the code is to send an article to a person via email.

    /**
    * This will email new stories in the topics that the user is interested in
    *
    * In account information the user can specify which topics for which they
    * will receive any new article for in a daily digest.
    *
    * @return void
    */

    function COM_emailUserTopics()
    {
    global $_CONF, $_TABLES, $LANG08, $LANG24;

    $subject = strip_tags( $_CONF['site_name'] . $LANG08[30] . strftime( '%Y-%m-%d', time() ));

    $authors = array();

    // Get users who want stories emailed to them
    $usersql = "SELECT username,email,etids,{$_TABLES['users']}.uid AS uuid "
    . "FROM {$_TABLES['users']}, {$_TABLES['userindex']} "
    . "WHERE {$_TABLES['users']}.uid > 1 AND {$_TABLES['userindex']}.uid = {$_TABLES['users']}.uid AND (etids <> '-') ORDER BY {$_TABLES['users']}.uid";

    $users = DB_query( $usersql );
    $nrows = DB_numRows( $users );

    $lastrun = DB_getItem( $_TABLES['vars'], 'value', "name = 'lastemailedstories'" );

    // For each user, pull the stories they want and email it to them
    for( $x = 1; $x <= $nrows; $x++ )
    {
    $U = DB_fetchArray( $users );

    $storysql = "SELECT sid,uid,date AS day,title,introtext,bodytext "
    . "FROM {$_TABLES['stories']} "
    . "WHERE draft_flag = 0 AND date <= NOW() AND date >= '{$lastrun}'";

    $topicsql = "SELECT tid FROM {$_TABLES['topics']}"
    . COM_getPermSQL( 'WHERE', $U['uuid'] );
    $tresult = DB_query( $topicsql );
    $trows = DB_numRows( $tresult );

    if( $trows == 0 )
    {
    // this user doesn't seem to have access to any topics ...
    continue;
    }

    $TIDS = array();
    for( $i = 1; $i <= $trows; $i++ )
    {
    $T = DB_fetchArray( $tresult );
    $TIDS[] = $T['tid'];
    }

    if( !empty( $U['etids'] ))
    {
    $ETIDS = explode( ' ', $U['etids'] );
    $TIDS = array_intersect( $TIDS, $ETIDS );
    }

    if( sizeof( $TIDS ) > 0)
    {
    $storysql .= " AND (tid IN ('" . implode( "','", $TIDS ) . "'))";
    }

    $storysql .= COM_getPermSQL( 'AND', $U['uuid'] );
    $storysql .= ' ORDER BY featured DESC, date DESC';

    $stories = DB_query( $storysql );
    $nsrows = DB_numRows( $stories );

    if( $nsrows == 0 )
    {
    // If no new stories where pulled for this user, continue with next
    continue;
    }

    $mailtext = $LANG08[29] . strftime( $_CONF['shortdate'], time() ) . "\n";

    for( $y = 0; $y < $nsrows; $y++ )
    {
    // Loop through stories building the requested email message
    $S = DB_fetchArray( $stories );

    $mailtext .= "\n------------------------------\n\n";
    $mailtext .= "$LANG08[31]: "
    . COM_undoSpecialChars( stripslashes( $S['title'] )) . "\n";
    if( $_CONF['contributedbyline'] == 1 )
    {
    if( empty( $authors[$S['uid']] ))
    {
    $storyauthor = DB_getItem( $_TABLES['users'], 'username', "uid = '{$S['uid']}'" );
    $authors[$S['uid']] = $storyauthor;
    }
    else
    {
    $storyauthor = $authors[$S['uid']];
    }
    $mailtext .= "$LANG24[7]: " . $storyauthor . "\n";
    }

    $mailtext .= "$LANG08[32]: " . strftime( $_CONF['date'], strtotime( $S['day' ])) . "\n\n";

    if( $_CONF['emailstorieslength'] > 0 )
    {
    $storytext = COM_undoSpecialChars( stripslashes( strip_tags( $S['introtext'] )));

    if( $_CONF['emailstorieslength'] > 1 )
    {
    if( strlen( $storytext ) > $_CONF['emailstorieslength'] )
    {
    $storytext = substr( $storytext, 0, $_CONF['emailstorieslength'] ) . '...';
    }
    }

    $mailtext .= $storytext . "\n\n";
    }

    $mailtext .= $LANG08[33] . ' ' . COM_buildUrl( $_CONF['site_url']
    . '/article.php?story=' . $S['sid'] ) . "\n";
    }

    $mailtext .= "\n------------------------------\n";
    $mailtext .= "\n$LANG08[34]\n";
    $mailtext .= "\n------------------------------\n";

    $mailto = $U['username'] . ' <' . $U['email'] . '>';

    COM_mail( $mailto, $subject, $mailtext );
    }

    DB_query( "UPDATE {$_TABLES['vars']} SET value = NOW() WHERE name = 'lastemailedstories'" );
    }​
     
  7. palkat

    palkat New Member

    Sorry to be lame but i have not touched the server is soo long and not a linux god would you mind if i ask where would i find the mail log on the server?

    thanks!
     
  8. falko

    falko Super Moderator

    Please post the COM_mail() function, that's where the emails seem to be generated.

    Somewhere in /var/log.
     
  9. till

    till Super Moderator

    The mail log is in the directory /var/log

    Depending on your linux distro, it might be named:

    /var/log/mail
    /var/log/mail.log
    /var/log/mail.info
     
  10. palkat

    palkat New Member

    Alright sorry for the dealy here is a log from the /var/log of the "mail" file

    Note: the log is of 2 mail messages sent the first one from Coppermine Photo Gallery to my AOL account that does not get the messages. This message should be around the 15:34 time stamp.
    the Second message is sent again to the same AOL account but from GEEKLOG bloggin program at 15:37 time frame.

    Jan 31 15:34:47 server1 postfix/pickup[22590]: 5764D2AF1A: uid=30 from=<wwwrun> Jan 31 15:34:47 server1 postfix/cleanup[23644]: 5764D2AF1A:
    message-id=<20060131223446.5764D2AF1A@server1.example.com>
    Jan 31 15:34:47 server1 postfix/qmgr[22591]: 5764D2AF1A:
    from=<wwwrun@server1.example.com>, size=2570, nrcpt=1 (queue active) Jan 31 15:34:47 server1 postfix/smtp[23646]: warning: connect to
    private/tlsmgr: No such file or directory Jan 31 15:34:48 server1 postfix/smtp[23646]: warning: connect to
    private/tlsmgr: No such file or directory Jan 31 15:34:48 server1 postfix/smtp[23646]: warning: problem talking to server private/tlsmgr: No such file or directory Jan 31 15:34:48 server1 postfix/smtp[23646]: warning: no entropy for TLS key
    generation: disabling TLS support
    Jan 31 15:34:49 server1 postfix/smtp[23646]: 5764D2AF1A:
    to=<palkat@aim.com>, relay=mailin-02.mx.aol.com[205.188.155.89], delay=3, status=bounced (host mailin-02.mx.aol.com[205.188.155.89] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:34:49 server1 postfix/cleanup[23644]: EAC392AF19:
    message-id=<20060131223449.EAC392AF19@server1.example.com>
    Jan 31 15:34:49 server1 postfix/qmgr[22591]: 5764D2AF1A: removed Jan 31 15:34:49 server1 postfix/qmgr[22591]: EAC392AF19: from=<>, size=4515,
    nrcpt=1 (queue active)
    Jan 31 15:34:50 server1 postfix/local[23650]: EAC392AF19:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:34:50 server1 postfix/qmgr[22591]: EAC392AF19: removed Jan 31 15:36:03 server1 postfix/pickup[22590]: 0398F2AF17: uid=30 from=<wwwrun> Jan 31 15:36:03 server1 postfix/cleanup[23644]: 0398F2AF17:
    message-id=<20060131223602.0398F2AF17@server1.example.com>
    Jan 31 15:36:03 server1 postfix/qmgr[22591]: 0398F2AF17:
    from=<wwwrun@server1.example.com>, size=2570, nrcpt=1 (queue active) Jan 31 15:36:05 server1 postfix/smtp[23646]: 0398F2AF17:
    to=<palkat@aim.com>, relay=mailin-01.mx.aol.com[205.188.156.185], delay=3, status=bounced (host mailin-01.mx.aol.com[205.188.156.185] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:36:05 server1 postfix/cleanup[23644]: D16DB2AF19:
    message-id=<20060131223605.D16DB2AF19@server1.example.com>
    Jan 31 15:36:05 server1 postfix/qmgr[22591]: D16DB2AF19: from=<>, size=4517,
    nrcpt=1 (queue active)
    Jan 31 15:36:05 server1 postfix/qmgr[22591]: 0398F2AF17: removed Jan 31 15:36:06 server1 postfix/local[23650]: D16DB2AF19:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:36:06 server1 postfix/qmgr[22591]: D16DB2AF19: removed Jan 31 15:36:49 server1 pop3d: Connection, ip=[::ffff:68.35.83.14] Jan 31 15:36:50 server1 pop3d: LOGIN, user=visionscreativematting.com_steve,
    ip=[::ffff:68.35.83.14]
    Jan 31 15:36:51 server1 pop3d: LOGOUT,
    user=visionscreativematting.com_steve, ip=[::ffff:68.35.83.14], top=0, retr=0, time=1 Jan 31 15:37:39 server1 postfix/pickup[22590]: 5C9362AF24: uid=30 from=<wwwrun> Jan 31 15:37:39 server1 postfix/cleanup[23644]: 5C9362AF24:
    message-id=<20060131223739.5C9362AF24@server1.example.com>
    Jan 31 15:37:39 server1 postfix/qmgr[22591]: 5C9362AF24:
    from=<wwwrun@server1.example.com>, size=2070, nrcpt=1 (queue active) Jan 31 15:37:40 server1 postfix/smtp[23646]: 5C9362AF24:
    to=<palkat@aim.com>, relay=mailin-04.mx.aol.com[64.12.138.152], delay=1, status=bounced (host mailin-04.mx.aol.com[64.12.138.152] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:37:40 server1 postfix/cleanup[23644]: D5D612AF25:
    message-id=<20060131223740.D5D612AF25@server1.example.com>
    Jan 31 15:37:40 server1 postfix/qmgr[22591]: 5C9362AF24: removed Jan 31 15:37:40 server1 postfix/qmgr[22591]: D5D612AF25: from=<>, size=3947,
    nrcpt=1 (queue active)
    Jan 31 15:37:41 server1 postfix/local[23650]: D5D612AF25:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:37:41 server1 postfix/qmgr[22591]: D5D612AF25: removed
     
  11. palkat

    palkat New Member

    Alright sorry for the dealy here is a log from the /var/log of the "mail.info" file

    Note: the log is of 2 mail messages sent the first one from Coppermine Photo Gallery to my AOL account that does not get the messages. This message should be around the 15:34 time stamp.
    the Second message is sent again to the same AOL account but from GEEKLOG bloggin program at 15:37 time frame.



    Jan 31 15:34:47 server1 postfix/pickup[22590]: 5764D2AF1A: uid=30 from=<wwwrun> Jan 31 15:34:47 server1 postfix/cleanup[23644]: 5764D2AF1A:
    message-id=<20060131223446.5764D2AF1A@server1.example.com>
    Jan 31 15:34:47 server1 postfix/qmgr[22591]: 5764D2AF1A:
    from=<wwwrun@server1.example.com>, size=2570, nrcpt=1 (queue active) Jan 31 15:34:49 server1 postfix/smtp[23646]: 5764D2AF1A:
    to=<palkat@aim.com>, relay=mailin-02.mx.aol.com[205.188.155.89], delay=3, status=bounced (host mailin-02.mx.aol.com[205.188.155.89] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:34:49 server1 postfix/cleanup[23644]: EAC392AF19:
    message-id=<20060131223449.EAC392AF19@server1.example.com>
    Jan 31 15:34:49 server1 postfix/qmgr[22591]: 5764D2AF1A: removed Jan 31 15:34:49 server1 postfix/qmgr[22591]: EAC392AF19: from=<>, size=4515,
    nrcpt=1 (queue active)
    Jan 31 15:34:50 server1 postfix/local[23650]: EAC392AF19:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:34:50 server1 postfix/qmgr[22591]: EAC392AF19: removed Jan 31 15:36:03 server1 postfix/pickup[22590]: 0398F2AF17: uid=30 from=<wwwrun> Jan 31 15:36:03 server1 postfix/cleanup[23644]: 0398F2AF17:
    message-id=<20060131223602.0398F2AF17@server1.example.com>
    Jan 31 15:36:03 server1 postfix/qmgr[22591]: 0398F2AF17:
    from=<wwwrun@server1.example.com>, size=2570, nrcpt=1 (queue active) Jan 31 15:36:05 server1 postfix/smtp[23646]: 0398F2AF17:
    to=<palkat@aim.com>, relay=mailin-01.mx.aol.com[205.188.156.185], delay=3, status=bounced (host mailin-01.mx.aol.com[205.188.156.185] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:36:05 server1 postfix/cleanup[23644]: D16DB2AF19:
    message-id=<20060131223605.D16DB2AF19@server1.example.com>
    Jan 31 15:36:05 server1 postfix/qmgr[22591]: D16DB2AF19: from=<>, size=4517,
    nrcpt=1 (queue active)
    Jan 31 15:36:05 server1 postfix/qmgr[22591]: 0398F2AF17: removed Jan 31 15:36:06 server1 postfix/local[23650]: D16DB2AF19:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:36:06 server1 postfix/qmgr[22591]: D16DB2AF19: removed Jan 31 15:36:50 server1 pop3d: LOGIN, user=visionscreativematting.com_steve,
    ip=[::ffff:68.35.83.14]
    Jan 31 15:36:51 server1 pop3d: LOGOUT,
    user=visionscreativematting.com_steve, ip=[::ffff:68.35.83.14], top=0, retr=0, time=1 Jan 31 15:37:39 server1 postfix/pickup[22590]: 5C9362AF24: uid=30 from=<wwwrun> Jan 31 15:37:39 server1 postfix/cleanup[23644]: 5C9362AF24:
    message-id=<20060131223739.5C9362AF24@server1.example.com>
    Jan 31 15:37:39 server1 postfix/qmgr[22591]: 5C9362AF24:
    from=<wwwrun@server1.example.com>, size=2070, nrcpt=1 (queue active) Jan 31 15:37:40 server1 postfix/smtp[23646]: 5C9362AF24:
    to=<palkat@aim.com>, relay=mailin-04.mx.aol.com[64.12.138.152], delay=1, status=bounced (host mailin-04.mx.aol.com[64.12.138.152] said: 550 REQUESTED ACTION NOT TAKEN: DNS FAILURE (in reply to MAIL FROM command)) Jan 31 15:37:40 server1 postfix/cleanup[23644]: D5D612AF25:
    message-id=<20060131223740.D5D612AF25@server1.example.com>
    Jan 31 15:37:40 server1 postfix/qmgr[22591]: 5C9362AF24: removed Jan 31 15:37:40 server1 postfix/qmgr[22591]: D5D612AF25: from=<>, size=3947,
    nrcpt=1 (queue active)
    Jan 31 15:37:41 server1 postfix/local[23650]: D5D612AF25:
    to=<root@server1.example.com>, orig_to=<wwwrun@server1.example.com>,
    relay=local, delay=1, status=sent (delivered to maildir) Jan 31 15:37:41 server1 postfix/qmgr[22591]: D5D612AF25: removed
     
  12. falko

    falko Super Moderator

    I found this about AOL's mail policy: http://postmaster.aol.com/trouble/mailer.html
    It says:
    So there seems to be something wrong with the DNS records of the sender domain. What's the sender domain you use?
     
  13. palkat

    palkat New Member

    well looking at the mail logs files i posted i see a lot of xxxx@server1.example.com is that the case? the fact that the server is setup with "server1.example.com" via the ISPconfig install and aol is rejecting it that way. should that be corrected if so how now that the server is already configured.
     
  14. falko

    falko Super Moderator

    You should have taken your own and existing hostname.
    You should check /stc/hosts and /etc/postfix/main.cf for server1.example.com.
    Also, what's the output of
    Code:
    hostname
    and
    Code:
    hostname -f
    ?
     
  15. palkat

    palkat New Member

    Okay my Hostname is: server1

    and my Hostname -F is: server1.example.com
     
  16. palkat

    palkat New Member

    All i found is the /etc/postfix/main.cf and that has the following two entries in there of for SERVER1.EXAMPLE.COM:

    myhostname = server1.$mydomain
    mydomain = example.com

    can these be changed manually in the main.cf file here.

    as for /stc/hosts i don't have a STC folder off my root. this is running on a suse9.3 build if that helps.
     
  17. falko

    falko Super Moderator

    Yes.

    Sorry, I meant /etc/hosts.
     
  18. palkat

    palkat New Member

    Falko:
    here is my /etc/host file:

    #
    # hosts This file describes a number of hostname-to-address
    # mappings for the TCP/IP subsystem. It is mostly
    # used at boot time, when no name servers are running.
    # On small systems, this file can be used instead of a
    # "named" name server.
    # Syntax:
    #
    # IP-Address Full-Qualified-Hostname Short-Hostname #

    127.0.0.1 localhost

    # special IPv6 addresses
    ::1 localhost ipv6-localhost ipv6-loopback

    fe00::0 ipv6-localnet

    ff00::0 ipv6-mcastprefix
    ff02::1 ipv6-allnodes
    ff02::2 ipv6-allrouters
    ff02::3 ipv6-allhosts
    192.168.1.205 server1.example.com server1



    So the question is on this file and the mail files what would i modify if my domain is say "doamin.com" being these files ask for a HOSTNAME and DOMAIN NAME how would i enter it? Sorry to be lame but just not sure on the format.
     
  19. falko

    falko Super Moderator

    You put
    Code:
    <IP_Address> HOSTNAME.DOMAINNAME HOSTNAME
    into /etc/hosts. I'd do it before the IPv6 section in the file, so put the line
    Code:
    192.168.1.205 server1.example.com server1
    right after the 127.0.0.1 line. And I'd also modify the 127.0.0.1 line a little bit:
    Code:
    127.0.0.1 [B][COLOR="Red"]localhost.localdomain[/COLOR][/B] localhost
     
  20. palkat

    palkat New Member

    Falko HELP!!! LOL
     

Share This Page