2

I've been using fetchmail and postfix for a long time to receive and sent email from my private Linux box. My ISP was acquired and merged several times, but the original SMTP host always kept working. Now I have to switch to a new host for outgoing mail (mail.o2mail.de), and this one doesn't let me send mail:

550 5.7.1 <RECIPIENT>... Relaying denied: You must check for new mail before sending mail. (in reply to RCPT TO command)

So the server wants me to check for incoming mail before sending outgoing mail. If I understand correctly, this workflow is intended for desktop Mail programs like Windows LiveMail or KMail, which do in fact always receive and send email in the same session. But I've never done this, and I don't know how to (I receive mail by polling via fetchmail, and that's still working fine).

I suppose I could use the provider's webmail interface, or switch to a standalone email client; but I like using emacs and VM to send and receive email. I like the power of emacs for composing text, I like grepping through plain text mailboxes, I like being able to configure the user experience with elisp...

I may be old-fashioned, but isn't there a way I can keep doing things the way I like? Can postfix somehow be made to behave like one of those newfangled all-in-one email programs? What should I put into /etc/postfix/main.cf so that my provider will accept my outgoing mail?

Edit Things I've tried unsuccessfully:

  • using port 465: gets the error "CLIENT wrappermode (port smtps/465) is unimplemented; instead, send to (port submission/587) with STARTTLS"
  • using port 587 as instructed: this causes exactly the same "Relaying denied" error as using port 25.

I can't get out of the contract with my ISP quickly (years, not months). I do have a gmail address, although I rarely use it. Can I somehow use Google's service for sending email via postfix instead?

Edit It turns out that "Relaying denied" occurs only when the user connects in plain text. By telling postfix to connect via ssl and providing my account credentials, the remote server trusts me enough to accept messages from me to anyone. (The only puzzle is why their previous server ever accepted plain text logons in the first place, which now seems horribly unsafe to me.)

So the solution is essentially to add

smtp_sasl_auth_enable = yes
smtp_sasl_security_options = 
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

to /etc/postfix/main.cf and provide the logon credentials in that file.

  • Your ISP probably provides other ports like 465 that wont have this microsoft exchange problem. If you need SSL or login you should look at msmtp. It is a simple client to send a mail over all sorts of smtp. Your only emacs change is (setq sendmail-program "/usr/bin/msmtp"). – meuh Oct 26 '16 at 19:46
  • What is format of login info in /etc/postfix/sasl_passwd ? – gvanto May 12 at 19:30
2

This is a matter of trust, relaying means that the mailhost you connect to will send your mail to other domains. There are two ways to make it work: adding your machine to the configuration of the mailhost, or using other authentication per user (username/password) If you can send mail using this mailhost from the desktop, then try to configure the authentication in postfix.

  • I would love to do this, since it would change my existing workflow the least. Is this the route that some tutorials describe when they mention smtp_sasl_auth_enable and related options in postfix/main.cf? – Kilian Foth Oct 27 '16 at 5:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.