Difference between revisions of "Fdm"

From ArchWiki
Jump to: navigation, search
(Final setup: sounds like a tip)
m (Style fixes.)
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:fdm}}
 
{{DISPLAYTITLE:fdm}}
[[Category:Email Client (English)]]
+
[[Category:Email Client]]
 
+
<!-- {{i18n|fdm}} (uncomment when translations exist) -->
+
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|A guide on using fdm for the purpose of local mail delivery.}}
 
{{Article summary text|A guide on using fdm for the purpose of local mail delivery.}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Alpine}}
 
{{Article summary wiki|Alpine}}
{{Article summary wiki|MSMTP}}
+
{{Article summary wiki|msmtp}}
 
{{Article summary wiki|Mutt}}
 
{{Article summary wiki|Mutt}}
 
{{Article summary wiki|Postfix}}
 
{{Article summary wiki|Postfix}}
Line 13: Line 11:
 
{{Article summary end}}
 
{{Article summary end}}
  
'''fdm''', or ''f''etch and ''d''eliver ''m''ail, is a simple program for delivering and filtering mail. Comparing it to other same-purposed applications shows that it has similarities with [[Mutt]]'s very focused design principles.
+
'''fdm''' (''fetch and deliver mail''), is a simple program for delivering and filtering mail. Comparing it to other same-purposed applications shows that it has similarities with [[Mutt]]'s very focused design principles.
  
==Installing==
+
== Installing ==
Install {{package Official|fdm}} package with [[pacman]]:
+
# pacman -S fdm
+
  
==Configuring==
+
Install {{Pkg|fdm}} from the [[official repositories]].
fdm supports the tried and tested mbox format along with the newer maildir specification.
+
 
 +
== Configuring ==
 +
 
 +
''fdm'' supports the tried and tested mbox format along with the newer maildir specification.
 +
 
 +
=== mbox ===
  
===mbox===
 
 
Alpine uses the mbox format, so we need to set up some files that we will be editing.
 
Alpine uses the mbox format, so we need to set up some files that we will be editing.
 
  $ cd
 
  $ cd
Line 29: Line 29:
 
  $ chmod 600 .fdm.conf mail/INBOX
 
  $ chmod 600 .fdm.conf mail/INBOX
  
===maildir===
+
=== maildir ===
 +
 
 
Mutt prefers a capitized mail directory, and is able to use the maildir format. If you plan on using Mutt do the following setup.
 
Mutt prefers a capitized mail directory, and is able to use the maildir format. If you plan on using Mutt do the following setup.
 
  $ cd
 
  $ cd
Line 35: Line 36:
 
  $ mkdir -p Mail/INBOX/{new,cur,tmp}
 
  $ mkdir -p Mail/INBOX/{new,cur,tmp}
  
===Final setup===
+
=== Final setup ===
Edit .fdm.conf, and add your email accounts and basic filter rules. Use mbox or maildir, but not both.
+
 
 +
Edit {{ic|.fdm.conf}}, and add your email accounts and basic filter rules. Use mbox or maildir, but not both.
 
  ## .fdm.conf
 
  ## .fdm.conf
 
  ## Accounts and rules for:
 
  ## Accounts and rules for:
Line 57: Line 59:
 
  match all action "inbox"
 
  match all action "inbox"
  
This will collect the mail from the listed accounts and deliver it to the INBOX folder that we made. Refer to the {{Ic|fdm(1)}} man page for specifics on how to connect to other types of mail servers (POP3 for example).
+
This will collect the mail from the listed accounts and deliver it to the INBOX folder that we made. Refer to the {{ic|fdm(1)}} man page for specifics on how to connect to other types of mail servers (POP3 for example).
  
 
{{Tip|You can also specify your login name and/or password in the {{ic|.netrc}} file.}}
 
{{Tip|You can also specify your login name and/or password in the {{ic|.netrc}} file.}}
  
==Testing==
+
== Testing ==
 +
 
 
Once you have this setup to your satisfaction, attempt to collect your mail by manually running fdm.
 
Once you have this setup to your satisfaction, attempt to collect your mail by manually running fdm.
 
  $ fdm -kv fetch
 
  $ fdm -kv fetch
  
This will keep your mail untouched on the server incase there are errors. Look over the output to make sure everyting worked as planned. Open your favorite mail reader (MUA) and make sure that you can read the mail that was just delivered.  
+
This will keep your mail untouched on the server incase there are errors. Look over the output to make sure everything worked as planned. Open your favorite mail reader (MUA) and make sure that you can read the mail that was just delivered.  
  
==Extended usage==
+
== Extended usage ==
''Non-essential features that add to fdm's usability''
+
  
===Additional Filtering===
+
''Non-essential features that add to ''fdm'''s usability''
If you want to have mail from a certain account go to a specific mailbox, you could add the following lines to your fdm.conf file. From the config file above, if you wanted to filter the mail from {{Ic|bar@gmail.com}} into it's own folder {{Ic|bar-mail}}, you would add this below the existing "action" line:
+
  
action "bar-deliver" mbox "%h/mail/bar-mail"
+
=== Additional filtering ===
  
Change the {{Ic|mbox}} to {{Ic|maildir}} if needed, also make sure the path is correct.
+
If you want to have mail from a certain account go to a specific mailbox, you could add the following lines to your fdm.conf file. From the config file above, if you wanted to filter the mail from {{ic|''bar@gmail.com''}} into it's own folder {{ic|''bar-mail''}}, you would add this below the existing "action" line:
 +
 
 +
action ''bar-deliver'' mbox "%h/mail/''bar-mail''"
 +
 
 +
Change the {{ic|mbox}} to {{ic|maildir}} if needed, also make sure the path is correct.
  
 
To activate the new action, add this before the existing "match" line:
 
To activate the new action, add this before the existing "match" line:
  
  match account "bar" action "bar-deliver"
+
  match account ''bar'' action ''bar-deliver''
  
Then all mail to {{Ic|bar@gmail.com}} will be put into the {{Ic|bar-mail}} mail folder.
+
Then all mail to {{ic|''bar@gmail.com''}} will be put into the {{ic|''bar-mail''}} mail folder.
 +
 
 +
=== Automation with cron ===
  
===Automation with cron===
 
 
If all went well, set up a cron job to check your mail regularly.
 
If all went well, set up a cron job to check your mail regularly.
 
  $ crontab -e
 
  $ crontab -e
 
  */15 * * * * fdm fetch >> $HOME/[Mm]ail/fdm.log
 
  */15 * * * * fdm fetch >> $HOME/[Mm]ail/fdm.log
  
==Resources==
+
== See also ==
 +
 
 
*[http://fdm.sourceforge.net/ fdm's official site]
 
*[http://fdm.sourceforge.net/ fdm's official site]
 
*[http://sourceforge.net/projects/fdm/ fdm's SourceForge project page]
 
*[http://sourceforge.net/projects/fdm/ fdm's SourceForge project page]
 
*[https://lists.sourceforge.net/lists/listinfo/fdm-users fdm-users mailing list]
 
*[https://lists.sourceforge.net/lists/listinfo/fdm-users fdm-users mailing list]

Revision as of 10:08, 13 September 2013

Summary help replacing me
A guide on using fdm for the purpose of local mail delivery.
Related
Alpine
msmtp
Mutt
Postfix
SSMTP

fdm (fetch and deliver mail), is a simple program for delivering and filtering mail. Comparing it to other same-purposed applications shows that it has similarities with Mutt's very focused design principles.

Installing

Install fdm from the official repositories.

Configuring

fdm supports the tried and tested mbox format along with the newer maildir specification.

mbox

Alpine uses the mbox format, so we need to set up some files that we will be editing.

$ cd
$ mkdir mail
$ touch mail/INBOX .fdm.conf 
$ chmod 600 .fdm.conf mail/INBOX

maildir

Mutt prefers a capitized mail directory, and is able to use the maildir format. If you plan on using Mutt do the following setup.

$ cd
$ touch .fdm.conf; chmod 600 .fdm.conf
$ mkdir -p Mail/INBOX/{new,cur,tmp}

Final setup

Edit .fdm.conf, and add your email accounts and basic filter rules. Use mbox or maildir, but not both.

## .fdm.conf
## Accounts and rules for:
#> foo@example.com
#> bar@gmail.com
## Last edit 21-Dec-09

# Catch-all action (mbox):
action "inbox" mbox "%h/mail/INBOX"
# Catch-all action (maildir):
# action "inbox" maildir "%h/Mail/INBOX"

account "foo" imaps server "imap.example.com"
	user "foo@example.com" pass "supersecret"

account "bar" imaps server "imap.gmail.com"
        user "bar@gmail.com" pass "evenmoresecret"

# Match all mail and deliver using the 'inbox' action.
match all action "inbox"

This will collect the mail from the listed accounts and deliver it to the INBOX folder that we made. Refer to the fdm(1) man page for specifics on how to connect to other types of mail servers (POP3 for example).

Tip: You can also specify your login name and/or password in the .netrc file.

Testing

Once you have this setup to your satisfaction, attempt to collect your mail by manually running fdm.

$ fdm -kv fetch

This will keep your mail untouched on the server incase there are errors. Look over the output to make sure everything worked as planned. Open your favorite mail reader (MUA) and make sure that you can read the mail that was just delivered.

Extended usage

Non-essential features that add to fdm's usability

Additional filtering

If you want to have mail from a certain account go to a specific mailbox, you could add the following lines to your fdm.conf file. From the config file above, if you wanted to filter the mail from bar@gmail.com into it's own folder bar-mail, you would add this below the existing "action" line:

action bar-deliver mbox "%h/mail/bar-mail"

Change the mbox to maildir if needed, also make sure the path is correct.

To activate the new action, add this before the existing "match" line:

match account bar action bar-deliver

Then all mail to bar@gmail.com will be put into the bar-mail mail folder.

Automation with cron

If all went well, set up a cron job to check your mail regularly.

$ crontab -e
*/15 * * * * fdm fetch >> $HOME/[Mm]ail/fdm.log

See also