Postfix

From StatusNet
Jump to: navigation, search

Setting up Postfix for wildcarded incoming email

Setting up a custom transport in the master.cf' will enable a wildcarded setup for incoming StatusNet emails.

First, add this setting to your main.cf:

transport_maps = hash:/etc/postfix/transports
local_recipient_maps =

Create /etc/postfix/transports or add an entry to the existing file for the domain that will be StatusNet's incoming email domain:

yourdomain.com  statusnet:

Then, create a db hash file from the transports file you just created or edited (run the following in /etc/postfix):

sudo postmap hash:transports

And load it into postfix

sudo newaliases

StatusNet is the name of your custom transport. Define the transport in master.cf:

statusnet   unix  -       n       n       -       -       pipe
flags=R user=statusnet_user argv=/path/to/statusnet/htdocs/scripts/maildaemon.php

statusnet_user is whatever user that you designate to have execute permissions to the maildaemon script. (www-data on debian/ubuntu systems)

Finally, reload or restart postfix:

sudo /etc/init.d/postfix restart

A final note on setting up Laconi.ca for posting from email. The account's registered address is where the email needs to come from - i.e., if your account is registered with foobox@gmail.com, you aren't going to be be able to send an email from your work account. Otherwise, you will receive the following:

This is the mail system at host blarg.foo.tld.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

The mail system

<D5JF7U2FA5NX8@blarg.foo.tld>: Command died with status 1:
"/var/www/statusnet/scripts/maildaemon.php". Command output: Not a
registered user.

Final-Recipient: rfc822; D5JF7U2FA5NX8@blarg.foo.tld
Original-Recipient: rfc822;D5JF7U2FA5NX8@blarg.foo.tld
Action: failed
Status: 5.3.0
Diagnostic-Code: x-unix; Not a registered user.

Setting up Postfix for wildcarded incoming email (deprecated)

Setting up a custom transport in the master.cf will enable a wildcarded setup for statusnet incoming email. First, add this setting to your main.cf:

transport_maps = hash:/etc/postfix/transports

In /etc/postfix/transports add an entry for the domain that will be statusnet's incoming email domain:

transport_maps = hash:/etc/postfix/transports
yourdomain.com  statusnet:

is the name of your custom transport. Define the transport in master.cf:

transport_maps = hash:/etc/postfix/transports
yourdomain.com  statusnet:
statusnet
transport_maps = hash:/etc/postfix/transports
yourdomain.com  statusnet:
statusnet
statusnet   unix  -       n       n       -       -       pipe
flags=R user=statusnet_user argv=/var/www/statusnet/htdocs/scripts/maildaemon.php

is whatever user that you designate to have execute permissions to the maildaemon script.

transport_maps = hash:/etc/postfix/transports
yourdomain.com  statusnet:
statusnet
statusnet   unix  -       n       n       -       -       pipe
flags=R user=statusnet_user argv=/var/www/statusnet/htdocs/scripts/maildaemon.php
statusnet_user

This error

Recipient address rejected: User unknown in local recipient table

Is fixed with this

local_recipient_maps =
Personal tools
Namespaces
Variants
Actions
Navigation
Status.net
Toolbox