--- extends: application.j2 default_block: help title: woob smtp description: Daemon application able to fetch messages from supported websites and send them by mail. It can also be used to send a reply to a message (on a module which supports this feature), by piping an email to it. short_description: Receive and reply to messages by mail. capability: Messages screenshots: - images/screenshots/smtp.png type: daemon category: daemon --- ### Daemon You just have to run:
$ woob smtp run
Then it will work correctly in background. ### Reply to messages You can also use *woob smtp* to reply to received messages. You just need to pipe an email:
$ cat reply_email.txt | woob smtp post
The *In-Reply-To* header must be defined, to determine to which thread and message you answer. You can also change the *To* username (before the *@*) to select with which backend you want to answer. ## Configuration Create a file named `~/.config/woob/smtp` and add in:
[DEFAULT]
# Interval to check new messages
interval = 300

# Domain of the *From:* email address
domain = woob.example.com

# Recipient of emails
recipient = romain@example.com

# SMTP server to use
smtp = mail.example.org

# Instead of using a SMTP relay, you can enable this setting to pipe mails to
# an external command. It overrides the 'smtp' parameter.
# pipe = procmail

# Send emails in HTML or in plaintext
html = 0
Don't forget to [configure the modules](/modules). ### Use a fake SMTP server If you want reply to a mail with your MUA, you can run woob smtp with the `-S` parameter which run a fake smtp server:
$ woob smtp run -S 2525
> Note: `2525` is the port to listen on Then, add the `localhost:2525` SMTP server to your MUA. When you answer to a woob smtp mail, you can select this. And… that's it! ### Example with Postfix #### main.cf Open `/etc/postfix/main.cf` and add woob.example.org in the `relay_domain`:
relay_domains = mydomain.org woob.example.org
transport_maps= hash:/etc/postfix/transport
#### master.cf Add the *woob* service with this lines at end of file:
woob     unix -        n       n       -       -       pipe
  flags=FR user=rom1
  argv=/usr/local/bin/woob-smtp post
Correctly replace `rom1` by the system user who will run script. #### transport Open `/etc/postfix/transport` and add this line:
woob.example.org     woob:
Do not forget to run this command to make the modification effective:
postmap /etc/postfix/transport
#### Conclusion Restart postfix, and you'll be able to reply to the received messages.