Page 3 of 3 FirstFirst 123
Results 21 to 27 of 27

Thread: Email Server

  1. #21
    Join Date
    Mar 2012
    Location
    Washington
    Beans
    43
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Exclamation Re: Email Server

    Ok, will do. But when someone signs up for my webmail, they can't log in right away because I have to send them a welcome email to create their mailbox. Is there a way to automatically send a welcome email to new users?

  2. #22
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,858
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Email Server

    Quote Originally Posted by cesar98026 View Post
    Ok, will do. But when someone signs up for my webmail, they can't log in right away because I have to send them a welcome email to create their mailbox. Is there a way to automatically send a welcome email to new users?
    As I said, before:

    Quote Originally Posted by SeijiSensei View Post
    Your configuration seems to use a database backend for accounts. If so, you could write a set of PHP applications to enable people to create accounts online.
    I don't know how you intend to have them sign up online without writing some type of forms-processing application. It sounds like you also expect them to have an email address somewhere else already; otherwise where would you send the welcome notice?

  3. #23
    Join Date
    Mar 2012
    Location
    Washington
    Beans
    43
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Exclamation Re: Email Server

    Quote Originally Posted by SeijiSensei View Post
    As I said, before:



    I don't know how you intend to have them sign up online without writing some type of forms-processing application. It sounds like you also expect them to have an email address somewhere else already; otherwise where would you send the welcome notice?
    I already have a online form for signing up, but before any mailbox is created they have to have a email sent to their @emailyourafriend.com address to create the mailbox. Even if you manually put the entries in the mail database, their mailboxes arn't created. Is there a way around this? Does postfix or courier handle mailbox creation?

  4. #24
    Join Date
    Mar 2012
    Location
    Washington
    Beans
    43
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Exclamation Re: Email Server

    Quote Originally Posted by cesar98026 View Post
    I already have a online form for signing up, but before any mailbox is created they have to have a email sent to their @emailyourafriend.com address to create the mailbox. Even if you manually put the entries in the mail database, their mailboxes arn't created. Is there a way around this? Does postfix or courier handle mailbox creation?
    I really, really feel like a dummy. I underestimated PHP... The simple mail() function! So when somebody signs up a welcome email is automatically sent to their @emailyourafriend.com address to create the mailbox!

  5. #25
    Join Date
    Mar 2012
    Location
    Washington
    Beans
    43
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Lightbulb Re: Email Server

    A few months after I got it figured out, something went wrong!
    This is the code I got:
    mail.php
    PHP Code:
    <?php
     $to 
    "$fname@emailyourafriend.com";
     
    $subject "Welcome!";
     
    $message "Hello! blah....";
     
    $from "ask@emailyourafriend.com";
     
    $headers "From: The EmailFriend Team" $from;
     
    mail($to,$subject,$message,$headers);
     echo 
    "Mail Sent.";
     
    ?>
    This is not working, or maybe it is... It's not sending emails. In the mail.log, I got this:
    postfix/sendmail[22306]: fatal: Recipient addresses must be specified on the command line or via the -t option

    However, if I make a simple mail() php script using an existing email address, it works!
    This is what is including it:
    PHP Code:
    <?php

    session_start
    ();

    include(
    'connection.php');
    include(
    'mail.php');

    $fname=$_POST['fname'];

    $lname=$_POST['lname'];

    $address=$_POST['address'];

    mysql_query("INSERT INTO users(id, name, maildir, crypt)VALUES('$fname@emailyourafriend.com', '$lname', '$fname/', ENCRYPT('$address') );");
    mysql_query("INSERT INTO aliases (mail,destination) VALUES
        ('
    $fname@emailyourafriend.com','$fname@emailyourafriend.com') );");

    header("location: index.php?remarks=success");

    mysql_close($con);
    :
    confused:
     
    ?>
    It does enter stuff into the database but not sending the emails!

  6. #26
    Join Date
    Nov 2008
    Location
    Metro Boston
    Beans
    9,858
    Distro
    Kubuntu 14.04 Trusty Tahr

    Re: Email Server

    Quote Originally Posted by cesar98026 View Post
    Code:
    $from = "ask@emailyourafriend.com";
    $headers = "From: The EmailFriend Team" . $from;
    I don't know if this is the problem, but the From header this generates does not comply with the standard. The email address must be enclosed in angle brackets:

    Code:
    $headers = "From: The EmailFriend Team <".$from.">";
    If you ask for help, please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  7. #27
    Join Date
    Mar 2012
    Location
    Washington
    Beans
    43
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Exclamation Re: Email Server

    I fixed it by adding a line in php.ini.... I was locking down my server more and came across S/MIME. I was wondering if I should implement S/MIME in my email service? I already have things like TLS and SASL, etc. Also, do you have any suggestions for more security? How do I get clear passwords out of mail.log?
    Last edited by cesar98026; November 22nd, 2012 at 06:03 AM. Reason: Found a big security problem

Page 3 of 3 FirstFirst 123

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •