Turn on thread page Beta
    • Thread Starter
    Offline

    1
    ReputationRep:
    Hi,
    I'm trying to send email from my home server (Debian), but I keep getting failed delivery messages, presumably because I can't authenticate myself. Is it possible to send it through my university's or BT's mail servers? I think this is how Thunderbird etc work.
    Is it just a case of adding a servername to a configuration file or something?
    • Thread Starter
    Offline

    1
    ReputationRep:
    I don't know, I want to be able to send email from my machine using:
    Code:
    mail -s "Subject goes here" [email protected]
    But at the moment I get sending failure messages such as:
    Code:
    ... while talking to bill.lut.ac.uk.:
    >>> RCPT To:<*****@lboro.ac.uk>
    <<< 550-Verification failed for <[email protected]>
    <<< 550-Unrouteable address
    <<< 550 Sender verify failed
    550 5.1.1 <*****@lboro.ac.uk>... User unknown
    
    --l7PIZH54005527.1188066917/fisher.ridethespiral.co.uk
    Content-Type: message/delivery-status
    
    Reporting-MTA: dns; fisher.ridethespiral.co.uk
    Received-From-MTA: DNS; localhost
    Arrival-Date: Sat, 25 Aug 2007 19:34:52 +0100
    
    Final-Recipient: RFC822; *****@lboro.ac.uk
    Action: failed
    Status: 5.1.1
    Remote-MTA: DNS; bill.lut.ac.uk
    Diagnostic-Code: SMTP; 550-Verification failed for <[email protected]
    .co.uk>
    Last-Attempt-Date: Sat, 25 Aug 2007 19:35:17 +0100
    
    --l7PIZH54005527.1188066917/fisher.ridethespiral.co.uk
    So can I send it through an authenticated server such as my uni's or ISP's?
    • Thread Starter
    Offline

    1
    ReputationRep:
    So can I use someone else's?
    Offline

    1
    ReputationRep:
    Email BT and ask them to enable mail relay on your account; ideally you want reverse lookup enabled too, but they wont do that unless you hiost your domain with them; but, i've not seen any issues of it not bieng qualified.
    Offline

    14
    ReputationRep:
    It's best to relay through a reputable host (university and ISP are good choices). If you do it from your home without a dynamic IP address (or even from a domain from, say, dyndns), a lot of SMTP servers come with anti-spam techniques that may class you as bad.

    Another option is to relay through gmail, if you have an account with them.

    You can set up your SMTP server (postfix, sendmail, w/e) to relay all messages through a host by default.

    In postfix you do this by putting relay = smtp.blueyonder.co.uk in /etc/postfix/main.cf (replacing smtp.blueyonder.co.uk with whatever SMTP server you're using).

    Sendmail, no idea, check their manual.
    Offline

    1
    ReputationRep:
    Even with a Static IP addy you can still have real problems - Espeically with AOL!!!
    Yap - ISP SMTP is the way!
    • Thread Starter
    Offline

    1
    ReputationRep:
    OK, I've got somewhere, I added all this to /etc/postfix/main.cf:

    Code:
    relayhost = smtp.gmail.com
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
    smtp_sasl_type = cyrus
    smtp_sasl_security_options = noanonymous
    smtp_sasl_mechanism_filter = !gssapi, !external, static:all
    And now I get this error from Gmail:

    Code:
    <*****@lboro.ac.uk>: host smtp.gmail.com[64.233.183.111] said: 530 5.7.0 Must
        issue a STARTTLS command first 33sm7156739nfu (in reply to MAIL FROM
        command)
    Offline

    14
    ReputationRep:
    (Original post by xeonman9000)
    OK, I've got somewhere, I added all this to /etc/postfix/main.cf:

    Code:
    relayhost = smtp.gmail.com
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
    smtp_sasl_type = cyrus
    smtp_sasl_security_options = noanonymous
    smtp_sasl_mechanism_filter = !gssapi, !external, static:all
    And now I get this error from Gmail:

    Code:
    <*****@lboro.ac.uk>: host smtp.gmail.com[64.233.183.111] said: 530 5.7.0 Must
        issue a STARTTLS command first 33sm7156739nfu (in reply to MAIL FROM
        command)
    If you want to connect to gmail over TLS (which you must, when you want to use gmail as a relay), you have to connect to port 587.

    So, relayhost = smtp.gmail.com:587

    However, you also need to fiddle with certifications and all sorts: http://souptonuts.sourceforge.net/postfix_tutorial.html (this should be useful)

    Using your ISPs SMTP server will be easier (it will most likely authenticate by looking at your IP address, so you won't need to fiddle with TLS).

    However, why are you using a whole SMTP server? Do you have any reasons for running postfix rather than say, msmtp.

    This is just a simple SMTP client which you run (similar to how you use the command mail) and it connects to a relay (gmail, ISP, whatever) and sends the message. No daemon needed.

    If you decide to use msmtp, here's a .msmtprc that will work for gmail:
    Code:
    account gmail
    host smtp.gmail.com
    port 587
    protocol smtp
    auth on
    from [email protected]
    user [email protected]
    password your_password
    tls on
    tls_starttls on
    tls_trust_file /etc/ssl/certs/ThawtePremiumServerCA_b64.txt
    
    account default : gmail
    You'll need to find gmail's certificate (which is the file named ThawtePremiumServerCA_b64.txt). It's used to verify that the host you're connecting to (smtp.gmail.com) is in fact gmail. It's just a slight security feature. If you cba finding this cert, you can use tls_certcheck off which will turn off checking gmail's certs. The connections that your emails are sent down will still be encrypted (that's what tls does) but you won't know if you're actually talking to gmail (it's likely that will be though).

    This is all from what I can remember when I had to set it up (and from looking up tls_certcheck in man msmtp), so it could be wrong.
    • Thread Starter
    Offline

    1
    ReputationRep:
    Thanks for the heads-up, msmtp looks good, but I'm not too sure how to set it up, I installed it via apt-get and created a file ~/.msmtprc like the example you gave, and tried to send a message, but got the following mail back:

    Code:
    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:
    
      *****@lboro.ac.uk
        Mailing to remote domains not supported
    
    ------ This is a copy of the message, including all the headers. ------
    
    Return-path: <[email protected]>
    Received: from root by machine.domain.co.uk with local (Exim 4.63)
            (envelope-from <[email protected]>)
            id 1IPUAd-0001HA-FP
            for *****@lboro.ac.uk; Mon, 27 Aug 2007 03:17:39 +0100
    To: *****@lboro.ac.uk
    Subject: Testing 123
    Message-Id: <[email protected]>
    From: root <[email protected]>
    Date: Mon, 27 Aug 2007 03:17:39 +0100
    I don't think it got as far as Google.
    Offline

    14
    ReputationRep:
    (Original post by xeonman9000)
    Thanks for the heads-up, msmtp looks good, but I'm not too sure how to set it up, I installed it via apt-get and created a file ~/.msmtprc like the example you gave, and tried to send a message, but got the following mail back:

    Code:
    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:
    
      *****@lboro.ac.uk
        Mailing to remote domains not supported
    
    ------ This is a copy of the message, including all the headers. ------
    
    Return-path: <[email protected]>
    Received: from root by machine.domain.co.uk with local (Exim 4.63)
            (envelope-from <[email protected]>)
            id 1IPUAd-0001HA-FP
            for *****@lboro.ac.uk; Mon, 27 Aug 2007 03:17:39 +0100
    To: *****@lboro.ac.uk
    Subject: Testing 123
    Message-Id: <[email protected]>
    From: root <[email protected]>
    Date: Mon, 27 Aug 2007 03:17:39 +0100
    I don't think it got as far as Google.
    What msmtp command did you type?

    You should be doing it like: msmtp [email protected] < message.txt

    where message.txt looks like something like:
    Code:
    From: [email protected]
    To: [email protected]
    Subject: hey
    
    hey, how is it going?
    The first bit is headers, which are needed, the next bit (separated by an empty line) is the actual message.

    I think it'd help if we understood what you actually want. In the end what do you want to be able to do? Be precise in answering this.
 
 
 
Poll
Black Friday: Yay or Nay?

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

Write a reply...
Reply
Hide
Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.