Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Mutt and the Single User
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Sat Apr 27, 2002 4:58 am    Post subject: Mutt and the Single User Reply with quote

mutt and the Single User

The Gentoo.org's Desktop
Guide
gives a quick start guide to using mutt. However, it
talks about using mutt in conjunction with postfix.

I add to this as I learn new things about mutt, so if you find it useful, you might want to check back on it from time to time.

Please note: The original version of this document instructed the user to create lockfiles. This may cause seg faults when transferring between mailboxes. The correction was made on May 27, 2002

Note number 2. In mid January of 2003 I decided to change the article so that getmail rather than fetchmail is used. So, the references to fetchmail in the posts below this one refer to the older version of the article.

Note number 3

As the main docs at Gentoo org now feature an article on mutt with procmail and nbsmtp I no longer maintain this article. I have a page on mutt that I do keep a bit more up to date at


http://home.nyc.rr.com/computertaijutsu/mutt.html

Note number 4

Getmail is now up to version 4 and the syntax has changed. Again, see my
computertaijutsu mutt page for information on its configuration. Basically instead of what is below it would be

[retriever]
type = SimplePOP3Retriever
server = popserver.isp.com
username = john
password = 1234
[options]
verbose = 0
delete = true

[destination]
type = MDA_external
path = /usr/bin/procmail
unixfrom = true

I'll leave the older getmail config information up for awhile, but the above is how it should now be configured.



For the single user, this can be a bit of overkill. If you're just
using one email account on a workstation, you can take advantage of
mutt's simplicity to run it without having postfix or sendmail
constantly running in the background. Additionally, mutt is capable
of a few tricks not mentioned in the Desktop Guide.

I have a
page on mutt
that might also be of use. However, that one
covers its usage under a few distros as well as FreeBSD, so this one
will be Gentoo specific.

Firstly, let's install mutt
Code:
emerge mutt


For purposes of
this article, we'll assume that we are user john with an email
address of john@isp.com. User john's password with his isp is 1234,
his ISP uses a pop server called popserver.isp.com and an smtp
server called smtpserver.isp.com. The only accounts on the box are
root and john.

Before getting started, we'll need three more programs, procmail,
getmail and nbsmtp. So, let's install them.
Code:
 emerge procmail getmail nbsmtp


One thing that keeps changing, and that I will probably not keep up to date is that one of these programs may emerge ssmtp as a dependency. That will block the emerge of nbsmtp. At present, (July 2002) it's procmail that does it. So, before emerging nbsmtp, you might have to unmerge ssmtp.
Code:

emerge -C ssmtp


The emerge of course, will be done as root (or using sudo). Once that's finished,
however, go back to being user john. Most of the rest of this will be done
by john, as john in his home directory. So, if you're not in the
home directory, get there. If you logged in as user john and did an
su to root, then simply type

Code:
exit


Then you will once again be john. If you logged in as root, then su
to john.
Code:
su - john


Now, to get to john's home directory

Code:
cd


So, we now have mutt, ssmtp, nbsmtp, getmail and procmail installed. The
first step is to make it possible for john to get his email. For
this, we'll use getmaill.

We have to set up a .getmail/getmailrc in the home directory (note the period in front of
the name).

In /usr/share/doc/getmail<version> there is a gzipped getmailrc-example file. So, we copy it into our .getmail directory and gunzip it.

Code:

cd
mkdir .getmail
cp /usr/share/doc/getmail-2.3.8/getmailrc-example.gz ~/.getmail
cd .getmail
gunzip getmailrc-example

(At time of writing the version is 2.3.8--this should be changed to the version number that
you have)
Open the file with your favorite text editor.
I use vi--if you're using nano then don't forget the -w
option, so that you don't run into problems with wordwrap.

I usually leave the first section, [default] alone. The second section [Joe's Mail] is
the one that we're going to edit. Right now it looks like
Code:

[Joe's Mail]                                    # Simple configuration for a single-user POP3 mailbox
server = mail.isp.com
port = 8110
username = joeuser
                                                # no password specified; prompt for it when getmail is run
use_apop = 1                                    # Use APOP authentication for this account instead of
                                                #   cleartext PASS
postmaster = ~joeuser/Mail/default/             # Default delivery to this Maildir
message_log = ""                                # Don't log for this account
                                                # No "local" directives necessary.
recipient_header = received                     # For this account, only look for recipient headers
recipient_header = x-envelope-to                #   in "Received:" and "X-Envelope-To:" headers
no_delivered_to = 1                             # Don't add a Delivered-To: header for this mailbox
no_received = 1                                 # Don't add a Received: header for this mailbox


With user john who has the account john@isp.com, a password of 1234 and a pop server called pop.isp.com, we'll change it so that it reads
Code:

[John's Mail]                                    # Simple configuration for a single-user POP3 mailbox
server = pop.isp.com
port = 110
username = john
password = 1234
                                                # no password specified; prompt for it when getmail is run
use_apop = 0                                   # Use APOP authentication for this account instead of
                                                #   cleartext PASS
postmaster = "|/usr/bin/procmail"             # Default delivery to this Maildir
message_log = ""                                # Don't log for this account
                                                # No "local" directives necessary.
recipient_header = received                     # For this account, only look for recipient headers
recipient_header = x-envelope-to                #   in "Received:" and "X-Envelope-To:" headers
no_delivered_to = 1                             # Don't add a Delivered-To: header for this mailbox
no_received = 1                                 # Don't add a Received: header for this mailbox




Some of this is obvious, some not. A numerical value of 0 means false--unless your isp uses APOP authentication, set that value to false. We're not logging. (If you do log, then the easiest way to do it is to put the log in the user's home directory so you don't run into permissions problems. We're handing the mail off to procmail to be delivered to user john's
mailbox or mailboxes.

The part of the file that follows can be deleted, or commented out.




Now, to avoid an annoying error message, we set permissions at 0710.
Code:
chmod 0710 .getmail/getmailrc




You can call getmail by simply typing its name at the command line
and watch it work. You might, until you're sure that it's working properly, call it with the -v or -v -v option (for verbose) to make sure all is working correctly.
Unlike fetchmail, getmail doesn't have a -d for daemon option. The author suggests running it as a cronjob, which is probably the easiest way to do it. (Other folks write while loop scripts, but I'm fairly lazy).
This next part will have to be done either as root or with root privileges. If you haven't installed any cron program then install one now--we'll use vcron as it's suggested in the install documents.
Code:

emerge vcron


Now, as root or with root privilege, we'll create a crontab file for user john
Code:

crontab -eu john

The e is for edit and u for user.

For those not familiar with crontab, there are 6 fields---minute hour day week month and the command to be run. If you don't want to specify a particular field, you can use an asterisk. So, we're going to set getmail to run every ten minutes.

(I'm leaving the below iin because it might make it a bit clearer about how crontab works, but see a couple of paragraphs down for cleaner and easier syntax)

After the previous command, your default text editor should have opened. If you're using nano, be careful of the wordwrap. So, since we're only worried about minutes, we're going to simply indicate the other fields with asterisks. In the text editor type
Code:

10,20,30,40,50,00 * * * * /usr/bin/getmail


(A quick note--when I first put in the getmail section, I mistyped the above as **** with no spaces in between the asterisks--as you'll note if you bother to read some of the comments on this, that will, of course, cause an error)

If you read the responses to this article, you'll see a cleaner way to do the crontab. Rather
than the version above, one can just do
Code:

*/10 * * * * /usr/bin/getmail

Now, getmail will run every ten minutes. If for some reason you want to remove this cronjob, then the command is
Code:

crontab -ru john

The r is for remove. Lastly, one can list the cronjob with an l option. (A lower case letter L).
Code:

crontab -lu john

One little trick--if, for whatever reason, you sometimes get mail on this box and sometimes on another so are constantly adding and removing the cronjob you can simply save it as a file.
For example
Code:

crontab -lu john > crontab.txt

Then, when you restart the cron job you can simply copy that text back in. For instance, I use vi, so suppose I've removed the cronjob. Now, I want to put it back. If I type
Code:

cronjob -eu john

vi opens up. Then, I can simply type, while in command mode
Code:

:r ~/crontab.txt

and the job is back in place.

Before leaving getmail, one more point. If your MDA writes to stderr then the session will fail.

For example, I have a despammed.com address. I like despammed.com but they insert a [despammed] tag into each email, which can be an annoyance, especially when on mailing lists. Therefore, my first procmail rule is
Code:

* ^Subject.*\[despammed\]
| sed -e '/^Subject:.*\[despammed\]/s/\[despammed\] //g'


(We'll cover procmail filtering later in this article--if any NYLUGers read this, George, who is far better at sed than I am, gave me the rule.)

The trouble is that if an email comes to any of my other addresses, procmail will write "skipped subject despammed" to stderr (for newcomers who are unfamiliar with these terms, that's standard error.) Then the delivery will fail and I won't get that mail.

The solution is detailed on [url=http.www.qcc.sk.ca/~charlesc/software/getmail-2.0/]getmail's site.[/url] If you know that your MDA can successfully continue even if something goes to
stderr, as in the above example (after skipping the despammed part, procmail continues to deliver mail to my various mailboxes without problem) change the postmaster line to read
Code:

postmaster ="|/usr/bin/procmail 2>&1"






You can leave mutt open and check it every few minutes, or use a program like
xbuffy to keep track of messages. (Xbuffy, as it's name implies, only works while in X).

. If you don't want to run getmail as a cronjob, you can do something like
Code:

getmail &&
mutt

You can also do a key binding so that you can simply invoke getmail when you feel like it, similar to clicking a send receive button in a graphical emailer. This will be covered below, in the section on w3m.

We want to configure mutt. At this point, we're just configuring it
enough to read and send our email. So, open up your text editor
(again, if you use nano, be sure to remember the -w option--this is
the last time I'll mention it)
Code:
vi .muttrc


Although a more typical .muttrc would use Mail for the first line,
Gentoo uses the ~/.maildir format. So, our .muttrc will be set as
follows

Code:

set folder=~/.maildir
set sendmail="/usr/bin/nbsmtp -d isp.com -f john@isp.com -h
smtpserver.isp.com"
my_hdr From: John <john@isp.com>



The first line tells mutt where it's putting the mail. The second
line is telling it what to use to send mail, in this case, nbsmtp
which I will explain more fully in a moment. Lastly, the my_hdr
line is what will appear in john's header.

Gentoo actually gives a system wide Muttrc in /etc/mutt. If you're running postfix or the like, that would possibly be sufficient, however, you will want to customize your headers, at least. Also, you're far better off making an error in the user's home directory than in the system wide one, so, I usually ignore the /etc/mutt/Muttrc and create my own.

Despite its power, mutt is a small and lightweight mail client.
Whereas pine will provide its own smtp for sending mail, mutt will
usually rely upon postfix or sendmail. We don't need either one,
however. All we need is a small smtp client--in this case, nbsmtp,
which stands for no-brainer smtp.

The /usr/bin/nbsmtp is obviously the path to it. The -d is for
domain--if john's email is john@isp.com then the domain is isp.com.
The -f is the from tag--it's from john@isp.com and the -h is for
host--isp com's smtp server is smtpserver.isp.com.

On one or two Gentoo installs, nbsmtp didn't work properly. Lazy
sort that I am, I decided that since ssmtp is included, I might as
well use it. So, if, when trying to send mail, nbsmtp doesn't seem
to work for some reason, and there's no mistake that you can see in
your configuration, then try ssmtp. It was installed when you
installed mutt. (However, it might have had to be uninstalled when you put in nbsmtp, so you might have reinstall it)
The ssmtp program has two other advantages over the simpler nbsmtp. It writes to /var/log/maillog and can send mail to a maximum of 100 users at a time. (nbsmtp seems to have a limit of about 4 or 5)



So, once again, open up your .muttrc file and
change the sendmail line to read

Code:
set sendmail="/usr/bin/ssmtp"


The ssmtp program is little more involved to set up, but it's
actually quite simple. You'll find that you have a file in /etc
that can be found at /etc/ssmtp/ssmtp.conf (There may only be one
called ssmtp.conf.sample or something similar, in that case simply
copy it over as ssmtp.conf

Code:

cd /etc/ssmtp
cp ssmtp.conf.sample ssmtp.conf

Now we'll edit ssmtp.conf

When you open the file in your favorite text editor, you'll see that
it begins
Code:

#
# /etc/ssmtp.conf -- a config file for sSMTP sendmail.
#

# The person who gets all mail for userids < 1000
root=postmaster

# The place where the mail goes. The actual machine name is required
# no MX records are consulted. Commonly mailhosts are named
# mail.domain.com
# The example will fit if you are in domain.com and your mailhub is
# so named.
mailhub=mail

# Example for SMTP port number 2525
# mailhub=mail.your.domain:2525

# Example for SMTP port number 25 (Standard/RFC)
# mailhub=mail.your.domain

# Where will the mail seem to come from?
rewriteDomain=yourdomain.com


# The full hostname
hostname=mail.yourdomain.com


There's usually more to it, but the above contains the only part
that we'll have to edit.

First, the line mailhub=mail will be changed to read
Code:

mailhub=smtpserver

In other words, the first part of smtpserver.isp.com's FQDN (Fully
Qualifed Domain Name. However, this doesn't always work. You may need to put in the entire name, that is smtp.server.isp.com)

Next the rewriteDomain=yourdomain.com will be changed to his ISP's
domain name. So, it will read
Code:
rewriteDomain=isp.com


Lastly, the hostname line.
This is the hostname of his workstation. So, if he called it johnsbox.isp.com it'd be

Code:
hostname=johnsbox.isp.com


The ssmtp program is now ready to use, and should send his mail
without problem.

Gentoo uses nano as its default editor. If you would prefer to use
vi to compose messages, then you would add the following to your
.muttrc

Code:
set editor=vi


Mutt will now use vi rather than nano as its editor. (You can also, as root, edit /etcprofile so that the default editor is vi, rather than nano which will do the same thing)

It's now ready to send and receive mail. However, there are a few
more things you might want to do.
When you first open mutt (by simply typing
Code:

mutt

at a command line, it will say something like .maildir does not exist, create it now? We answer yes. (This is covered in the desktop guide).

On occasion, you will find that mutt complains that .maildir is not a mailbox. This is easily fixed--the solution was posted recently by Echo5ive at
https://forums.gentoo.org/viewtopic.php?t=7780

Add three directories to your .maildir named cur tmp and new. The next time you start mutt, you won't see the error message. So, make the directories.
Code:

cd .maildir
mkdir cur
mkdir tmp
mkdir new

This fixes that problem.




One thing you'll notice is that
mutt shows full mail headers. If you find this more information than
you really want, you can add the following to your .muttrc file

Code:

ignore *
unignore date from to cc subject resent-from reply-to x-mailer


This can be adjusted according to your personal taste--the above
example will only show the headers of the date, the from, the to,
cc, the subject, resent-from if it was forwarded, the reply-to and
the x-mailer.

This may be enough for the average user. However, we're going to
finetune mutt a little more.

Viewing and getting to urls in an email message

Right now, if you receive an email message with a url, you'll have
to cut and paste the url into your browser. We're going to fix this
now. Once more, su to root and emerge w3m, a text based browser
that has some similarities to lynx but a few more capabilities.

Code:
emerge w3m


Once this is done switch back to being user john.

Now, we're going to add the following to our .muttrc file

Code:
macro pager \cb |w3m\n


The \cb means that we're binding the Ctrl + b key to start up w3m
while in mutt. So, if you're reading a message that has a url in
it, and you'd like to simply get to the url, hit Ctrl + B and the
email will open up in w3m. You'll now see more header information
and such. You can now get to the url in the same way you would
navigate in vi. Start by hitting the colon key. Say the url is http://www.example.com you could get there quickly with

Code:
/example


Your cursor will then be on the example part of the url. Hitting
the enter key will now open up the url in w3m.

Also, w3m can be used to read those html formatted mails we all love. You'll find that you have a file, /etc/mailcap. In it are two lines beginning with
Code:

text/html; /usr/bin/lynx -dump

then it continues, one saying -force etc and the other saying -dump etc. You can change lynx in these two lines to w3m, but you also need to add a line saying (or modify the -dump line)
Code:

text/html; /usr/bin/w3m -dump -T text/html %s


(This doesn't always work--I've never really investigated it as most of the html mail I get is spam. On the other hand, if I do emerge lynx and leave
/etc/mailcap alone I can view those html messages--as I said, most of them turn out to be spam).

Earlier, I said I would cover keybinding getmail in this section. If you don't feel like waiting till the next time getmail is supposed to run, you simply invoke it by hitting
Code:

G

(Note that that is a capital G) For this to work, however, you have to add a couple of lines to your .muttrc
Code:

macro index       G "!getmail\n"  "Invoke getmail"
macro pager       G "!getmail\n"  "Invoke getmail"




Filtering email with procmail

The next thing we'll cover is filtering mail. If you're on several
mailing lists, then you'd probably like to sort your mail into
various mailboxes. This is not very hard to do.

The following is taken from the
Procmail
Quickstart Guide.
The Quickstart Guide goes into far greater
detail, however this should get you up and running with mail
filtering.

So, let's create a .procmailrc file

Code:

PMDIR=$HOME/Procmail
VERBOSE=no
MAILDIR=$HOME/.maildir
INCLUDERC=$PMDIR/rc.lists


This tells procmail to look in a directory called Procmail in the
user's home directory. For filtering, it's going to check a file
called rc.lists in that Procmail directory. So, let's create the
two.

Code:

mkdir Procmail
cd Procmail

Now, using your text editor, open a new file that we'll call
rc.lists

The Quickstart guide recommends putting your busiest lists first.
So, the two busiest lists to which I belong are freebsd-questions
and gentoo-user. Therefore, I start with those. Note that it is the numeral zero, not a capital letter o.

(A quick note---the quickstart guide has a slightly different syntax--rather than :0 they have :0: This creates a lockfile, which we don't want. It may cause seg faults when changing between mailboxes. Gentoo uses the .maildir format so lock files are unnecessary.)


Code:

:0
* ^TO_freebsd-questions
IN-bsdquestions

:0
* ^TO_gentoo-user
IN-gentoo-user


Now, when you run getmail, it will filter any messages addressed
to freebsd-questions@freebsd.org. The ^TO_ means that it will search
for a header beginning with To, Cc, Resent-To or other destination
parameter, followed by any (or no) characters, followed by an email
address beginning with freebsd-questions@freebsd.org. It's
case-insensitive too, which is handy.

You can put as many of these as you like. You don't have to create
the FreeBSD_Questions mailbox, it will be created the first time
you get a message sent to freebsd-questions. Sometimes, people send
to questions@freebsd.org so I add a rule for that one too--I want it
to go in the same mailbox as something addressed to
freebsd-questions@freebsd.org

Code:

:0
* ^TO_questions@freebsd.org
IN-bsdquestions

Once this is done, if the mail you get is filtered into one of these
mailboxes, when you open mutt, you won't see them. Anything not
covered by your filters will simply go into the default inbox
To view the other mailboxes, simply hit the letter c (no Ctrol or
Alt is necessary) You'll see a message
Code:
Open Mailbox ("?" for list)

Hitting the ? key (or the tab key, which will also work) shows me a
list of my mailboxes. Although it doesn't show me how many messages
are in each, any empty mailbox will have a 0 in front of it,
indicating that no mail was filtered to that box. Use the arrow key
to highilght the desired mailbox, then hit enter, and you'll see the
messages in that box.

Another filtering trick that I find useful is this one to strip things in brackets out of a subject line. For example I use the excellent www.despammed.com to help filter out spam. However, they have the to me inconvenient habit of putting a [despammed] in each subject line. Therefore, my friend George, a sedmeister, gave me this simple filter for it. It should probably go at the top of your rc.lists
Code:

:0 f
* ^Subject.*\[despammed\]
| sed -e '/^Subject:.*\[despammed\]/s/\[despammed\] //g'


A couple of other tricks that I find useful--to nicely sort my mail that doesn't fit into other categories, I have, at the bottom of my rc.lists a rule for that. Using our john@isp.com as an example, one could put, as the last entry on the list
Code:

:0
* ^TO_john@isp.com
IN-personal

(If he needed it for his john@isp1.com account as well, he'd just add that.

I'm a little anal, I want everything to go somewhere--so, actually, my last rc.lists rule is

Code:

:0
* ^TO_.*.
IN-misc


You can also filter sent mail. Gentoo copies sent mail to .maildir-sent by default--this has directories of cur new and temp, but finding a sent message can be a bit of a chore. So, I copy my sent messages to a folder in my .maildir called SENT, where they are easily viewed. To do this, I add the line to my .muttrc file
Code:

fcc-hook .*. "~/.maildir/SENT"


The .*. captures all sent mail and puts it in the SENT directory.
Some people prefer to divide their sent mail into various folders. This is easily accomplished. Remember, the .muttrc line above will capture all sent mail--so, as .muttrc processes commands in order, if you want to capture some sent messages and put them elsewhere, insert any such lines above the .*. filter. For example
Code:

fcc-hook "gentoo-user"  "~/.maildir/Gentoo-sent"

Speaking of segfaults, which I was doing a few paragraphs ago--some folks find that they will get a segmentation fault if they are emerging something while using mutt. One possible cause of this is that the ebuild and mutt may be trying to share the /tmp directory. One, as yet unverified way around this is to give mutt its own tmp directory in your home directory. So, first create a tmp directory in your home directory. (If you skip this step, you'll get a message that mutt can't open the temporary files).
Code:

cd
mkdir tmp

Then, open up the .muttrc file and add the line
Code:

set tmpdir="~/tmp"

I repeat, I haven't verified that this will always work. The trouble is that I would only get these segfaults sometimes while emerging and simultaneously using mutt. Therefore, the fact that I haven't gotten a segfault while doing both at once since then isn't a guarantee that this will fix the problem.
(Note--since this was written, someone on gentoo-user mentioned that it had not fixed the problem--he was still getting segfaults when using mutt while emerging. However, having a ~/tmp directory certainly won't hurt and helps to keep everything in its place).
(Note. Since writing the above, I've confirmed that not only does it seldom work, but that the problem is related to sandbox, and was reported on bugzilla back in February 2002. Interested readers can check current status of the bug at
https://bugs.gentoo.org/show_bug.cgi?id=501.

Further update to the above--if one looks at the above url, you'll see that if you're running a later version of
gcc (2.95.3-r7 or gcc3) and
glibc 2.2.5-r7 (which was unmasked when I did an emerge rsync on August 19, 2002) fixes the problem. So, I'm guessing that it will be fixed by the time 1.4 is released)



Aliases--Mutt's Address Book

While mutt doesn't have an Outlook Express type address book, one can keep a list of addresses with an alias file. Open your .muttrc file and add the lines
Code:

set alias_file=~/.mutt_aliases
source ~/.mutt_aliases

Suppose you want to keep the address for gentoo-user@gentoo.org, gentoo-newbies@gentoo.org and the address for your friend John Smith who has an email address of jsmith@isp.com. Outlook Express has spoiled you so you only want to type a few letters and have the address complete itself. You want to able to type genu for gentoo-user, genn for gentoo-newbies and john for your friend John.

With your text editor, create a new file called .mutt_aliases. In it, enter the following
Code:

alias genu       <gentoo-user@gentoo.org>
alias genn       <gentoo-newbies@gentoo.org>
alias john         John Smith    <jsmith@isp.com>

The next time you open mutt, when you type m to send an email, all you have to do is type in the alias. You won't see it expand to the proper address until after you've written the email and are ready to send it, but the alias will expand to the proper address. In the case of John, you will see the John Smith in the header as well as his email address.


You can also, once the To: line comes up, simply hit the tab key and you will see your list of aliases at the top of the screen.


If you want to create an alias for the sender of the email that you are currently viewing, simply hit
Code:

a

Mutt will then open up a dialog to create the alias. However, at least in Gentoo, I've found that it wants to store it in /.mutt_aliases. Therefore, you might have to manually edit that line--for instance, I have my .mutt_aliases in my home directory, so I simply eliminate the first / It will then save it to .mutt_aliases.


Replying to a mailing list

Recently, there have been some changes in the Gentoo lists--they are going to set it so that reply to will only reply to a sender rather than the entire list. There are arguments for and against this but dealing with it is not difficult.
Open up your .muttrc file and add the line
Code:

subscribe gentoo-

Now, when you have message from one of the Gentoo lists, and want to reply to the list, you can simply hit
Code:

L


(Note that it's capitalized)

This will send your reply to the list rather than the individual. The idea of the subscribe line is to give .muttrc enough of an idea of the mailing list for it to find it. For example, freebsd-questions@freebsd.org has the same format, where a reply will go to the original poster rather than the mailing list. However, some people, rather than posting to freebsd-questions@freebsd.org just post to questions@freebsd.org. Therefore, if your .muttrc had
Code:

subscribe freebsd-questions

and you then hit L to reply to someone who had posted to questions@freebsd.org rather than freebsd-questions@freebsd.org mutt will then complain that no mailing list was found.
The other way to do this, without altering your .muttrc is to simply hit
Code:

g

for group. It will then reply to the posters and send a cc to the mailing list. The disadvantage of this method is that the string of recepients grows and grows as people join the thread--and all of them receive two copies of the message which can be a nuisance.
HOWEVER--in many cases, especially on a list as busy as FreeBSD-questions, which doesn't require you to subscribe in order to post, this can actually be an advantage. Many of the gurus on the list seldom have time to look at each email, and won't respond unless they get a private copy. Also, on freebsd-questions, one will frequently see something like, "Please respond to me personally as I am not subscribed." Therefore, the private copy that each participant in a thread receives can actually be a Good Thing (TM)

As adding subscribe lines to .muttrc is not a big deal, I usually add them, to give myself the option. Then, if, for example, I'm replying to one of the FreeBSD gurus, or if the original poster has requested a private reply, I use the g for group option. If it seems unecessary, I simply use the L option.

As many of the more technical Unix lists use this format it's a handy trick to know

Sending from different email accounts

Sometimes you have more than one email account. There are various ways to do this--however, I'm giving the one that I use, as I find it the easiest. Your mileage may vary.
So, let's return to our user john at isp.com.
[/code]
The first thing he has to do is add his second account to getmailrc. So, let's say he now has signed up with a second isp, isp1.com. His email there is john@isp1.com, their pop server is pop.isp1.com, his username is again john and his password is again 1234. The smtp server is smtp.isp1.com.
So, he'll copy over the [John's Mail] section of his getmailrc and just change the server line
to read
Code:

server = pop.isp1.com



Now he goes to his .muttrc file. The original one looks like
Code:

set folder=~/.maildir
set sendmail="/usr/bin/nbsmtp -d isp.com -f john@isp.com -h
smtpserver.isp.com"
my_hdr From: John <john@isp.com>

However, now he wants to use his john@isp1.com account to send and receive from gentoo-user. The current set sendmail line and my_hdr line will be his default. If he wanted to make isp1 his default, he would change those two lines accordingly. However, in this case, he only wants to use the isp1 address when sending mail to gentoo-user.
So, he will add these lines to his .muttrc file
Code:

send-hook "gentoo-user@gentoo.org"  "my_hdr john@isp1.com"
send-hook "gentoo-user@gentoo.org"  'set sendmail="/usr/bin/nbsmtp -d isp1.com -f john@isp1.com -h smtp.isp1.com"'

Note that the send-hook lines should be on one line each. If half of the set sendmail line is on a second line, mutt will complain about errors in .muttrc. You may know that you can indicate that something should be read as one line with a \ (If you're not familiar with this, for it to work, don't hit the space bar after hitting enter--in other words, for our set sendmail line, you might do this
Code:

send-hook "gentoo-user@gentoo.org"   'set sendmail="usr/bin/nbsmtp -d isp1.com \
-f john@isp1.com -h smtp.isp1.com"'

You might have to play with the spacing here--if, when you start up mutt again, it gives you an error in .muttrc it probably means that you added an extra white space--in general, I find it works best when, if the unbroken line would have been -d isp1.com -f john@isp1.com then there should be a white space after the -d isp1.com before the backslash, then no white space after hitting enter (a mistake that I frequently make).

At any rate, now, whenever john sends a message to gentoo-user@gentoo.org it will go through his isp1.com account.

If John belongs to several gentoo.org mailing lists, and wants to set this so that every email he sends to any list at gentoo.org is from isp1 then he could do this
Code:

send-hook ".*.gentoo-org" "my_hdr john@isp1.com"
send-hook ".*.gentoo-org" 'set sendmail="/usr/bin/nbsmtp -d isp1.com -f john@isp1.com -h smtp.isp1.com"'


This way, any mail going to an address ending with gentoo.org will be sent from the isp1 account.

If you don't have to do anything with your sendmail configuration but simply want to use a different from address, you can also simply hit
Code:

E

before sending the email--this will let you edit your headers.

There is another method that might be more convenient for replying to private, as opposed to mailing list, emails. Let's say that John usually uses his isp.com account, but at times also uses his isp1.com account. He sends an email to Bill using the john@isp1.com address. Bill replies to him--the email, naturally enough, goes to john@isp1.com. Now, John wants to reply to Bill--he also wants to continue this correspondence on the isp1.com account. He could do this by adding more send-hook rules, but there is another way--this is another one that won't change the default sendmail setup, so if he must use a different smtp server it might not work. However, in most cases, it shouldn't cause a problem.

Firstly, John will go to his .muttrc file. When he first made the file, he put in the line
Code:

my_hdr From: John <john@isp.com>

As the my_hdr line here will override what we are about to do, he will use different syntax. He will change that my_hdr line to read
Code:

set from="John <john@isp.com>"

Now he will also add these lines to his .muttrc
Code:

set reverse_name=yes
set alternates="john@isp1.com"

If he'd had a third account, he could have added that one using pipes, eg
Code:

set alternates="john@isp1.com|john@isp2.com"

The last time I set this up, it only worked if I entered it as shown above, with no white space between the email addies and the pipe.


He now has it set so that any emails addressed to john@isp1.com will be answered using the isp1.com address. His default address will remain john@isp.com



Colors in mutt

I am not an expert on this, but will just give you a few ideas to get started. Let's suppose that you want the headers to show different colors for the from to date and subject lines. You can check the man muttrc for available colors, but the last time I looked, it didn't seem to have them all.

Anyway, once again, open up your .muttrc file. You can change these colors to suit your taste. Add the lines
Code:

color header brightred black ^from
color header brightblue black ^to
color header brightcyan black ^subject
color header brightgreen black ^date

You will see, the next time that you open mutt that your from, to subject and date headers reflect the colors you added. In case you're not sure what these meant,
color, header obviously indicates that you're giving a color to the header. Next are the foreground and background colors, for instance brightred on a black background. The ^to (again, this is case-insensitive) shows what aspect of the header that you want to change.
There are many more things you can do with them, but this basic pattern works for me.


Spel-cheking, err, Spell Checking

While this is not part of mutt per se, it's a handy thing to have. I use vi as my editor, and have also emerged ispell. So, adding the following line to my .exrc enables me to spell check when composing email.
Code:


map <F6> :!ispell %^M:e %^M


Note that the ^M is actually a return character. When entering this into your .exrc with vi you would first hit ctrl + V
(more commonly shown as ^V) and then the return key.

You'll also have to add this line to your .muttrc

Code:

set ispell="/usr/bin/ispell"



Now, when composing email, if you hit F6, ispell will run, highlighting words that aren't in its dictionary.

Mutt and GPG
Rather than reinvent the wheel here, I'm going to send you to Justin Miller's page on this. Towards the bottom of the page, he tells you what you should add to your .muttrc to have it work properly. It can be cut and pasted--just be sure, if using vi, to set wrapmargin=0 and also be sure to replace his public key with your own. :)

Also, note that Outlook Express users may receive your gpg signed emails as text attachments--this might be filtered by their network admins, etc. There is a way around this, but I haven't looked into it. It involves a patch and some reconfiguring. Supposedly mutt 1.5 will handle it more easily. The mutt faq mentions it and gives the solution of tell them to use a non-broken email client. If the recepient is using Outlook Express and you can't get them to change to a non-broken client, then they'll either have to deal with it as a txt attachment or else you can send it clear.

I'm showing a workaround below but NOTE This workaround seems to break GPG with standards compliant email clients. At present, we have found that Sylpheed, for example, no longer sees an email sent as digitally signed if one applies the following patch. (But I'm giving you a workaround for the workaround too)

The workaround involves applying a patch that can be found here, made by Mr. D. Woolridge. Just copy the patch and save it somewhere--I saved it in my /home/scottro directory. If you're unfamiliar with saving patches, then the easier way might be to go here and look towards the bottom of the page for pgp traditional patch for forcing text/plain (or something like that) right clicking and just saving it.

I deleted my my /usr/portage/distfiles/mutt tarball and /var/tmp/portage/mutt directories. Testing on another box showed that those steps weren't necessary, assuming you still have your /var/tmp/portage/mutt-version_number/work/mutt-1.4 directory. Much of the following came from this thread.

I'm also found, with a bit of experimentation, that for the patch to work successfully, I had to remove the cjk flags from my USE variables in /etc/make.conf. (This hasn't affected mutt's ability to read or input Japanese.) As various things requiring root's permissions were involved, I did the entire process as root--I imagine that sudo would have worked as well, but didn't do it that way. So, we're assuming that the patch, which is named patch-1.4.0 something is in my /home/scottro directory.
Code:


emerge -f mutt
ebuild /usr/portage/net-mail/mutt/mutt-1.4-r2.ebuild unpack

As mentioned above, if you already have your /var/tmp/portage/mutt-1.4.x/work/mutt-1.4 directory, the fetching and unpacking could be skipped. Anyway....
Now that this is done, I go into the work directory and patch the source code.
Code:

cd /var/tmp/portage/mutt*/work/mutt-1.4
cp /home/scottro/patch-1.4.0* .

I've copied the patch into the work/mutt-1.4 directory. There's a period at the end of that command, indicating current directory, which might be hard to see. :)
When I had the cjk flags there, there was also a second directory in work, something like mutt-1.4-1ja (or something similar). This is where I ran into problems. Rather than experiment with several different ways of doing this, I would just say that if you have that directory, you should probably remove the cjk USE flags, remove your /usr/portage/distfiles/mutt*, rm -rf your /var/tmp/portage/mutt* and start with emerge -f and the ebuild unpack command that I've already discussed.

Code:

patch -p0 < patch-1.4.0*
cd

The cd is just my habit--I doubt that it would make any difference.
Code:

ebuild /usr/portage/net-mail/mutt/mutt-1.4-r2.ebuild compile
ebuild /usr/portage/net-mail/mutt/mutt-1.4-r2.ebuild install
ebuild /usr/portage/net-mail/mutt/mutt-1.4-r2.ebuild qmerge

Lastly, we have to add a line to .muttrc. I would only do this if most of your mail is sent to OE and other non-complient client users.
Code:

set pgp_create_traditional="yes"

Your OE using friends will now receive your gpg signed messages as inline text rather than an attachment.

However, as mentioned, your tech friends will not receive properly signed emails. Therefore, rather than add the above line into your .muttrc and commenting it out, then uncommenting it, which can definitely be a nuisance, leave the line out of .muttrc. On the occasions when you do need it then, before sending your mail do
Code:

: set pgp_create_traditional="yes"

That's a colon, then the line that could be added to .muttrc. A colon indicates that the following line should be read as if it were part of your .muttrc




A few more quick notes here. If you mistype your pgp passphrase, then hit ctrl+shft+F and the passphrase will be forgotten, enabling you to enter it again. Also, before hitting y for send, if you hit p a GPG menu comes up--you can choose to sign (which would be the default if you use Mr. Miller's .muttrc) encrypt and sign, sign as, or forget it. If you choose f for forget it, it wil be sent without GPG signing for your OE using friends.




Hopefully, this will get you started, and give you an idea of the
power of mutt

Mod edit: Changed greaturl.com to example.com on request by owner of greaturl.com. --kallamej, 2005-03-15


Last edited by scottro on Fri Oct 15, 2004 10:58 pm; edited 9 times in total
Back to top
View user's profile Send private message
whit
Tux's lil' helper
Tux's lil' helper


Joined: 26 Oct 2002
Posts: 121
Location: VT

PostPosted: Mon Nov 04, 2002 7:22 pm    Post subject: An nbsmtp limitation; procmail invocation Reply with quote

In running with this setup I've discovered that nbsmtp does not handle To addresses right if they are in the form of
Code:
"Last, First" <flast@some.com>
which nbsmtp parses as two addresses
Code:
"Last
and
Code:
First" <flast@some.com>
which will result in nbsmtp apparently working, but the downstream mail server most likely complaining about unbalanced quotes and failing to send the mail onto anywhere. This can be worked around by making sure there is no comma within quotes in e-mail addresses.

Or qmail can be installed fairly simply for outgoing mail. See https://forums.gentoo.org/viewtopic.php?t=14132 for notes on that. In particular, be sure the svscan daemon is running even for outgoing mail. If using qmail with the setup above, comment out the lines to invoke nbsmtp from .muttrc if you've added them per the main doc here. For incoming mail there's still an advantage to feeding from fetchmail directly to procmail, as qmail needs extra setup to use procmail, and procmail is very handy for sorting mail and anti-spam.

Just in case you're blending this with instructions in the Fetchmail docs, the form of procmail invocation above works well in .fetchmailrc
Code:
mda "/usr/bin/procmail -d %T"
while an alternate form suggested in one of the Fetchmail doc examples
Code:
and wants mda /usr/bin/procmail
has the flaw, if you're using mbox-format mail files, of not writing an initial From line, which results in mutt not seeing the mail.
Back to top
View user's profile Send private message
microbrain
n00b
n00b


Joined: 21 Nov 2002
Posts: 33
Location: Bredene, Belgium

PostPosted: Wed Nov 27, 2002 10:14 am    Post subject: fechmail & cleartext Reply with quote

Newest versions of fetchmail (mine says 6.1.2+RPA+NTLM+SDPS+SSL+NLS)
seem to prefer encrypted protocols.

If your pop server doesn't support encryption you'll get errors these:
fetchmail: SSL connection failed
fetchmail: Authorization failure on john@isp.com
fetchmail: Query status=3 (AUTHFAIL)

The solution is to specify you want to use cleartext for authentication in your .fetchmailrc, like this
(before)
poll pop.somewhere.org proto pop3 user john password "1234"
(after)
poll pop.somewhere.org proto pop3 auth password user john password "1234"

Hope this helps somebody
_________________
"It's not stupid, it's advanced." -- Purple Tallest
Back to top
View user's profile Send private message
Lockup
Guru
Guru


Joined: 25 Jul 2002
Posts: 430

PostPosted: Sun Dec 01, 2002 5:53 pm    Post subject: Reply with quote

hmm the ".fetchmail: SMTP connect to localhost failed" error msg...is there a way to remove it? its not affecting me in any way, as you pointed out in the howto, but i tend to like not seeing errors happening...maybe some var somewhere i could remove i dunno, any idea?
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Sun Dec 01, 2002 9:33 pm    Post subject: Reply with quote

I only looked into it when it first happened, and googling indicated that most people just ignored it or were running something like sendmail. So, I've never looked more deeply into the answer--if someone has it, please post it and I'll incorporate it into the article. However, as mentioned in the article, I think that if you run postfix, sendmail or the like, you won't have the problem.


Scott
Back to top
View user's profile Send private message
Zu`
l33t
l33t


Joined: 26 May 2002
Posts: 716
Location: BE

PostPosted: Wed Dec 18, 2002 3:43 am    Post subject: Reply with quote

the correct ssmtp path is:

Code:

/usr/sbin/ssmtp
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Mon Jan 06, 2003 5:00 am    Post subject: Reply with quote

A followup to the question on error messages.

If one uses getmail instead of fetchmail, you won't get the error messages. I'm working on a getmail page, but it's fairly simple to configure--the only thing that might not be clear from a sample configuration file is that if one were using procmail, the postmaster entry should read
Code:

postmaster = "|/usr/bin/procmail"


Hope this is of use to someone
Scott
Back to top
View user's profile Send private message
Empty_One
n00b
n00b


Joined: 18 Oct 2002
Posts: 32

PostPosted: Tue Jan 21, 2003 5:42 am    Post subject: Reply with quote

Quote:
Scottro said:For those not familiar with crontab, there are 6 fields---minute hour day week month and the command to be run. If you don't want to specify a particular field, you can use an asterisk. So, we're going to set getmail to run every ten minutes.

After the previous command, your default text editor should have opened. If you're using nano, be careful of the wordwrap. So, since we're only worried about minutes, we're going to simply indicate the other fields with asterisks. In the text editor type
Code:

10,20,30,40,50,00 **** /usr/bin/getmail


I'm using vcron also, but when I copied your code exactly, I received errors from contrab about an error reading the hour. I had to change it to this for it to work properly:
Code:

10,20,30,40,50,00 * * * * /usr/bin/getmail


Other than that, it was perfect (as far as I could tell). I finally got mutt up and running, with all my mail sorted and everything. Thanks alot.

Now all I have to do is figure out how to ssh into this machine thru works proxy so I can read my mail. :)
_________________
"Barney sucks! Best Buy sucks! Sony Sucks! Microsoft sucks, Bill Gates is the anti-Christ and John Ashcroft can kiss my ass!" Wil Wheaton
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Tue Jan 21, 2003 7:00 am    Post subject: Reply with quote

You are quite correct--I mistyped it. The error has been rectified (with a note that it was originally mistyped.) Thanks very much for pointing it out to me, and I'm glad the rest of the article was helpful.

Scott
Back to top
View user's profile Send private message
BackSeat
Apprentice
Apprentice


Joined: 12 Apr 2002
Posts: 242
Location: Reading, UK

PostPosted: Tue Jan 21, 2003 6:23 pm    Post subject: Reply with quote

Another way of writing the cron entry, which some may consider cleaner, is:
Code:
*/10 * * * * /usr/bin/getmail


BS
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Tue Jan 21, 2003 10:21 pm    Post subject: Reply with quote

I actually like that method better and it will be put in the article within a few hours.

Scott (who didn't read the man page carefully enough and missed that one)
Back to top
View user's profile Send private message
S_aIN_t
Guru
Guru


Joined: 11 May 2002
Posts: 488
Location: Ottawa

PostPosted: Mon Feb 10, 2003 3:16 pm    Post subject: Reply with quote

I have gone through the tutorial but there is one problem. Procmail concatenates mail based on the filtering rules, instead of placing it into a folder with that name.

Example: I have a rule that says
Code:

:0
* ^TO_tech@openbsd.org
IN-techOpenBSD


when i get new mail, anything that matches that rule goes into a single file called IN-techOpenBSD instead of a directory with the same name. I've gone over the config files a couple of times.. but there i cannot see anything being wrong with them.

any thoughts on what could be wrong?
_________________
"That which is overdesigned, too highly
specific, anticipates outcome; the anicipation of
outcome guatantees, if not failure, the
absence of grace."
- William Gibson, "All Tomorrow's Parties"
----
http://petro.tanreisoftware.com
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Mon Feb 10, 2003 4:01 pm    Post subject: Reply with quote

It looks correct to me. Is it only with the openBSD mail, or all mail?

Hopefully, someone else can jump in on this, I'm stumped
Back to top
View user's profile Send private message
S_aIN_t
Guru
Guru


Joined: 11 May 2002
Posts: 488
Location: Ottawa

PostPosted: Mon Feb 10, 2003 4:09 pm    Post subject: Reply with quote

i got some help in the local lug irc channel.. i wa told that by default procmail uses the mdir format.. (the one where all the messages get appended to one file) to force procmail to create a new folder i had to add a "/" to the mailbox name.

so if i had this in .procmailrc
Code:

:0
* ^TO_tech@openbsd.org
IN-techOpenBSD

it is now changed to
Code:

:0
* ^TO_tech@openbsd.org
IN-techOpenBSD/


Now i have the folders created and it is all working. :D Thanks for a great guide.. I dont have to rely on KDE's Kmail anymore..
_________________
"That which is overdesigned, too highly
specific, anticipates outcome; the anicipation of
outcome guatantees, if not failure, the
absence of grace."
- William Gibson, "All Tomorrow's Parties"
----
http://petro.tanreisoftware.com
Back to top
View user's profile Send private message
RealisticDragon
n00b
n00b


Joined: 10 Apr 2003
Posts: 1

PostPosted: Thu Apr 10, 2003 2:31 pm    Post subject: Qmail Reply with quote

Is there a Qmail howto anywhere on creating an adequatly secured configuration (sending only from the local machine, or possibly from a list of IP addresses) as I have no desire to run an open relay for every spammer in the world :o)

I am planning on using getmail for recieving, so that isn't required with qmail (except how to disable it).

Thanks,
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Apr 16, 2003 3:44 pm    Post subject: Reply with quote

Does getmail support pop-ssl?
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed Apr 16, 2003 4:31 pm    Post subject: Reply with quote

bludger wrote:
Does getmail support pop-ssl?

I have found a link which seems to answer my question.
https://forums.gentoo.org/viewtopic.php?t=36034&highlight=getmail+stunnel
Any success stories with this configuration?
Back to top
View user's profile Send private message
bludger
Guru
Guru


Joined: 09 Apr 2003
Posts: 389

PostPosted: Wed May 14, 2003 4:55 pm    Post subject: Reply with quote

I finally decided upon using fetchmail and procmail, since fetchmail has ssl support integrated (no need for an stunnel daemon) and procmail seems to support maildirs fairly well. This seems to work fairly well for mail reception.

For sending mail, I am a bit stuck. My MSP (mail service provider ?) supports
LOGIN authorisation + TLS. Does anyone know whether nbsmtp supports such authorisation, or do I have to use a mail server such as postfix (which I would rather not do, as it is yet another layer of complexity and would have to be running all the time, which is yet another security risk).

Any ideas? I have not been getting many answers to my questions lately. Is it that they are too hard or too stupid?
Back to top
View user's profile Send private message
jkalderash
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 111

PostPosted: Thu Feb 19, 2004 4:24 am    Post subject: Why no CC? Reply with quote

Hello,

This is a wonderful tutorial, and I'm very happy with what mutt is able to do. I have one major problem, though - I am unable to carbon-copy outgoing messages. As far as I can tell, if the message has a CC field, nothing gets sent, which is very frustrating. I've got the "sendmail" line set up as specified:

Code:
set sendmail="/usr/bin/nbsmtp -d mycollege.edu  -f username@mycollege.edu -h mail.mycollege.edu"


I'm sure I have the correct server name and all (obviously I've changed it here). Does anyone know what might be causing this, how I can proceed, or any simple alternatives I can use? I really like having just one line in my muttrc...
Back to top
View user's profile Send private message
scottro
Tux's lil' helper
Tux's lil' helper


Joined: 13 Apr 2002
Posts: 141
Location: New York City

PostPosted: Thu Feb 19, 2004 4:31 am    Post subject: Reply with quote

Thanks for the kind words.

You should, once the email is finished and ready to send, just be able to hit
Code:

c

type in the cc'd recepient's email and it should work.

I don't maintain this page any more, as there is another guide in the main Gentoo docs. However, I have found (dont think it's mentioned in this article) that nbsmtp seems to have a limit of only a few names that it can send at a time. You might want to switch over to ssmtp.

I have a non-specific gentoo mutt article that I do keep more up to date at

http://home.nyc.rr.com/computertaijutsu/mutt.html

Scott[/code]
Back to top
View user's profile Send private message
jkalderash
Tux's lil' helper
Tux's lil' helper


Joined: 07 Jul 2003
Posts: 111

PostPosted: Thu Feb 19, 2004 9:18 pm    Post subject: Reply with quote

Thanks for the advice. I actually just ended up using mutt's own software - I commented out the "sendmail" line and added a line:

Code:

set hostname="mail.mycollege.edu"


Seems to work like a charm. Thanks!

-Laura[/code]
Back to top
View user's profile Send private message
chris.pickett
n00b
n00b


Joined: 05 Apr 2004
Posts: 72
Location: Montreal

PostPosted: Thu Apr 22, 2004 6:33 am    Post subject: don't use nbsmtp Reply with quote

Hi. I liked and used your guide too, but I must say that nbsmtp does have its fair share of problems, including what I think was silently dropping mail on some occasions or forwarding mail to the wrong address (ouch!). I know this is out of date anyway, but I just used this guide, and so anyone else using it: nbsmtp is unmaintained, try postfix instead. Cheers!
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Tue May 11, 2004 5:00 pm    Post subject: Reply with quote

Hi,

Great guide. I've used it periodically to help me with various things in this set up. I'm currently having a strange problem with my mail sending successfully, but as my local computer username rather than as my mail username, which is different.

In my .muttrc I have the following:
Code:

set from="David Kaplowitz <david.kaplowitz@thistestdomain.com>"

Which is the correct e-mail username I want to send as....but it's not sending as that username, it's sending as my local login which is just "dkap"

Code:

root=postmaster
mailhub=smtp
rewriteDomain=thistestdomain.com
hostname=david-kaplowitz.thistestdomain.com
UseSTARTTLS=YES

hostname is the name of my local computer.

I'm searching around ...trying to find an answer to why my .muttrc setting is not working.

Thanks for any clues.

Dave
_________________
http://dkap.info
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Tue May 11, 2004 5:20 pm    Post subject: Reply with quote

dkaplowitz wrote:
I'm currently having a strange problem with my mail sending successfully, but as my local computer username rather than as my mail username, which is different.


nm, I got it working by uncommenting this: FromLineOverride=YES from /etc/ssmtp/ssmtp.conf
_________________
http://dkap.info
Back to top
View user's profile Send private message
dkaplowitz
Guru
Guru


Joined: 22 Nov 2003
Posts: 596
Location: Philadelphia, PA

PostPosted: Wed May 26, 2004 7:20 pm    Post subject: Re: Mutt and the Single User Reply with quote

scottro wrote:
mutt and the Single User
Lastly, we have to add a line to .muttrc. I would only do this if most of your mail is sent to OE and other non-complient client users.
Code:

set pgp_create_traditional="yes"

Your OE using friends will now receive your gpg signed messages as inline text rather than an attachment.

However, as mentioned, your tech friends will not receive properly signed emails. Therefore, rather than add the above line into your .muttrc and commenting it out, then uncommenting it, which can definitely be a nuisance, leave the line out of .muttrc. On the occasions when you do need it then, before sending your mail do
Code:

: set pgp_create_traditional="yes"


That's a colon, then the line that could be added to .muttrc. A colon indicates that the following line should be read as if it were part of your .muttrc


I've set the
Code:

set pgp_create_traditional="yes"
in my .muttrc and my mutt client doesn't show this as being broken, and it's working for non-RFC 2015-compliant mail clients. I'm wondering if it's because it emanated from mutt. I guess I can try it on another RFC 2015 compliant mail client to be sure.

I'd be curious to know if anyone's successfully using this setting without showing the sig as broken in _real_ mail clients.

Dave
_________________
http://dkap.info
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum